]> sourceware.org Git - glibc.git/blame - bits/sem.h
Update.
[glibc.git] / bits / sem.h
CommitLineData
5107cf1d 1/* Copyright (C) 1995, 1996, 1997 Free Software Foundation, Inc.
6d52618b
UD
2 This file is part of the GNU C Library.
3 Contributed by Ulrich Drepper <drepper@gnu.ai.mit.edu>, August 1995.
60478656 4
6d52618b
UD
5 The GNU C Library is free software; you can redistribute it and/or
6 modify it under the terms of the GNU Library General Public License as
7 published by the Free Software Foundation; either version 2 of the
8 License, or (at your option) any later version.
60478656 9
6d52618b
UD
10 The GNU C Library is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 Library General Public License for more details.
60478656 14
6d52618b
UD
15 You should have received a copy of the GNU Library General Public
16 License along with the GNU C Library; see the file COPYING.LIB. If not,
17 write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
18 Boston, MA 02111-1307, USA. */
60478656 19
5107cf1d
UD
20#ifndef _SYS_SEM_H
21#error "Never use <bits/sem.h> directly; include <sys/sem.h> instead."
22#endif
23
60478656
RM
24
25#include <features.h>
26#include <sys/types.h>
27
28/* Flags for `semop'. */
29#define SEM_UNDO 0x1000 /* undo the operation on exit */
30
31/* Commands for `semctl'. */
32#define GETPID 11 /* get sempid */
33#define GETVAL 12 /* get semval */
34#define GETALL 13 /* get all semval's */
35#define GETNCNT 14 /* get semncnt */
36#define GETZCNT 15 /* get semzcnt */
37#define SETVAL 16 /* set semval */
38#define SETALL 17 /* set all semval's */
39
40
41__BEGIN_DECLS
42
43/* Data structure describing a set of semaphores. */
44struct semid_ds
45{
6d52618b 46 struct ipc_perm sem_perm; /* operation permission struct */
60478656
RM
47 __time_t sem_otime; /* last semop() time */
48 __time_t sem_ctime; /* last time changed by semctl() */
49 unsigned short int sem_nsems; /* number of semaphores in set */
50};
51
0324daa0
RM
52/* Union used for argument for `semctl'. */
53union semun
54{
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 */
59 };
6d52618b 60
60478656 61__END_DECLS
This page took 0.101477 seconds and 5 git commands to generate.