key.h

来自「linux下面的文件锁和信号量的程序」· C头文件 代码 · 共 43 行

H
43
字号
/*******************************************************************	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 + =
减小字号Ctrl + -
显示快捷键?