diff options
author | Ted Unangst <tedu@cvs.openbsd.org> | 2007-04-05 15:33:43 +0000 |
---|---|---|
committer | Ted Unangst <tedu@cvs.openbsd.org> | 2007-04-05 15:33:43 +0000 |
commit | 3ce4a1e1232df853581febd80affa8ef602275e4 (patch) | |
tree | f67748dbfaff0ead3f4626fb90c40ec1b7233772 | |
parent | 7d9e9dece74ab05d768b6dddaa0cb2fbd033e7c8 (diff) |
freebsd added some MAP_NOCORE flag. we don't like it, so mask it out.
started by claudio. ok deraadt millert
-rw-r--r-- | sys/compat/freebsd/freebsd_misc.c | 20 | ||||
-rw-r--r-- | sys/compat/freebsd/syscalls.master | 6 |
2 files changed, 22 insertions, 4 deletions
diff --git a/sys/compat/freebsd/freebsd_misc.c b/sys/compat/freebsd/freebsd_misc.c index a045df91e4d..b7eb9532b57 100644 --- a/sys/compat/freebsd/freebsd_misc.c +++ b/sys/compat/freebsd/freebsd_misc.c @@ -1,4 +1,4 @@ -/* $OpenBSD: freebsd_misc.c,v 1.9 2005/02/19 21:19:28 matthieu Exp $ */ +/* $OpenBSD: freebsd_misc.c,v 1.10 2007/04/05 15:33:42 tedu Exp $ */ /* $NetBSD: freebsd_misc.c,v 1.2 1996/05/03 17:03:10 christos Exp $ */ /* @@ -43,6 +43,7 @@ #include <sys/file.h> #include <sys/dirent.h> #include <sys/filedesc.h> +#include <sys/mman.h> #include <sys/vnode.h> #include <sys/syscallargs.h> @@ -161,3 +162,20 @@ freebsd_sys_getdents(struct proc *p, void *v, register_t *retval) *retval = SCARG(uap, count) - args.resid; return (0); } + +#define FBSD_MAP_NOCORE 0x20000 +int +freebsd_sys_mmap(struct proc *p, void *v, register_t *retval) +{ + struct freebsd_sys_mmap_args /* { + syscallarg(caddr_t) addr; + syscallarg(size_t) len; + syscallarg(int) prot; + syscallarg(int) flags; + syscallarg(int) fd; + syscallarg(long) pad; + syscallarg(off_t) pos; + } */ *uap = v; + SCARG(uap, flags) &= ~FBSD_MAP_NOCORE; + return (sys_mmap(p, uap, retval)); +} diff --git a/sys/compat/freebsd/syscalls.master b/sys/compat/freebsd/syscalls.master index 68fc621bab0..388718b91fd 100644 --- a/sys/compat/freebsd/syscalls.master +++ b/sys/compat/freebsd/syscalls.master @@ -1,4 +1,4 @@ - $OpenBSD: syscalls.master,v 1.30 2006/09/22 15:29:57 pedro Exp $ + $OpenBSD: syscalls.master,v 1.31 2007/04/05 15:33:42 tedu Exp $ ; $NetBSD: syscalls.master,v 1.3 1995/10/10 18:28:40 mycroft Exp $ ; from: @(#)syscalls.master 8.2 (Berkeley) 1/13/94 @@ -367,8 +367,8 @@ 195 NOARGS { int sys_setrlimit(u_int which, struct rlimit *rlp); } 196 NOARGS { int sys_getdirentries(int fd, char *buf, \ u_int count, long *basep); } -197 NOARGS { caddr_t sys_mmap(caddr_t addr, size_t len, int prot, \ - int flags, int fd, long pad, off_t pos); } +197 STD { caddr_t freebsd_sys_mmap(caddr_t addr, size_t len, \ + int prot, int flags, int fd, long pad, off_t pos); } 198 NOARGS { int sys_nosys(void); } __syscall 199 NOARGS { off_t sys_lseek(int fd, int pad, off_t offset, \ int whence); } |