FLOCKFILE(3S) BSD FLOCKFILE(3S)
NAME
flockfile - lock a stdio stream
SYNOPSIS
#include <stdio.h>
void flockfile (FILE * stream );
DESCRIPTION
The flockfile function locks a stdio stream so that a thread can have
exclusive use of that stream for multiple I/O operations. Use the
flockfile function for a thread that wishes to ensure that the output of
several putc(3S) functions, for example, is not garbled by another thread
also trying to use putc(3S).
Matching flockfile and funlockfile calls can be nested.
The behavior of the flockfile function is unspecified if the stream
argument does not point to a valid FILE structure.
SEE ALSO
funlockfile(3S), unlocked_getc(3S), unlocked_putc(3S)