|
ginnOS
The reference: libc, the libraries and the kernel
|
advisory whole-file locks (flock). More...
Go to the source code of this file.
Macros | |
| #define | LOCK_SH 1 |
| #define | LOCK_EX 2 |
| #define | LOCK_NB 4 |
| #define | LOCK_UN 8 |
Functions | |
| int32_t | flock_apply (file_t *file, uint32_t operation) |
| take, change or release a description's lock. | |
| void | flock_release (file_t *file) |
| release the lock a description holds (its last descriptor closed). | |
advisory whole-file locks (flock).
an open-file description holds a lock on its file: shared (many may hold one) or exclusive (one only). the locks are advisory: they stop other flock calls, not reads or writes. a description's lock goes when it is unlocked, or when the description's last descriptor closes.
| #define LOCK_SH 1 |
| #define LOCK_EX 2 |
| #define LOCK_NB 4 |
| #define LOCK_UN 8 |
take, change or release a description's lock.
| file | a filesystem file. |
| operation | LOCK_SH or LOCK_EX (with LOCK_NB), or LOCK_UN. |
| void flock_release | ( | file_t * | file | ) |
release the lock a description holds (its last descriptor closed).