mirror of
https://github.com/RGBCube/serenity
synced 2025-07-28 07:17:34 +00:00
LibC: Implement flock(2) using fcntl's F_SETLK
While flock is not a posix interface, it exists on linux and all BSDs as far as I am aware.
This commit is contained in:
parent
3fa2816642
commit
2ce8cca7b5
3 changed files with 40 additions and 0 deletions
|
@ -5,3 +5,16 @@
|
|||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
|
||||
__BEGIN_DECLS
|
||||
|
||||
#define LOCK_SH 0
|
||||
#define LOCK_EX 1
|
||||
#define LOCK_UN 2
|
||||
#define LOCK_NB (1 << 2)
|
||||
|
||||
int flock(int fd, int operation);
|
||||
|
||||
__END_DECLS
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue