1 /* Copyright (C) 1995, 1996, 1997 Free Software Foundation, Inc.
2 This file is part of the GNU C Library.
4 The GNU C Library is free software; you can redistribute it and/or
5 modify it under the terms of the GNU Library General Public License as
6 published by the Free Software Foundation; either version 2 of the
7 License, or (at your option) any later version.
9 The GNU C Library is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 Library General Public License for more details.
14 You should have received a copy of the GNU Library General Public
15 License along with the GNU C Library; see the file COPYING.LIB. If not,
16 write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
17 Boston, MA 02111-1307, USA. */
20 # error "Never include <bits/sem.h> directly; use <sys/sem.h> instead."
23 #include <sys/types.h>
25 /* Flags for `semop'. */
26 #define SEM_UNDO 0x1000 /* undo the operation on exit */
28 /* Commands for `semctl'. */
29 #define GETPID 11 /* get sempid */
30 #define GETVAL 12 /* get semval */
31 #define GETALL 13 /* get all semval's */
32 #define GETNCNT 14 /* get semncnt */
33 #define GETZCNT 15 /* get semzcnt */
34 #define SETVAL 16 /* set semval */
35 #define SETALL 17 /* set all semval's */
38 /* Data structure describing a set of semaphores. */
41 struct ipc_perm sem_perm
; /* operation permission struct */
42 __time_t sem_otime
; /* last semop() time */
43 __time_t sem_ctime
; /* last time changed by semctl() */
44 unsigned short int sem_nsems
; /* number of semaphores in set */
47 /* Union used for argument for `semctl'. */
50 int val
; /* value for SETVAL */
51 struct semid_ds
*buf
; /* buffer for IPC_STAT & IPC_SET */
52 unsigned short int *array
; /* array for GETALL & SETALL */
53 struct seminfo
*__buf
; /* buffer for IPC_INFO */