fs_lock:Implementing file locks

Signed-off-by: chenrun1 <chenrun1@xiaomi.com>
This commit is contained in:
chenrun1
2023-10-23 15:55:00 +08:00
committed by Alan Carvalho de Assis
parent 17ede2fde4
commit 5c6bd833ed
10 changed files with 1038 additions and 2 deletions
+13
View File
@@ -289,6 +289,18 @@
# define execvpe execve
#endif
/* Commands for lockf()
* F_ULOCK - Unlock
* F_LOCK - Blocking Exclusive Lock
* F_TLOCK - Attempted Exclusive Locking
* F_TEST - Test Locked Status
*/
#define F_ULOCK 0
#define F_LOCK 1
#define F_TLOCK 2
#define F_TEST 3
/****************************************************************************
* Public Data
****************************************************************************/
@@ -337,6 +349,7 @@ ssize_t pread(int fd, FAR void *buf, size_t nbytes, off_t offset);
ssize_t pwrite(int fd, FAR const void *buf, size_t nbytes, off_t offset);
int ftruncate(int fd, off_t length);
int fchown(int fd, uid_t owner, gid_t group);
int lockf(int fd, int cmd, off_t len);
/* Check if a file descriptor corresponds to a terminal I/O file */