📄 key.h
字号:
/******************************************************************* File:key.h* Description:Hearder of an test program for IPC using semaphore* Author:Luke Huang* Date:Jun. 14th 2002******************************************************************/#ifndef _SEMAPHORE_TEST_LUKE_H_#define _SEMAPHORE_TEST_LUKE_H_#include <stdio.h>#include <stdlib.h>#include <unistd.h>#include <errno.h>#include <signal.h>#include <sys/types.h>#include <sys/stat.h>#include <sys/ipc.h>#include <sys/sem.h>/* for ftok() function,client & server use thess definition to get the same IPC structures */#define KEY_PATH "~/tmp/semaphore"#define KEY_ID1 1#define KEY_ID2 2/* access permission of the semaphore owner read/write,group and other read. in LINUX there are not SEM_R,SEM_A which are defined in SVR4*/#define SEM_MODE (S_IRUSR|S_IWUSR|S_IRGRP|S_IROTH)union semun{ int val; struct semid_ds * buf; ushort * array;};#endif /* _SEMAPHORE_TEST_LUKE_H_ *//* END OF FILE:key.h */
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -