]> git.ipfire.org Git - thirdparty/glibc.git/blame - sysdeps/unix/sysv/linux/s390/bits/sem.h
Update copyright dates with scripts/update-copyrights.
[thirdparty/glibc.git] / sysdeps / unix / sysv / linux / s390 / bits / sem.h
CommitLineData
b168057a 1/* Copyright (C) 2001-2015 Free Software Foundation, Inc.
ffeac417
UD
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
41bdb6e2
AJ
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.
ffeac417
UD
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
41bdb6e2 12 Lesser General Public License for more details.
ffeac417 13
41bdb6e2 14 You should have received a copy of the GNU Lesser General Public
59ba27a6
PE
15 License along with the GNU C Library; if not, see
16 <http://www.gnu.org/licenses/>. */
ffeac417
UD
17
18#ifndef _SYS_SEM_H
19# error "Never include <bits/sem.h> directly; use <sys/sem.h> instead."
20#endif
21
7bf75551
UD
22#include <bits/types.h>
23#include <bits/wordsize.h>
ffeac417
UD
24
25/* Flags for `semop'. */
26#define SEM_UNDO 0x1000 /* undo the operation on exit */
27
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 */
36
37
38/* Data structure describing a set of semaphores. */
39struct semid_ds
40{
41 struct ipc_perm sem_perm; /* operation permission struct */
42 __time_t sem_otime; /* last semop() time */
7bf75551 43#if __WORDSIZE != 64
d1d9eaf4 44 unsigned long int __glibc_reserved1;
7bf75551
UD
45#endif
46 __time_t sem_ctime; /* last time changed by semctl() */
47#if __WORDSIZE != 64
d1d9eaf4 48 unsigned long int __glibc_reserved2;
7bf75551
UD
49#endif
50 unsigned long int sem_nsems; /* number of semaphores in set */
d1d9eaf4
OB
51 unsigned long int __glibc_reserved3;
52 unsigned long int __glibc_reserved4;
ffeac417
UD
53};
54
55/* The user should define a union like the following to use it for arguments
56 for `semctl'.
57
58 union semun
59 {
60 int val; <= value for SETVAL
61 struct semid_ds *buf; <= buffer for IPC_STAT & IPC_SET
62 unsigned short int *array; <= array for GETALL & SETALL
63 struct seminfo *__buf; <= buffer for IPC_INFO
64 };
65
66 Previous versions of this file used to define this union but this is
67 incorrect. One can test the macro _SEM_SEMUN_UNDEFINED to see whether
68 one must define the union or not. */
69#define _SEM_SEMUN_UNDEFINED 1
70
71#ifdef __USE_MISC
72
73/* ipcs ctl cmds */
74# define SEM_STAT 18
75# define SEM_INFO 19
76
77struct seminfo
78{
79 int semmap;
80 int semmni;
81 int semmns;
82 int semmnu;
83 int semmsl;
84 int semopm;
85 int semume;
86 int semusz;
87 int semvmx;
88 int semaem;
89};
90
91#endif /* __USE_MISC */