blob: 92a2ccff80c5cf287e2447c75dc505b24bcd62d8 [file] [log] [blame]
Linus Torvalds1da177e2005-04-16 15:20:36 -07001#ifndef _LINUX_IPC_H
2#define _LINUX_IPC_H
3
Robert P. J. Day0a3021f42007-07-15 23:39:57 -07004#include <linux/spinlock.h>
Eric W. Biederman1efdb692012-02-07 16:54:11 -08005#include <linux/uidgid.h>
Guillaume Knispel0cfb6ae2017-09-08 16:17:55 -07006#include <linux/rhashtable.h>
David Howells607ca462012-10-13 10:46:48 +01007#include <uapi/linux/ipc.h>
Elena Reshetova9405c032017-09-08 16:17:45 -07008#include <linux/refcount.h>
Cedric Le Goaterb119f132006-10-04 02:15:19 -07009
Linus Torvalds1da177e2005-04-16 15:20:36 -070010#define IPCMNI 32768 /* <= MAX_INT limit for ipc arrays (including sysctl changes) */
11
12/* used by in-kernel data structures */
Davidlohr Bueso60f3e002017-05-08 15:57:06 -070013struct kern_ipc_perm {
Linus Torvalds1da177e2005-04-16 15:20:36 -070014 spinlock_t lock;
Rafael Aquini72a8ff22014-01-27 17:07:02 -080015 bool deleted;
Nadia Derbey7ca7e562007-10-18 23:40:48 -070016 int id;
Linus Torvalds1da177e2005-04-16 15:20:36 -070017 key_t key;
Eric W. Biederman1efdb692012-02-07 16:54:11 -080018 kuid_t uid;
19 kgid_t gid;
20 kuid_t cuid;
21 kgid_t cgid;
Davidlohr Bueso60f3e002017-05-08 15:57:06 -070022 umode_t mode;
Linus Torvalds1da177e2005-04-16 15:20:36 -070023 unsigned long seq;
24 void *security;
Manfred Sprauldba4cdd2017-07-12 14:34:41 -070025
Guillaume Knispel0cfb6ae2017-09-08 16:17:55 -070026 struct rhash_head khtnode;
27
Manfred Sprauldba4cdd2017-07-12 14:34:41 -070028 struct rcu_head rcu;
Elena Reshetova9405c032017-09-08 16:17:45 -070029 refcount_t refcount;
Kees Cook3859a272016-10-28 01:22:25 -070030} ____cacheline_aligned_in_smp __randomize_layout;
Linus Torvalds1da177e2005-04-16 15:20:36 -070031
Linus Torvalds1da177e2005-04-16 15:20:36 -070032#endif /* _LINUX_IPC_H */