Section: User Commands (1)
Return to Main Contents
flock, funlock - Provide single user access to a file(s)
flock files ...
funlock files ...
For processes using this pair of routines, flock/funlock provide
a way of serialising access to a file. Flock tries to create a
file with a name derived from the target, and waits until it
is successful. Funlock removes this "lock" file, allowing waiting
"flock"s to continue.
files - a list of files to be locked. These are processed in order, so
there is no deadlock problem.
$ flock libcitr.a
$ ar libcitr.a xxxx.o
$ funlock libcitr.a
If a makefile using flock is interrupted, the lock file remains, and
thus must be manually released.
Write access is required to the directory where the target file is.
David Horton - CiTR
Centre for Information Technology Research, 1993
- See Also
- Known Bugs
This document was created by
using the manual pages.
Time: 23:34:46 GMT, September 27, 2019