Add Changelog ...
[glibc.git] / sysdeps / unix / sysv / linux / ia64 / bits / sem.h
blobaa56e155d80cf7f44f73ff67abbf37b2b91ad78f
1 /* Copyright (C) 2000
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, see
18 <http://www.gnu.org/licenses/>. */
20 #ifndef _SYS_SEM_H
21 # error "Never include <bits/sem.h> directly; use <sys/sem.h> instead."
22 #endif
24 #include <sys/types.h>
26 /* Flags for `semop'. */
27 #define SEM_UNDO 0x1000 /* undo the operation on exit */
29 /* Commands for `semctl'. */
30 #define GETPID 11 /* get sempid */
31 #define GETVAL 12 /* get semval */
32 #define GETALL 13 /* get all semval's */
33 #define GETNCNT 14 /* get semncnt */
34 #define GETZCNT 15 /* get semzcnt */
35 #define SETVAL 16 /* set semval */
36 #define SETALL 17 /* set all semval's */
39 /* Data structure describing a set of semaphores. */
40 struct semid_ds
42 struct ipc_perm sem_perm; /* operation permission struct */
43 __time_t sem_otime; /* last semop() time */
44 __time_t sem_ctime; /* last time changed by semctl() */
45 unsigned long int sem_nsems; /* number of semaphores in set */
46 unsigned long int __unused1;
47 unsigned long int __unused2;
50 /* The user should define a union like the following to use it for arguments
51 for `semctl'.
53 union semun
55 int val; <= value for SETVAL
56 struct semid_ds *buf; <= buffer for IPC_STAT & IPC_SET
57 unsigned short int *array; <= array for GETALL & SETALL
58 struct seminfo *__buf; <= buffer for IPC_INFO
61 Previous versions of this file used to define this union but this is
62 incorrect. One can test the macro _SEM_SEMUN_UNDEFINED to see whether
63 one must define the union or not. */
64 #define _SEM_SEMUN_UNDEFINED 1
66 #ifdef __USE_MISC
68 /* ipcs ctl cmds */
69 # define SEM_STAT 18
70 # define SEM_INFO 19
72 struct seminfo
74 int semmap;
75 int semmni;
76 int semmns;
77 int semmnu;
78 int semmsl;
79 int semopm;
80 int semume;
81 int semusz;
82 int semvmx;
83 int semaem;
86 #endif /* __USE_MISC */