📄 my_lock.h
字号:
#ifndef MY_LOCK_H#define MY_LOCK_H#include <sys/types.h>#include <sys/socket.h>#include <sys/time.h>#include <sys/wait.h>#include <sys/un.h>#include <sys/socketvar.h>#include <time.h>#include <sys/msg.h>#include <netinet/in.h>#include <arpa/inet.h>#include <malloc.h>#include <memory.h>#include <signal.h>#include <stdio.h>#include <stdlib.h>#include <fcntl.h>#include <errno.h>#include <signal.h>#include <string.h>#include <sys/stat.h>#include <unistd.h>int my_lock_init(char* pathname);int operFilelock(int, int, int, off_t, int, off_t);int my_lock_wait(char *);int my_lock_release();#define filelockW(fd, offset, whence, len) operFilelock(fd, F_SETLK, F_WRLCK, offset, whence, len)#define filelockU(fd, offset, whence, len) operFilelock(fd, F_SETLK, F_UNLCK, offset, whence, len)#endif
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -