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