diff options
author | Andrea Biscuola <git-no-reply@zabbix.com> | 2017-03-08 14:23:04 +0300 |
---|---|---|
committer | Andrea Biscuola <git-no-reply@zabbix.com> | 2017-03-08 14:23:04 +0300 |
commit | 942b2fd2a559460ec86680a3efd50837b2a8b537 (patch) | |
tree | b77237f7bb18d0124226c871ee76ef1b61b8d9e4 /include/ipc.h | |
parent | 5d63aac4cc43a22ba34611fcea6c174c461abe69 (diff) |
...G...... [ZBXNEXT-3687] Don't use keys for allocating shared memory anymore
The zbx_ftok() function was completely removed from the source code. The
function was used only inside the agent code and the zbxnix library.
The zbx_shmget() function was reworked for not using a key but for using
only an id for checking if a shared memory segment exist. By the logic of
the allocating code, we can skip the check with the key, because we always
check for errors when the first instances of the shared memory segments
are created. The logic behind the shared memory management in the
agent didn't changed.
Diffstat (limited to 'include/ipc.h')
-rw-r--r-- | include/ipc.h | 12 |
1 files changed, 2 insertions, 10 deletions
diff --git a/include/ipc.h b/include/ipc.h index eb1d626da20..e05402588f9 100644 --- a/include/ipc.h +++ b/include/ipc.h @@ -28,12 +28,7 @@ #define ZBX_NONEXISTENT_SHMID (-1) -#define ZBX_IPC_COLLECTOR_ID 'l' -#define ZBX_IPC_COLLECTOR_DISKSTAT 'm' -#define ZBX_IPC_COLLECTOR_PROC_ID 'p' - -key_t zbx_ftok(char *path, int id); -int zbx_shmget(key_t key, size_t size); +int zbx_shmget(int shmid, size_t size); /* data copying callback function prototype */ typedef void (*zbx_shm_copy_func_t)(void *dst, size_t size_dst, const void *src); @@ -44,9 +39,6 @@ typedef struct /* shared memory segment identifier */ int shmid; - /* project id used to generate shared memory key */ - int proj_id; - /* allocated size */ size_t size; @@ -68,7 +60,7 @@ typedef struct } zbx_dshm_ref_t; -int zbx_dshm_create(zbx_dshm_t *shm, int proj_id, size_t shm_size, ZBX_MUTEX_NAME mutex, +int zbx_dshm_create(zbx_dshm_t *shm, size_t shm_size, ZBX_MUTEX_NAME mutex, zbx_shm_copy_func_t copy_func, char **errmsg); int zbx_dshm_destroy(zbx_dshm_t *shm, char **errmsg); |