diff options
Diffstat (limited to 'ipc/util.h')
-rw-r--r-- | ipc/util.h | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/ipc/util.h b/ipc/util.h index 80c9f51c3f07..b21297bc11eb 100644 --- a/ipc/util.h +++ b/ipc/util.h | |||
@@ -194,4 +194,34 @@ int ipcget(struct ipc_namespace *ns, struct ipc_ids *ids, | |||
194 | const struct ipc_ops *ops, struct ipc_params *params); | 194 | const struct ipc_ops *ops, struct ipc_params *params); |
195 | void free_ipcs(struct ipc_namespace *ns, struct ipc_ids *ids, | 195 | void free_ipcs(struct ipc_namespace *ns, struct ipc_ids *ids, |
196 | void (*free)(struct ipc_namespace *, struct kern_ipc_perm *)); | 196 | void (*free)(struct ipc_namespace *, struct kern_ipc_perm *)); |
197 | |||
198 | #ifdef CONFIG_COMPAT | ||
199 | #include <linux/compat.h> | ||
200 | struct compat_ipc_perm { | ||
201 | key_t key; | ||
202 | __compat_uid_t uid; | ||
203 | __compat_gid_t gid; | ||
204 | __compat_uid_t cuid; | ||
205 | __compat_gid_t cgid; | ||
206 | compat_mode_t mode; | ||
207 | unsigned short seq; | ||
208 | }; | ||
209 | |||
210 | void to_compat_ipc_perm(struct compat_ipc_perm *, struct ipc64_perm *); | ||
211 | void to_compat_ipc64_perm(struct compat_ipc64_perm *, struct ipc64_perm *); | ||
212 | int get_compat_ipc_perm(struct ipc64_perm *, struct compat_ipc_perm __user *); | ||
213 | int get_compat_ipc64_perm(struct ipc64_perm *, | ||
214 | struct compat_ipc64_perm __user *); | ||
215 | |||
216 | static inline int compat_ipc_parse_version(int *cmd) | ||
217 | { | ||
218 | #ifdef CONFIG_ARCH_WANT_COMPAT_IPC_PARSE_VERSION | ||
219 | int version = *cmd & IPC_64; | ||
220 | *cmd &= ~IPC_64; | ||
221 | return version; | ||
222 | #else | ||
223 | return IPC_64; | ||
224 | #endif | ||
225 | } | ||
226 | #endif | ||
197 | #endif | 227 | #endif |