diff options
author | marcel <marcel@FreeBSD.org> | 2000-08-26 05:08:10 +0000 |
---|---|---|
committer | marcel <marcel@FreeBSD.org> | 2000-08-26 05:08:10 +0000 |
commit | 8d6f6fc33c32e748cb1947df61f4367e16262f82 (patch) | |
tree | f5476a5fca084c7134c07790b23229c48a0b0c19 /sys/compat/linux | |
parent | 9a83783c97bda95bcd9406b5b0246f64c9fc8e63 (diff) | |
download | FreeBSD-src-8d6f6fc33c32e748cb1947df61f4367e16262f82.zip FreeBSD-src-8d6f6fc33c32e748cb1947df61f4367e16262f82.tar.gz |
Fix bug in previous commit. We need to trim the limits to fit
the datatype (= long). Use ULONG_MAX and LONG_MAX to avoid
creating MD code.
Diffstat (limited to 'sys/compat/linux')
-rw-r--r-- | sys/compat/linux/linux_misc.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/sys/compat/linux/linux_misc.c b/sys/compat/linux/linux_misc.c index 97a7c00..8b32658 100644 --- a/sys/compat/linux/linux_misc.c +++ b/sys/compat/linux/linux_misc.c @@ -56,6 +56,7 @@ #include <vm/vm_extern.h> #include <machine/frame.h> +#include <machine/limits.h> #include <machine/psl.h> #include <machine/sysarch.h> #include <machine/segments.h> @@ -1048,7 +1049,11 @@ linux_getrlimit(p, uap) return (error); rlim.rlim_cur = (unsigned long)bsd.rlp->rlim_cur; + if (rlim.rlim_cur == ULONG_MAX) + rlim.rlim_cur = LONG_MAX; rlim.rlim_max = (unsigned long)bsd.rlp->rlim_max; + if (rlim.rlim_max == ULONG_MAX) + rlim.rlim_max = LONG_MAX; return (copyout(&rlim, uap->rlim, sizeof(rlim))); } |