00001
00002 #ifndef _SHAREDMEM_H
00003 #define _SHAREDMEM_H
00004
00005 #include "rcs_defs.hh"
00006 #ifdef WIN32
00007
00008 #if defined(WIN32) && !defined(USE_OLD_WINSOCK)
00009
00010
00011 #include <winsock2.h>
00012 #endif
00013
00014 #include <windows.h>
00015 #endif
00016
00017
00018
00019
00020
00021
00022 #ifndef WIN32
00023 #include <sys/types.h>
00024 #endif
00025
00026 #if !defined(VXWORKS) && !defined(DOS_WINDOWS)
00027 #include <sys/ipc.h>
00028 #endif
00029
00030 #ifndef UNDER_CE
00031 #include <stddef.h>
00032 #endif
00033
00034 #ifndef KEY_T_DEFINED
00035 #define KEY_T_DEFINED
00036 #if defined(VXWORKS)
00037 typedef int key_t;
00038
00039
00040 #endif
00041
00042 #if defined(WIN32)
00043 typedef long key_t;
00044 #endif
00045
00046 #endif
00047
00048 typedef struct
00049 {
00050 int id;
00051 void *addr;
00052 int create_errno;
00053 size_t size;
00054 int count;
00055 int created;
00056 int key;
00057 #ifdef WIN32
00058 HANDLE hFileMap;
00059 #endif
00060 #ifdef qnx
00061 char name[64];
00062 #endif
00063 }
00064 shm_t;
00065
00066 #ifdef __cplusplus
00067 extern "C"
00068 {
00069 #endif
00070 extern shm_t *rcs_shm_open (key_t key, size_t size, int oflag,
00071 ...);
00072 extern int rcs_shm_close (shm_t * shm);
00073 extern int rcs_shm_delete (shm_t * shm);
00074 extern int rcs_shm_nattch (shm_t * shm);
00075
00076 #ifdef VXWORKS
00077 void rcs_shm_table_print ();
00078
00079 extern int rcs_shm_table_inited;
00080 extern int task_lock_shm_stuff;
00081 extern int print_rcs_shm_warnings;
00082
00083 #endif
00084
00085 #ifdef __cplusplus
00086 }
00087 #endif
00088
00089 #if defined(qnx) && !defined(USE_POSIX_SHAREDMEM)
00090 #define USE_POSIX_SHAREDMEM 1
00091 #include <fcntl.h>
00092 #include <sys/mman.h>
00093 #endif
00094
00095
00096 #endif