📄 lockf.c
字号:
#include <sys/types.h>/* * Include <sys/file.h>, not <fcntl.h>, the flock(2) * #defines were found there on historical systems. */#include <sys/file.h>#include <errno.h>#include <unistd.h>#include <compat.h>/* * Use lockf(2) locking to fake flock(2) locking. */intflock(fd, operation) int fd, operation;{ if (!lockf(fd, operation & LOCK_UN ? F_ULOCK : operation & LOCK_NB ? F_TLOCK : F_LOCK, 0)) return (0); if (errno == EACCES || errno == EAGAIN) errno = EWOULDBLOCK; return (-1);}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -