diff options
author | marcel <marcel@FreeBSD.org> | 1999-08-15 13:28:35 +0000 |
---|---|---|
committer | marcel <marcel@FreeBSD.org> | 1999-08-15 13:28:35 +0000 |
commit | 6ba73f21a56c72fd4dcb81ee6371fdff6621de68 (patch) | |
tree | 65008b3aa80e79f3230f6cdb37d98b3993dc4697 /sys/compat/linux/linux_misc.c | |
parent | 3b32edfe60ecacd63d25cdfe7d99b4a0377b145e (diff) | |
download | FreeBSD-src-6ba73f21a56c72fd4dcb81ee6371fdff6621de68.zip FreeBSD-src-6ba73f21a56c72fd4dcb81ee6371fdff6621de68.tar.gz |
Include opt_compat.h so that COMPAT_43 is defined. This gives us the proper
prototypes of o{s|g}etrlimit (from sys/sysproto.h). Update linux_{s|g}etrlimit
so that the arguments to o{s|g}etrlimit are corresponding the prototypes.
Pointed out by: bde
Diffstat (limited to 'sys/compat/linux/linux_misc.c')
-rw-r--r-- | sys/compat/linux/linux_misc.c | 25 |
1 files changed, 15 insertions, 10 deletions
diff --git a/sys/compat/linux/linux_misc.c b/sys/compat/linux/linux_misc.c index a822beb..7d88cb1 100644 --- a/sys/compat/linux/linux_misc.c +++ b/sys/compat/linux/linux_misc.c @@ -25,9 +25,11 @@ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * - * $Id: linux_misc.c,v 1.60 1999/08/08 11:26:46 marcel Exp $ + * $Id: linux_misc.c,v 1.61 1999/08/11 13:34:30 marcel Exp $ */ +#include "opt_compat.h" + #include <sys/param.h> #include <sys/systm.h> #include <sys/sysproto.h> @@ -60,9 +62,6 @@ #include <i386/linux/linux_proto.h> #include <i386/linux/linux_util.h> -int osetrlimit __P((struct proc*, struct linux_setrlimit_args*)); -int ogetrlimit __P((struct proc*, struct linux_getrlimit_args*)); - static unsigned int linux_to_bsd_resource[LINUX_RLIM_NLIMITS] = { RLIMIT_CPU, RLIMIT_FSIZE, RLIMIT_DATA, RLIMIT_STACK, RLIMIT_CORE, RLIMIT_RSS, RLIMIT_NPROC, RLIMIT_NOFILE, @@ -1213,6 +1212,8 @@ linux_setrlimit(p, uap) struct proc *p; struct linux_setrlimit_args *uap; { + struct osetrlimit_args bsd; + #ifdef DEBUG printf("Linux-emul(%ld): setrlimit(%d, %p)\n", (long)p->p_pid, uap->resource, (void *)uap->rlim); @@ -1221,12 +1222,13 @@ linux_setrlimit(p, uap) if (uap->resource >= LINUX_RLIM_NLIMITS) return EINVAL; - uap->resource = linux_to_bsd_resource[uap->resource]; + bsd.which = linux_to_bsd_resource[uap->resource]; - if (uap->resource == -1) + if (bsd.which == -1) return EINVAL; - return osetrlimit(p, uap); + bsd.rlp = uap->rlim; + return osetrlimit(p, &bsd); } int @@ -1234,6 +1236,8 @@ linux_getrlimit(p, uap) struct proc *p; struct linux_getrlimit_args *uap; { + struct ogetrlimit_args bsd; + #ifdef DEBUG printf("Linux-emul(%ld): getrlimit(%d, %p)\n", (long)p->p_pid, uap->resource, (void *)uap->rlim); @@ -1242,10 +1246,11 @@ linux_getrlimit(p, uap) if (uap->resource >= LINUX_RLIM_NLIMITS) return EINVAL; - uap->resource = linux_to_bsd_resource[uap->resource]; + bsd.which = linux_to_bsd_resource[uap->resource]; - if (uap->resource == -1) + if (bsd.which == -1) return EINVAL; - return ogetrlimit(p, uap); + bsd.rlp = uap->rlim; + return ogetrlimit(p, &bsd); } |