Main index | Section 3 | Options |
#include <stdio.h>
The flockfile() function acquires an exclusive lock on the specified stream. If another thread has already locked the stream, flockfile() will block until the lock is released.
The ftrylockfile() function is a non-blocking version of flockfile(); if the lock cannot be acquired immediately, ftrylockfile() returns non-zero instead of blocking.
The funlockfile() function releases the lock on a stream acquired by an earlier call to flockfile() or ftrylockfile().
These functions behave as if there is a lock count associated with each stream. Each time flockfile() is called on the stream, the count is incremented, and each time funlockfile() is called on the stream, the count is decremented. The lock is only actually released when the count reaches zero.
The ftrylockfile() function returns zero if the stream was successfully locked, non-zero otherwise.
FLOCKFILE (3) | January 10, 2003 |
Main index | Section 3 | Options |
Please direct any comments about this manual page service to Ben Bullock. Privacy policy.
“ | A UNIX saleslady, Lenore, Enjoys work, but she likes the beach more. She found a good way To combine work and play: She sells C shells by the seashore. |
” |