diff options
author | Peter Elliott <pelliott@ualberta.ca> | 2021-07-18 23:29:56 -0600 |
---|---|---|
committer | Ali Mohammad Pur <Ali.mpfard@gmail.com> | 2021-07-20 17:44:30 +0430 |
commit | 3fa28166428c41ca4a608d7c5c7090c69e55353e (patch) | |
tree | 7a89b0f55d05f5351b5dfa569e28e0d31f8e7403 /Userland/Libraries/LibC/fcntl.h | |
parent | fbc56461da66f7dbb4eb8f8c0ec03a190127a060 (diff) | |
download | serenity-3fa28166428c41ca4a608d7c5c7090c69e55353e.zip |
Kernel+LibC: Implement fcntl(2) advisory locks
Advisory locks don't actually prevent other processes from writing to
the file, but they do prevent other processes looking to acquire and
advisory lock on the file.
This implementation currently only adds non-blocking locks, which are
all I need for now.
Diffstat (limited to 'Userland/Libraries/LibC/fcntl.h')
-rw-r--r-- | Userland/Libraries/LibC/fcntl.h | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/Userland/Libraries/LibC/fcntl.h b/Userland/Libraries/LibC/fcntl.h index 7e61ec3324..463e3ba060 100644 --- a/Userland/Libraries/LibC/fcntl.h +++ b/Userland/Libraries/LibC/fcntl.h @@ -18,6 +18,9 @@ __BEGIN_DECLS #define F_GETFL 3 #define F_SETFL 4 #define F_ISTTY 5 +#define F_GETLK 6 +#define F_SETLK 7 +#define F_SETLKW 8 #define FD_CLOEXEC 1 @@ -48,12 +51,9 @@ int create_inode_watcher(unsigned flags); int inode_watcher_add_watch(int fd, const char* path, size_t path_length, unsigned event_mask); int inode_watcher_remove_watch(int fd, int wd); -#define F_RDLCK 0 -#define F_WRLCK 1 -#define F_UNLCK 2 -#define F_GETLK 5 -#define F_SETLK 6 -#define F_SETLKW 7 +#define F_RDLCK ((short)0) +#define F_WRLCK ((short)1) +#define F_UNLCK ((short)2) struct flock { short l_type; |