diff options
author | 2011-07-07 01:19:39 +0000 | |
---|---|---|
committer | 2011-07-07 01:19:39 +0000 | |
commit | fbf7d76740c1b7b509979f05d8e13dfb66028cff (patch) | |
tree | e4d1f60018f9ba7e0926e8578367f935db0e5a89 /sys/compat/linux/linux_resource.c | |
parent | Document extended-precision routines. (diff) | |
download | wireguard-openbsd-fbf7d76740c1b7b509979f05d8e13dfb66028cff.tar.xz wireguard-openbsd-fbf7d76740c1b7b509979f05d8e13dfb66028cff.zip |
remove all the old COMPAT_43 syscalls. The option itself remains for
the other things it enables. Move a few old wrappers into linux compat
where they are still being used.
ok deraadt guenther
Diffstat (limited to 'sys/compat/linux/linux_resource.c')
-rw-r--r-- | sys/compat/linux/linux_resource.c | 27 |
1 files changed, 25 insertions, 2 deletions
diff --git a/sys/compat/linux/linux_resource.c b/sys/compat/linux/linux_resource.c index 4d8885187ab..11c86d852ca 100644 --- a/sys/compat/linux/linux_resource.c +++ b/sys/compat/linux/linux_resource.c @@ -1,4 +1,4 @@ -/* $OpenBSD: linux_resource.c,v 1.4 2003/06/03 20:49:28 deraadt Exp $ */ +/* $OpenBSD: linux_resource.c,v 1.5 2011/07/07 01:19:39 tedu Exp $ */ /* * Copyright (c) 2000 Niklas Hallqvist @@ -68,6 +68,29 @@ linux_to_bsd_rlimit(which) return (linux_to_bsd_rlimit_map[which]); } + +struct compat_sys_setrlimit_args { + syscallarg(int) which; + syscallarg(struct olimit *) rlp; +}; +int compat_sys_setrlimit(struct proc *p, void *v, register_t *retval); +int +compat_sys_setrlimit(struct proc *p, void *v, register_t *retval) +{ + struct compat_sys_setrlimit_args *uap = v; + struct orlimit olim; + struct rlimit lim; + int error; + + error = copyin((caddr_t)SCARG(uap, rlp), (caddr_t)&olim, + sizeof (struct orlimit)); + if (error) + return (error); + lim.rlim_cur = olim.rlim_cur; + lim.rlim_max = olim.rlim_max; + return (dosetrlimit(p, SCARG(uap, which), &lim)); +} + int linux_sys_setrlimit(p, v, retval) struct proc *p; @@ -82,7 +105,7 @@ linux_sys_setrlimit(p, v, retval) SCARG(uap, which) = linux_to_bsd_rlimit(SCARG(uap, which)); if (SCARG(uap, which) == RLIM_NLIMITS) return (EINVAL); - return (compat_43_sys_setrlimit(p, v, retval)); + return (compat_sys_setrlimit(p, v, retval)); } int |