Back to index

glibc  2.9
shm.h
Go to the documentation of this file.
00001 /* Copyright (C) 1995-1999, 2000, 2002 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_SHM_H
00020 #define _SYS_SHM_H   1
00021 
00022 #include <features.h>
00023 
00024 #define __need_size_t
00025 #include <stddef.h>
00026 
00027 /* Get common definition of System V style IPC.  */
00028 #include <sys/ipc.h>
00029 
00030 /* Get system dependent definition of `struct shmid_ds' and more.  */
00031 #include <bits/shm.h>
00032 
00033 /* Define types required by the standard.  */
00034 #define __need_time_t
00035 #include <time.h>
00036 
00037 #ifdef __USE_XOPEN
00038 # ifndef __pid_t_defined
00039 typedef __pid_t pid_t;
00040 #  define __pid_t_defined
00041 # endif
00042 #endif /* X/Open */
00043 
00044 
00045 __BEGIN_DECLS
00046 
00047 /* The following System V style IPC functions implement a shared memory
00048    facility.  The definition is found in XPG4.2.  */
00049 
00050 /* Shared memory control operation.  */
00051 extern int shmctl (int __shmid, int __cmd, struct shmid_ds *__buf) __THROW;
00052 
00053 /* Get shared memory segment.  */
00054 extern int shmget (key_t __key, size_t __size, int __shmflg) __THROW;
00055 
00056 /* Attach shared memory segment.  */
00057 extern void *shmat (int __shmid, __const void *__shmaddr, int __shmflg)
00058      __THROW;
00059 
00060 /* Detach shared memory segment.  */
00061 extern int shmdt (__const void *__shmaddr) __THROW;
00062 
00063 __END_DECLS
00064 
00065 #endif /* sys/shm.h */