diff --git a/src/shm.h b/src/shm.h new file mode 100644 index 0000000..332c5f1 --- /dev/null +++ b/src/shm.h @@ -0,0 +1,30 @@ +#ifndef _SHM_H +#define _SHM_H +// SHM support +typedef enum { + SMS_EMPTY=0, + SMS_ROOT, + SMS_C, + SMS_R, + SMS_DS, + SMS_DS_DATA, + SMS_FS, + SMS_FS_DATA, + SMS_M, + SMS_M_DATA, + SMS_SIG +} shm_section_t; + +typedef struct { + int type; // shm_section_t + int addr; + int size; +} shm_header_entry_t; + +#define SHM_MAX_SECTIONS 256 + +int allocate_shm(char *key, int bufsize, void **buf); +int open_shm(char *key, int *bufsize, void **buf); +void close_shm(int fd); +void *allocate_section(void *buf,shm_section_t type,int size); +#endif