diff options
author | ps <ps@FreeBSD.org> | 2006-03-30 07:42:32 +0000 |
---|---|---|
committer | ps <ps@FreeBSD.org> | 2006-03-30 07:42:32 +0000 |
commit | 82f0faf08691e602d759d4e2455cfcfef9fe2cbe (patch) | |
tree | 048c7e74fc0cae58e8a30c0ef3db1df5a4d347f9 /sys/kern/sysv_shm.c | |
parent | 469f432d987f41f5538a5ec954b5570ed1c23a48 (diff) | |
download | FreeBSD-src-82f0faf08691e602d759d4e2455cfcfef9fe2cbe.zip FreeBSD-src-82f0faf08691e602d759d4e2455cfcfef9fe2cbe.tar.gz |
Properly support for FreeBSD 4 32bit System V shared memory.
Submitted by: peter
Obtained from: Yahoo!
MFC after: 3 weeks
Diffstat (limited to 'sys/kern/sysv_shm.c')
-rw-r--r-- | sys/kern/sysv_shm.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/sys/kern/sysv_shm.c b/sys/kern/sysv_shm.c index c52f79d..d785891 100644 --- a/sys/kern/sysv_shm.c +++ b/sys/kern/sysv_shm.c @@ -102,20 +102,24 @@ __FBSDID("$FreeBSD$"); static MALLOC_DEFINE(M_SHM, "shm", "SVID compatible shared memory segments"); +#if defined(__i386__) && (defined(COMPAT_FREEBSD4) || defined(COMPAT_43)) struct oshmctl_args; static int oshmctl(struct thread *td, struct oshmctl_args *uap); +#endif static int shmget_allocate_segment(struct thread *td, struct shmget_args *uap, int mode); static int shmget_existing(struct thread *td, struct shmget_args *uap, int mode, int segnum); +#if defined(__i386__) && (defined(COMPAT_FREEBSD4) || defined(COMPAT_43)) /* XXX casting to (sy_call_t *) is bogus, as usual. */ static sy_call_t *shmcalls[] = { (sy_call_t *)shmat, (sy_call_t *)oshmctl, (sy_call_t *)shmdt, (sy_call_t *)shmget, (sy_call_t *)shmctl }; +#endif #define SHMSEG_FREE 0x0200 #define SHMSEG_REMOVED 0x0400 @@ -464,6 +468,7 @@ shmat(td, uap) return kern_shmat(td, uap->shmid, uap->shmaddr, uap->shmflg); } +#if defined(__i386__) && (defined(COMPAT_FREEBSD4) || defined(COMPAT_43)) struct oshmid_ds { struct ipc_perm shm_perm; /* operation perms */ int shm_segsz; /* size of segment (bytes) */ @@ -540,6 +545,7 @@ done2: return (EINVAL); #endif } +#endif #ifndef _SYS_SYSPROTO_H_ struct shmctl_args { @@ -876,6 +882,7 @@ shmsys(td, uap) int a4; } */ *uap; { +#if defined(__i386__) && (defined(COMPAT_FREEBSD4) || defined(COMPAT_43)) int error; if (!jail_sysvipc_allowed && jailed(td->td_ucred)) @@ -887,6 +894,9 @@ shmsys(td, uap) error = (*shmcalls[uap->which])(td, &uap->a2); mtx_unlock(&Giant); return (error); +#else + return (nosys(td, NULL)); +#endif } static void |