DOC HOME SITE MAP MAN PAGES GNU INFO SEARCH PRINT BOOK
 

flock(S)


flock: flockfile, ftrylockfile, funlockfile -- standard I/O synchronization functions

Syntax

cc . . . -lc

#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

See also

flockfile(S), ftrylockfile(S), funlockfile(S),
© 2003 Caldera International, Inc. All rights reserved.
SCO OpenServer Release 5.0.7 -- 11 February 2003