From dba896b9a0ca7cbe4fb379017672bd44a0a77ef0 Mon Sep 17 00:00:00 2001 From: dimitri staessens Date: Fri, 17 Jun 2016 15:55:23 +0200 Subject: irmd, lib: use shm_du_map as lockfile. Added the pid of the irmd to the shm_du_map. The IRMd will check for an existing shm_du_map. If there is an existing file, it will exit if the owner IRMd is running or remove it if the owner IRMd is not running. Also simplifies calculation of the shm_du_map pointers and corrects exiting calls for the IRMd. Fixes #8. --- include/ouroboros/shm_du_map.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'include') diff --git a/include/ouroboros/shm_du_map.h b/include/ouroboros/shm_du_map.h index cc1e8869..081a6f62 100644 --- a/include/ouroboros/shm_du_map.h +++ b/include/ouroboros/shm_du_map.h @@ -37,6 +37,7 @@ #endif #include "common.h" +#include struct shm_du_buff; struct shm_du_map; @@ -45,6 +46,7 @@ struct shm_du_map * shm_du_map_create(); struct shm_du_map * shm_du_map_open(); void shm_du_map_close(struct shm_du_map * dum); void shm_du_map_destroy(struct shm_du_map * dum); +pid_t shm_du_map_owner(struct shm_du_map * dum); /* returns the index of the buffer in the DU map */ ssize_t shm_create_du_buff(struct shm_du_map * dum, -- cgit v1.2.3