2 Free Software Foundation, Inc.
3 This file is part of the GNU C Library.
4 Contributed by David Mosberger-Tang <davidm@hpl.hp.com>
6 The GNU C Library is free software; you can redistribute it and/or
7 modify it under the terms of the GNU Lesser General Public
8 License as published by the Free Software Foundation; either
9 version 2.1 of the License, or (at your option) any later version.
11 The GNU C Library is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 Lesser General Public License for more details.
16 You should have received a copy of the GNU Lesser General Public
17 License along with the GNU C Library; if not, write to the Free
18 Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
22 # error "Never include <bits/sem.h> directly; use <sys/sem.h> instead."
25 #include <sys/types.h>
27 /* Flags for `semop'. */
28 #define SEM_UNDO 0x1000 /* undo the operation on exit */
30 /* Commands for `semctl'. */
31 #define GETPID 11 /* get sempid */
32 #define GETVAL 12 /* get semval */
33 #define GETALL 13 /* get all semval's */
34 #define GETNCNT 14 /* get semncnt */
35 #define GETZCNT 15 /* get semzcnt */
36 #define SETVAL 16 /* set semval */
37 #define SETALL 17 /* set all semval's */
40 /* Data structure describing a set of semaphores. */
43 struct ipc_perm sem_perm
; /* operation permission struct */
44 __time_t sem_otime
; /* last semop() time */
45 __time_t sem_ctime
; /* last time changed by semctl() */
46 unsigned long int sem_nsems
; /* number of semaphores in set */
47 unsigned long int __unused1
;
48 unsigned long int __unused2
;
51 /* The user should define a union like the following to use it for arguments
56 int val; <= value for SETVAL
57 struct semid_ds *buf; <= buffer for IPC_STAT & IPC_SET
58 unsigned short int *array; <= array for GETALL & SETALL
59 struct seminfo *__buf; <= buffer for IPC_INFO
62 Previous versions of this file used to define this union but this is
63 incorrect. One can test the macro _SEM_SEMUN_UNDEFINED to see whether
64 one must define the union or not. */
65 #define _SEM_SEMUN_UNDEFINED 1
87 #endif /* __USE_MISC */