1187c5764SAxel Dörfler /* 2*173f54f1SMatt Madia * Copyright 2008-2012 Haiku, Inc. All Rights Reserved. 3187c5764SAxel Dörfler * Distributed under the terms of the MIT License. 4187c5764SAxel Dörfler */ 5187c5764SAxel Dörfler #ifndef _SYS_IPC_H 6187c5764SAxel Dörfler #define _SYS_IPC_H 7187c5764SAxel Dörfler 8187c5764SAxel Dörfler 947ca7595SAxel Dörfler #include <sys/cdefs.h> 10187c5764SAxel Dörfler #include <sys/types.h> 11187c5764SAxel Dörfler 12187c5764SAxel Dörfler 13187c5764SAxel Dörfler /* Mode bits for msgget(), semget(), and shmget() */ 14187c5764SAxel Dörfler #define IPC_CREAT 01000 /* create key */ 15187c5764SAxel Dörfler #define IPC_EXCL 02000 /* fail if key exists */ 16187c5764SAxel Dörfler #define IPC_NOWAIT 04000 /* do not block */ 17187c5764SAxel Dörfler 18187c5764SAxel Dörfler /* Control commands for msgctl(), semctl(), and shmctl() */ 19187c5764SAxel Dörfler #define IPC_RMID 0 /* remove identifier */ 2047ca7595SAxel Dörfler #define IPC_SET 1 /* set options */ 2147ca7595SAxel Dörfler #define IPC_STAT 2 /* get options */ 22187c5764SAxel Dörfler 23187c5764SAxel Dörfler /* Private key */ 2447ca7595SAxel Dörfler #define IPC_PRIVATE (key_t)0 25187c5764SAxel Dörfler 26187c5764SAxel Dörfler 27187c5764SAxel Dörfler struct ipc_perm { 2847ca7595SAxel Dörfler key_t key; /* IPC identifier */ 29187c5764SAxel Dörfler uid_t uid; /* owner's user ID */ 30187c5764SAxel Dörfler gid_t gid; /* owner's group ID */ 31187c5764SAxel Dörfler uid_t cuid; /* creator's user ID */ 32187c5764SAxel Dörfler gid_t cgid; /* creator's group ID */ 33187c5764SAxel Dörfler mode_t mode; /* Read/write permission */ 34187c5764SAxel Dörfler }; 35187c5764SAxel Dörfler 36187c5764SAxel Dörfler 3747ca7595SAxel Dörfler __BEGIN_DECLS 38187c5764SAxel Dörfler 39187c5764SAxel Dörfler key_t ftok(const char *path, int id); 40187c5764SAxel Dörfler 4147ca7595SAxel Dörfler __END_DECLS 42187c5764SAxel Dörfler 43187c5764SAxel Dörfler #endif /* _SYS_IPC_H */ 44