sparc64: add basic support
[uclibc-ng.git] / libc / sysdeps / linux / sparc64 / bits / sem.h
blobacc21742d7ad4465755a77d9df9a92b201b10e81
1 /* Copyright (C) 1995, 1996, 1997, 1998, 2000 Free Software Foundation, Inc.
3 The GNU C Library is free software; you can redistribute it and/or
4 modify it under the terms of the GNU Lesser General Public
5 License as published by the Free Software Foundation; either
6 version 2.1 of the License, or (at your option) any later version.
8 The GNU C Library is distributed in the hope that it will be useful,
9 but WITHOUT ANY WARRANTY; without even the implied warranty of
10 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11 Lesser General Public License for more details.
13 You should have received a copy of the GNU Lesser General Public
14 License along with the GNU C Library; if not, see
15 <http://www.gnu.org/licenses/>. */
17 #ifndef _SYS_SEM_H
18 # error "Never include <bits/sem.h> directly; use <sys/sem.h> instead."
19 #endif
21 #include <sys/types.h>
23 /* Flags for `semop'. */
24 #define SEM_UNDO 0x1000 /* undo the operation on exit */
26 /* Commands for `semctl'. */
27 #define GETPID 11 /* get sempid */
28 #define GETVAL 12 /* get semval */
29 #define GETALL 13 /* get all semval's */
30 #define GETNCNT 14 /* get semncnt */
31 #define GETZCNT 15 /* get semzcnt */
32 #define SETVAL 16 /* set semval */
33 #define SETALL 17 /* set all semval's */
36 /* Data structure describing a set of semaphores. */
37 struct semid_ds
39 struct ipc_perm sem_perm; /* operation permission struct */
40 __time_t sem_otime; /* last semop() time */
41 __time_t sem_ctime; /* last time changed by semctl() */
42 unsigned long int sem_nsems; /* number of semaphores in set */
43 unsigned long int __unused1;
44 unsigned long int __unused2;
47 /* The user should define a union like the following to use it for arguments
48 for `semctl'.
50 union semun
52 int val; <= value for SETVAL
53 struct semid_ds *buf; <= buffer for IPC_STAT & IPC_SET
54 unsigned short int *array; <= array for GETALL & SETALL
55 struct seminfo *__buf; <= buffer for IPC_INFO
58 Previous versions of this file used to define this union but this is
59 incorrect. One can test the macro _SEM_SEMUN_UNDEFINED to see whether
60 one must define the union or not. */
61 #define _SEM_SEMUN_UNDEFINED 1
63 #ifdef __USE_MISC
65 /* ipcs ctl cmds */
66 # define SEM_STAT 18
67 # define SEM_INFO 19
69 struct seminfo
71 int semmap;
72 int semmni;
73 int semmns;
74 int semmnu;
75 int semmsl;
76 int semopm;
77 int semume;
78 int semusz;
79 int semvmx;
80 int semaem;
83 #endif /* __USE_MISC */