00001 #ifndef SHMLIB_HH 00002 #define SHMLIB_HH 00003 00004 /***************************************************************** 00005 * To use: 00006 * 1. Mother of all tasks createShmSegment() for each segment 00007 * 00008 * 2. Each tasks calls getShmPtr() to attach 00009 * 00010 * 3. After a task has called getShmPtr() for a segment it 00011 * may call getShmAttributes() 00012 *****************************************************************/ 00013 #define SHM_KEY_BASE 0xfd000000 00014 #define MAX_SEGMENTS 10 00015 00016 struct ShmAttributes 00017 { 00018 int key; 00019 int segment; 00020 int size; 00021 int shmid; 00022 char *ptr; 00023 }; 00024 00025 int createShmSegment(int seg, int size); 00026 char *getShmPtr(int seg, int offset); 00027 ShmAttributes *getShmAttributes(int seg); 00028 00029 #endif
1.5.9