The manual
ginnOS
The reference: libc, the libraries and the kernel
Loading...
Searching...
No Matches
flock.c File Reference

Macros

#define FLOCK_MAX   128

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).

Macro Definition Documentation

◆ FLOCK_MAX

#define FLOCK_MAX   128

Function Documentation

◆ flock_apply()

int32_t flock_apply ( file_t * file,
uint32_t operation )

take, change or release a description's lock.

Parameters
filea filesystem file.
operationLOCK_SH or LOCK_EX (with LOCK_NB), or LOCK_UN.
Returns
0, or -EWOULDBLOCK (LOCK_NB and another holds a conflicting lock), -ERESTARTSYS (a signal while waiting), -ENOLCK (the lock table is full), -EINVAL.

◆ flock_release()

void flock_release ( file_t * file)

release the lock a description holds (its last descriptor closed).