]> git.ipfire.org Git - thirdparty/glibc.git/blob - sysdeps/unix/sysv/linux/powerpc/bits/sem.h
783135dc25ccef6c7ee4ee3f1f1be52c3d3fecfb
[thirdparty/glibc.git] / sysdeps / unix / sysv / linux / powerpc / bits / sem.h
1 /* Copyright (C) 1995-2014 Free Software Foundation, Inc.
2 This file is part of the GNU C Library.
3
4 The GNU C Library is free software; you can redistribute it and/or
5 modify it under the terms of the GNU Lesser General Public
6 License as published by the Free Software Foundation; either
7 version 2.1 of the License, or (at your option) any later version.
8
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 Lesser General Public License for more details.
13
14 You should have received a copy of the GNU Lesser General Public
15 License along with the GNU C Library; if not, see
16 <http://www.gnu.org/licenses/>. */
17
18 #ifndef _SYS_SEM_H
19 # error "Never include <bits/sem.h> directly; use <sys/sem.h> instead."
20 #endif
21
22 #include <sys/types.h>
23
24 /* Flags for `semop'. */
25 #define SEM_UNDO 0x1000 /* undo the operation on exit */
26
27 /* Commands for `semctl'. */
28 #define GETPID 11 /* get sempid */
29 #define GETVAL 12 /* get semval */
30 #define GETALL 13 /* get all semval's */
31 #define GETNCNT 14 /* get semncnt */
32 #define GETZCNT 15 /* get semzcnt */
33 #define SETVAL 16 /* set semval */
34 #define SETALL 17 /* set all semval's */
35
36
37 /* Data structure describing a set of semaphores. */
38 struct semid_ds
39 {
40 struct ipc_perm sem_perm; /* operation permission struct */
41 #if __WORDSIZE == 32
42 unsigned int __glibc_reserved1;
43 #endif
44 __time_t sem_otime; /* last semop() time */
45 #if __WORDSIZE == 32
46 unsigned int __glibc_reserved2;
47 #endif
48 __time_t sem_ctime; /* last time changed by semctl() */
49 unsigned long int sem_nsems; /* number of semaphores in set */
50 unsigned long __glibc_reserved3;
51 unsigned long __glibc_reserved4;
52 };
53
54 /* The user should define a union like the following to use it for arguments
55 for `semctl'.
56
57 union semun
58 {
59 int val; <= value for SETVAL
60 struct semid_ds *buf; <= buffer for IPC_STAT & IPC_SET
61 unsigned short int *array; <= array for GETALL & SETALL
62 struct seminfo *__buf; <= buffer for IPC_INFO
63 };
64
65 Previous versions of this file used to define this union but this is
66 incorrect. One can test the macro _SEM_SEMUN_UNDEFINED to see whether
67 one must define the union or not. */
68 #define _SEM_SEMUN_UNDEFINED 1
69
70 #ifdef __USE_MISC
71
72 /* ipcs ctl cmds */
73 # define SEM_STAT 18
74 # define SEM_INFO 19
75
76 struct seminfo
77 {
78 int semmap;
79 int semmni;
80 int semmns;
81 int semmnu;
82 int semmsl;
83 int semopm;
84 int semume;
85 int semusz;
86 int semvmx;
87 int semaem;
88 };
89
90 #endif /* __USE_MISC */