DOC HOME SITE MAP MAN PAGES GNU INFO SEARCH PRINT BOOK
 

flock(S-osr5)


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-osr5), ftrylockfile(S-osr5), funlockfile(S-osr5),
© 2005 The SCO Group, Inc. All rights reserved.
SCO OpenServer Release 6.0.0 -- 02 June 2005