Back to index

glibc  2.9
ipc.h
Go to the documentation of this file.
00001 /* Copyright (C) 2000 Free Software Foundation, Inc.
00002    This file is part of the GNU C Library.
00003        Contributed by David Mosberger-Tang <davidm@hpl.hp.com>
00004 
00005    The GNU C Library is free software; you can redistribute it and/or
00006    modify it under the terms of the GNU Lesser General Public
00007    License as published by the Free Software Foundation; either
00008    version 2.1 of the License, or (at your option) any later version.
00009 
00010    The GNU C Library is distributed in the hope that it will be useful,
00011    but WITHOUT ANY WARRANTY; without even the implied warranty of
00012    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00013    Lesser General Public License for more details.
00014 
00015    You should have received a copy of the GNU Lesser General Public
00016    License along with the GNU C Library; if not, write to the Free
00017    Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
00018    02111-1307 USA.  */
00019 
00020 #ifndef _SYS_IPC_H
00021 # error "Never use <bits/ipc.h> directly; include <sys/ipc.h> instead."
00022 #endif
00023 
00024 #include <sys/types.h>
00025 
00026 /* Mode bits for `msgget', `semget', and `shmget'.  */
00027 #define IPC_CREAT    01000         /* Create key if key does not exist. */
00028 #define IPC_EXCL     02000         /* Fail if key exists.  */
00029 #define IPC_NOWAIT   04000         /* Return error on wait.  */
00030 
00031 /* Control commands for `msgctl', `semctl', and `shmctl'.  */
00032 #define IPC_RMID     0             /* Remove identifier.  */
00033 #define IPC_SET             1             /* Set `ipc_perm' options.  */
00034 #define IPC_STAT     2             /* Get `ipc_perm' options.  */
00035 #define IPC_INFO     3             /* See ipcs.  */
00036 
00037 /* Special key values.  */
00038 #define IPC_PRIVATE  ((__key_t) 0) /* Private key.  */
00039 
00040 
00041 /* Data structure used to pass permission information to IPC operations.  */
00042 struct ipc_perm
00043   {
00044     __key_t __key;                 /* Key.  */
00045     __uid_t uid;                   /* Owner's user ID.  */
00046     __gid_t gid;                   /* Owner's group ID.  */
00047     __uid_t cuid;                  /* Creator's user ID.  */
00048     __gid_t cgid;                  /* Creator's group ID.  */
00049     __mode_t mode;                 /* Read/write permission.  */
00050     unsigned short int __seq;             /* Sequence number.  */
00051     unsigned short int __pad1;
00052     unsigned long int __unused1;
00053     unsigned long int __unused2;
00054   };