• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  *
3  *   Copyright (c) International Business Machines  Corp., 2001
4  *
5  *   This program is free software;  you can redistribute it and/or modify
6  *   it under the terms of the GNU General Public License as published by
7  *   the Free Software Foundation; either version 2 of the License, or
8  *   (at your option) any later version.
9  *
10  *   This program is distributed in the hope that it will be useful,
11  *   but WITHOUT ANY WARRANTY;  without even the implied warranty of
12  *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See
13  *   the GNU General Public License for more details.
14  *
15  *   You should have received a copy of the GNU General Public License
16  *   along with this program;  if not, write to the Free Software
17  *   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
18  */
19 
20 /*
21  * ipcsem.h - common definitions for the IPC semaphore tests
22  */
23 
24 #ifndef __IPCSEM_H
25 #define __IPCSEM_H
26 
27 #include <errno.h>
28 #include <sys/ipc.h>
29 #include <sys/sem.h>
30 
31 #include "test.h"
32 #include "lapi/semun.h"
33 
34 void cleanup(void);
35 void setup(void);
36 
37 #define SEM_RD	0400
38 #define SEM_ALT	0200
39 #define SEM_RA	SEM_RD | SEM_ALT
40 
41 #define PSEMS	10		/* a reasonable value for the number of */
42 				/* "primitive semaphores" per ID 	*/
43 
44 #ifdef LIBIPC
45 key_t semkey;			/* an IPC key generated by ftok() */
46 #else
47 extern key_t semkey;	 	 /* an IPC key generated by ftok() */
48 #endif
49 
50 void rm_sema(int sem_id);
51 
52 int getipckey();
53 int getuserid(char *);
54 
55 #endif /* ipcsem.h */
56