diff options
Diffstat (limited to 'sys/kern/sysv_ipc.c')
-rw-r--r-- | sys/kern/sysv_ipc.c | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/sys/kern/sysv_ipc.c b/sys/kern/sysv_ipc.c index 0cbb4bb..d33fdb0 100644 --- a/sys/kern/sysv_ipc.c +++ b/sys/kern/sysv_ipc.c @@ -36,6 +36,7 @@ #include <sys/cdefs.h> __FBSDID("$FreeBSD$"); +#include "opt_compat.h" #include "opt_sysvipc.h" #include <sys/param.h> @@ -147,3 +148,33 @@ ipcperm(struct thread *td, struct ipc_perm *perm, int acc_mode) else return (EACCES); } + +#if defined(COMPAT_FREEBSD4) || defined(COMPAT_FREEBSD5) || \ + defined(COMPAT_FREEBSD6) || defined(COMPAT_FREEBSD7) +void +ipcperm_old2new(struct ipc_perm_old *old, struct ipc_perm *new) +{ + + new->cuid = old->cuid; + new->cgid = old->cgid; + new->uid = old->uid; + new->gid = old->gid; + new->mode = old->mode; + new->seq = old->seq; + new->key = old->key; +} + +void +ipcperm_new2old(struct ipc_perm *new, struct ipc_perm_old *old) +{ + + /* XXX: How to handle ID's > USHORT_MAX? */ + old->cuid = new->cuid; + old->cgid = new->cgid; + old->uid = new->uid; + old->gid = new->gid; + old->mode = new->mode; + old->seq = new->seq; + old->key = new->key; +} +#endif |