24 #ifndef __UTILS_IPC_SHM_REGISTRY_H_ 25 #define __UTILS_IPC_SHM_REGISTRY_H_ 27 #include <semaphore.h> 30 #define MAGIC_TOKEN_SIZE 16 31 #define MAXNUM_SHM_SEGMS 64 32 #define DEFAULT_SHM_NAME "/fawkes-shmem-registry" 33 #define USER_SHM_NAME "/fawkes-shmem-registry-%s" 46 char magic_token[MAGIC_TOKEN_SIZE];
53 std::list<SharedMemoryRegistry::SharedMemID>
get_snapshot()
const;
55 std::list<SharedMemoryRegistry::SharedMemID>
58 void add_segment(
int shmid,
const char *magic_token);
61 static void cleanup(
const char *name = 0);
void add_segment(int shmid, const char *magic_token)
Register a segment.
std::list< SharedMemoryRegistry::SharedMemID > get_snapshot() const
Get a snapshot of currently registered segments.
~SharedMemoryRegistry()
Destructor.
Fawkes library namespace.
Shared memory identifier.
SharedMemoryRegistry(const char *name=0)
Constructor.
std::list< SharedMemoryRegistry::SharedMemID > find_segments(const char *magic_token) const
Find segments with particular magic token.
void remove_segment(int shmid)
Remove segment.
int shmid
SysV IPC shared memory ID.
static void cleanup(const char *name=0)
Cleanup existing shared memory segments.