From 9a3aa38ba14d45516a7dc97a4906b2fb86cd0424 Mon Sep 17 00:00:00 2001 From: sbosse Date: Mon, 16 Mar 2026 11:11:45 +0100 Subject: [PATCH] Mon 16 Mar 11:09:06 CET 2026 --- src/shm.h | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 src/shm.h 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