diff options
author | Paul Irofti <pirofti@cvs.openbsd.org> | 2011-02-11 21:40:05 +0000 |
---|---|---|
committer | Paul Irofti <pirofti@cvs.openbsd.org> | 2011-02-11 21:40:05 +0000 |
commit | 776c3e595584439b137d0ea722166c3bc8ff410f (patch) | |
tree | 83cef4c591c9a4b11ecd9bfd75ce023a993b01fe /sys/compat | |
parent | a0b2e9bac61c7000cbdce2f326dd3651ed3608f4 (diff) |
Add linux_mprotect() syscall. Okay otto@.
Diffstat (limited to 'sys/compat')
-rw-r--r-- | sys/compat/linux/linux_misc.c | 12 | ||||
-rw-r--r-- | sys/compat/linux/syscalls.master | 4 |
2 files changed, 13 insertions, 3 deletions
diff --git a/sys/compat/linux/linux_misc.c b/sys/compat/linux/linux_misc.c index cb7abec8993..455a62097d3 100644 --- a/sys/compat/linux/linux_misc.c +++ b/sys/compat/linux/linux_misc.c @@ -1,4 +1,4 @@ -/* $OpenBSD: linux_misc.c,v 1.65 2010/07/26 01:56:27 guenther Exp $ */ +/* $OpenBSD: linux_misc.c,v 1.66 2011/02/11 21:40:04 pirofti Exp $ */ /* $NetBSD: linux_misc.c,v 1.27 1996/05/20 01:59:21 fvdl Exp $ */ /*- @@ -1474,3 +1474,13 @@ linux_sys_sysinfo(p, v, retval) return (copyout(&si, SCARG(uap, sysinfo), sizeof(si))); } + +int +linux_sys_mprotect(struct proc *p, void *v, register_t *retval) +{ + struct sys_mprotect_args *uap = v; + + if (SCARG(uap, prot) & (PROT_WRITE | PROT_EXEC)) + SCARG(uap, prot) |= PROT_READ; + return (sys_mprotect(p, uap, retval)); +} diff --git a/sys/compat/linux/syscalls.master b/sys/compat/linux/syscalls.master index 0e75f493436..ff75ec654d1 100644 --- a/sys/compat/linux/syscalls.master +++ b/sys/compat/linux/syscalls.master @@ -1,4 +1,4 @@ - $OpenBSD: syscalls.master,v 1.52 2011/02/10 11:58:43 pirofti Exp $ + $OpenBSD: syscalls.master,v 1.53 2011/02/11 21:40:04 pirofti Exp $ ; $NetBSD: syscalls.master,v 1.15 1995/12/18 14:35:10 fvdl Exp $ ; @(#)syscalls.master 8.1 (Berkeley) 7/19/93 @@ -223,7 +223,7 @@ 123 STD { int linux_sys_modify_ldt(void); } #endif 124 STD { int linux_sys_adjtimex(void); } -125 NOARGS { int sys_mprotect(caddr_t addr, int len, int prot); } +125 STD { int linux_sys_mprotect(caddr_t addr, int len, int prot); } 126 STD { int linux_sys_sigprocmask(int how, \ linux_old_sigset_t *set, linux_old_sigset_t *oset); } 127 STD { int linux_sys_create_module(void); } |