diff options
| author | John Baldwin <jhb@FreeBSD.org> | 2009-06-24 21:10:52 +0000 |
|---|---|---|
| committer | John Baldwin <jhb@FreeBSD.org> | 2009-06-24 21:10:52 +0000 |
| commit | b648d4806b3ec5be814332e96d565cb0be71d50d (patch) | |
| tree | 9bcf2215ae277f261cc7bf33f2dde8db38fe41c4 /sys/kern/sysv_ipc.c | |
| parent | 8c5d766cd7b73b769072ed69c647513f54bb5387 (diff) | |
Notes
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 0cbb4bbe8c42..d33fdb099203 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 |
