flock(3S)
flock: flockfile, ftrylockfile, funlockfile --
standard I/O synchronization functions
Synopsis
#include <stdio.h>
void flockfile(FILE
file);
void funlockfile(FILE
file);
int ftrylockfile(FILE
file);
Description
These functions provide for explicit application-level
locking of standard I/O stream objects.
They are used by a thread to delineate a sequence of I/O statements
that are to be executed as a unit.
- flockfile
-
grants thread ownership of a file, suspends thread until
ownership is granted
- ftrylockfile
-
similar to flockfile, except that it returns
a value for success or failure
- funlockfile
-
relinquishes file ownership granted to a thread by a previous successful
call to flockfile or ftrylockfile
References
flockfile(3S),
ftrylockfile(3S),
funlockfile(3S),
Intro(3S)
30 January 1998
© 1998 The Santa Cruz Operation, Inc. All rights reserved.