Tue Jul 9 09:37:55 1996 Roland McGrath <roland@delasyd.gnu.ai.mit.edu>
[glibc.git] / sysdeps / unix / sysv / linux / sys / ipc_buf.h
blob767fc9ade9d3e5fb897bb6c1c47229536cc14654
1 /* Copyright (C) 1995 Free Software Foundation, Inc.
2 This file is part of the GNU C Library.
3 Contributed by Ulrich Drepper <drepper@gnu.ai.mit.edu>, August 1995.
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.
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.
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
17 not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
18 Boston, MA 02111-1307, USA. */
20 #ifndef _SYS_IPC_BUF_H
21 #define _SYS_IPC_BUF_H
23 #include <features.h>
24 #include <sys/types.h>
26 /* Mode bits for `msgget', `semget', and `shmget'. */
27 #define IPC_CREAT 01000 /* create key if key does not exist */
28 #define IPC_EXCL 02000 /* fail if key exists */
29 #define IPC_NOWAIT 04000 /* return error on wait */
31 /* Control commands for `msgctl', `semctl', and `shmctl'. */
32 #define IPC_RMID 0 /* remove identifier */
33 #define IPC_SET 1 /* set `ipc_perm' options */
34 #define IPC_STAT 2 /* get `ipc_perm' options */
35 #define IPC_INFO 3 /* see ipcs */
38 __BEGIN_DECLS
40 /* Special key values. */
41 #define IPC_PRIVATE ((key_t) 0) /* private key */
44 /* Data structure used to pass permission information to IPC operations. */
45 struct ipc_perm
47 key_t __key; /* key */
48 __uid_t uid; /* owner's user ID */
49 __gid_t gid; /* owner's group ID */
50 __uid_t cuid; /* creator's user ID */
51 __gid_t cgid; /* creator's group ID */
52 __mode_t mode; /* read/write permission */
53 unsigned short int __seq; /* sequence number */
57 /* Kludge to work around Linux' restriction of only up to five
58 arguments to a system call. */
59 struct ipc_kludge
61 void *msgp;
62 long msgtyp;
65 /* The actual system call: all functions are multiplexed by this. */
66 extern int __ipc __P ((int __call, int __first, int __second, int __third,
67 void *__ptr));
69 /* The codes for the functions to use the multiplexer `__ipc'. */
70 #define IPCOP_semop 1
71 #define IPCOP_semget 2
72 #define IPCOP_semctl 3
73 #define IPCOP_msgsnd 11
74 #define IPCOP_msgrcv 12
75 #define IPCOP_msgget 13
76 #define IPCOP_msgctl 14
77 #define IPCOP_shmat 21
78 #define IPCOP_shmdt 22
79 #define IPCOP_shmget 23
80 #define IPCOP_shmctl 24
82 __END_DECLS
84 #endif /* sys/ipc_buf.h */