📄 pub_filelock.c
字号:
/* *文件锁定的一些函数 *zyq - shilyu - cff 040908 *functionnum 002 */ #include "./../inc/pub.h"#if !defined( DEBUG )#define DEBUG#endif/* 001 *文件上锁(System V咨询锁) */int lm_lock( int fd ) { lseek( fd, 0L, SEEK_SET ) ; if( lockf( fd, F_LOCK, 0L ) == -1 ) { perror( "can not F_LOCK" ) ; return 1 ; } return 0 ;}/* 002 *文件解锁(System V咨询锁) */int lm_unlock( int fd ) { lseek( fd, 0L, 0 ) ; if( lockf( fd, F_ULOCK, 0L ) == -1 ) { perror( "can not F_ULOCK" ) ; return 1 ; } return 0 ;}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -