Back to index

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