From f8dd4f370d01423c8b401c895c164dc47231e97c Mon Sep 17 00:00:00 2001 From: cgd Date: Wed, 4 May 1994 01:38:25 +0000 Subject: [PATCH] expand the rlimit struct, kill last vestiges of off_t bogosity. --- sys/compat/sunos/sun_misc.c | 10 +++---- sys/compat/sunos/sunos_misc.c | 10 +++---- sys/kern/init_sysent.c | 56 +++++++++++++++++++++++++---------- sys/kern/kern_resource.c | 2 +- sys/kern/syscalls.c | 29 ++++++++++++------ sys/kern/vfs_syscalls.c | 2 +- sys/sys/resource.h | 11 +++++-- sys/sys/syscall.h | 17 ++++++----- sys/vm/vm_mmap.c | 11 +------ 9 files changed, 92 insertions(+), 56 deletions(-) diff --git a/sys/compat/sunos/sun_misc.c b/sys/compat/sunos/sun_misc.c index ca1f4f010d1a..4fa11091eb4e 100644 --- a/sys/compat/sunos/sun_misc.c +++ b/sys/compat/sunos/sun_misc.c @@ -42,7 +42,7 @@ * @(#)sun_misc.c 8.1 (Berkeley) 6/18/93 * * from: Header: sun_misc.c,v 1.16 93/04/07 02:46:27 torek Exp - * $Id: sun_misc.c,v 1.18 1994/04/29 04:41:16 cgd Exp $ + * $Id: sun_misc.c,v 1.19 1994/05/04 01:38:25 cgd Exp $ */ /* @@ -939,7 +939,7 @@ sun_sysconf(p, uap, retval) struct sun_getrlimit_args { int which; - struct rlimit *rlp; + struct orlimit *rlp; }; sun_getrlimit(p, uap, retval) @@ -953,12 +953,12 @@ sun_getrlimit(p, uap, retval) if (uap->which == SUN_RLIMIT_NOFILE) uap->which = RLIMIT_NOFILE; - return getrlimit(p, uap, retval); + return ogetrlimit(p, uap, retval); } struct sun_setrlimit_args { int which; - struct rlimit *rlp; + struct orlimit *rlp; }; sun_setrlimit(p, uap, retval) @@ -972,5 +972,5 @@ sun_setrlimit(p, uap, retval) if (uap->which == SUN_RLIMIT_NOFILE) uap->which = RLIMIT_NOFILE; - return setrlimit(p, uap, retval); + return osetrlimit(p, uap, retval); } diff --git a/sys/compat/sunos/sunos_misc.c b/sys/compat/sunos/sunos_misc.c index a12c6d9351fe..6a3bc1f0570c 100644 --- a/sys/compat/sunos/sunos_misc.c +++ b/sys/compat/sunos/sunos_misc.c @@ -42,7 +42,7 @@ * @(#)sun_misc.c 8.1 (Berkeley) 6/18/93 * * from: Header: sun_misc.c,v 1.16 93/04/07 02:46:27 torek Exp - * $Id: sunos_misc.c,v 1.18 1994/04/29 04:41:16 cgd Exp $ + * $Id: sunos_misc.c,v 1.19 1994/05/04 01:38:25 cgd Exp $ */ /* @@ -939,7 +939,7 @@ sun_sysconf(p, uap, retval) struct sun_getrlimit_args { int which; - struct rlimit *rlp; + struct orlimit *rlp; }; sun_getrlimit(p, uap, retval) @@ -953,12 +953,12 @@ sun_getrlimit(p, uap, retval) if (uap->which == SUN_RLIMIT_NOFILE) uap->which = RLIMIT_NOFILE; - return getrlimit(p, uap, retval); + return ogetrlimit(p, uap, retval); } struct sun_setrlimit_args { int which; - struct rlimit *rlp; + struct orlimit *rlp; }; sun_setrlimit(p, uap, retval) @@ -972,5 +972,5 @@ sun_setrlimit(p, uap, retval) if (uap->which == SUN_RLIMIT_NOFILE) uap->which = RLIMIT_NOFILE; - return setrlimit(p, uap, retval); + return osetrlimit(p, uap, retval); } diff --git a/sys/kern/init_sysent.c b/sys/kern/init_sysent.c index ca41f93a950b..586aae7a9e6e 100644 --- a/sys/kern/init_sysent.c +++ b/sys/kern/init_sysent.c @@ -2,7 +2,7 @@ * System call switch table. * * DO NOT EDIT-- this file is automatically generated. - * created from: syscalls.master,v 1.16 1994/04/29 04:29:14 + * created from: syscalls.master,v 1.17 1994/05/01 05:02:24 */ #include @@ -115,6 +115,10 @@ int vtrace(); int gettimeofday(); int getrusage(); int getsockopt(); +#ifdef vax +int resuba(); +#else +#endif int readv(); int writev(); int settimeofday(); @@ -132,8 +136,6 @@ int utimes(); int adjtime(); int gethostid(); int sethostid(); -int getrlimit(); -int setrlimit(); int setsid(); int quotactl(); #ifdef NFSSERVER @@ -167,9 +169,18 @@ int shmsys(); int setgid(); int setegid(); int seteuid(); +#ifdef LFS +int lfs_bmapv(); +int lfs_markv(); +int lfs_segclean(); +int lfs_segwait(); +#else +#endif int stat(); int fstat(); int lstat(); +int getrlimit(); +int setrlimit(); int mmap(); int nosys(); int lseek(); @@ -216,12 +227,17 @@ int osendmsg(); #ifdef TRACE #else #endif +#ifdef vax +#else +#endif int orecvfrom(); int osetreuid(); int osetregid(); int otruncate(); int oftruncate(); int ogetpeername(); +int ogetrlimit(); +int osetrlimit(); int okillpg(); int oquota(); int ogetsockname(); @@ -240,10 +256,9 @@ int ogetsockname(); #ifdef SYSVSHM #else #endif -int onmmap(); -int onlseek(); -int ontruncate(); -int onftruncate(); +#ifdef LFS +#else +#endif #ifdef LKM #else /* !LKM */ #endif /* !LKM */ @@ -384,7 +399,11 @@ struct sysent sysent[] = { 2, gettimeofday, /* 116 = gettimeofday */ 2, getrusage, /* 117 = getrusage */ 5, getsockopt, /* 118 = getsockopt */ +#ifdef vax + 1, resuba, /* 119 = resuba */ +#else 0, nosys, /* 119 = nosys */ +#endif 3, readv, /* 120 = readv */ 3, writev, /* 121 = writev */ 2, settimeofday, /* 122 = settimeofday */ @@ -409,8 +428,8 @@ struct sysent sysent[] = { compat(3,getpeername), /* 141 = old getpeername */ 0, gethostid, /* 142 = gethostid */ 1, sethostid, /* 143 = sethostid */ - 2, getrlimit, /* 144 = getrlimit */ - 2, setrlimit, /* 145 = setrlimit */ + compat(2,getrlimit), /* 144 = old getrlimit */ + compat(2,setrlimit), /* 145 = old setrlimit */ compat(2,killpg), /* 146 = old killpg */ 0, setsid, /* 147 = setsid */ 4, quotactl, /* 148 = quotactl */ @@ -470,28 +489,35 @@ struct sysent sysent[] = { 1, setgid, /* 181 = setgid */ 1, setegid, /* 182 = setegid */ 1, seteuid, /* 183 = seteuid */ +#ifdef LFS + 3, lfs_bmapv, /* 184 = lfs_bmapv */ + 3, lfs_markv, /* 185 = lfs_markv */ + 2, lfs_segclean, /* 186 = lfs_segclean */ + 2, lfs_segwait, /* 187 = lfs_segwait */ +#else 0, nosys, /* 184 = nosys */ 0, nosys, /* 185 = nosys */ 0, nosys, /* 186 = nosys */ 0, nosys, /* 187 = nosys */ +#endif 2, stat, /* 188 = stat */ 2, fstat, /* 189 = fstat */ 2, lstat, /* 190 = lstat */ 0, nosys, /* 191 = nosys */ 0, nosys, /* 192 = nosys */ 0, nosys, /* 193 = nosys */ - 0, nosys, /* 194 = nosys */ - 0, nosys, /* 195 = nosys */ + 2, getrlimit, /* 194 = getrlimit */ + 2, setrlimit, /* 195 = setrlimit */ 0, nosys, /* 196 = nosys */ 8, mmap, /* 197 = mmap */ 0, nosys, /* 198 = __syscall */ 5, lseek, /* 199 = lseek */ 4, truncate, /* 200 = truncate */ 4, ftruncate, /* 201 = ftruncate */ - compat(8,nmmap), /* 202 = old nmmap */ - compat(5,nlseek), /* 203 = old nlseek */ - compat(4,ntruncate), /* 204 = old ntruncate */ - compat(4,nftruncate), /* 205 = old nftruncate */ + 0, nosys, /* 202 = nosys */ + 0, nosys, /* 203 = nosys */ + 0, nosys, /* 204 = nosys */ + 0, nosys, /* 205 = nosys */ 0, nosys, /* 206 = nosys */ 0, nosys, /* 207 = nosys */ 0, nosys, /* 208 = nosys */ diff --git a/sys/kern/kern_resource.c b/sys/kern/kern_resource.c index 651b58d70f4f..ea15b814f507 100644 --- a/sys/kern/kern_resource.c +++ b/sys/kern/kern_resource.c @@ -1 +1 @@ -revision 1.13 intentionally removed +revision 1.14 intentionally removed diff --git a/sys/kern/syscalls.c b/sys/kern/syscalls.c index bd99dbc093e3..87ac620cc634 100644 --- a/sys/kern/syscalls.c +++ b/sys/kern/syscalls.c @@ -2,7 +2,7 @@ * System call names. * * DO NOT EDIT-- this file is automatically generated. - * created from: syscalls.master,v 1.16 1994/04/29 04:29:14 + * created from: syscalls.master,v 1.17 1994/05/01 05:02:24 */ char *syscallnames[] = { @@ -137,7 +137,11 @@ char *syscallnames[] = { "gettimeofday", /* 116 = gettimeofday */ "getrusage", /* 117 = getrusage */ "getsockopt", /* 118 = getsockopt */ +#ifdef vax + "resuba", /* 119 = resuba */ +#else "#119", /* 119 = nosys */ +#endif "readv", /* 120 = readv */ "writev", /* 121 = writev */ "settimeofday", /* 122 = settimeofday */ @@ -162,8 +166,8 @@ char *syscallnames[] = { "old.getpeername", /* 141 = old getpeername */ "gethostid", /* 142 = gethostid */ "sethostid", /* 143 = sethostid */ - "getrlimit", /* 144 = getrlimit */ - "setrlimit", /* 145 = setrlimit */ + "old.getrlimit", /* 144 = old getrlimit */ + "old.setrlimit", /* 145 = old setrlimit */ "old.killpg", /* 146 = old killpg */ "setsid", /* 147 = setsid */ "quotactl", /* 148 = quotactl */ @@ -223,28 +227,35 @@ char *syscallnames[] = { "setgid", /* 181 = setgid */ "setegid", /* 182 = setegid */ "seteuid", /* 183 = seteuid */ +#ifdef LFS + "lfs_bmapv", /* 184 = lfs_bmapv */ + "lfs_markv", /* 185 = lfs_markv */ + "lfs_segclean", /* 186 = lfs_segclean */ + "lfs_segwait", /* 187 = lfs_segwait */ +#else "#184", /* 184 = nosys */ "#185", /* 185 = nosys */ "#186", /* 186 = nosys */ "#187", /* 187 = nosys */ +#endif "stat", /* 188 = stat */ "fstat", /* 189 = fstat */ "lstat", /* 190 = lstat */ "#191", /* 191 = nosys */ "#192", /* 192 = nosys */ "#193", /* 193 = nosys */ - "#194", /* 194 = nosys */ - "#195", /* 195 = nosys */ + "getrlimit", /* 194 = getrlimit */ + "setrlimit", /* 195 = setrlimit */ "#196", /* 196 = nosys */ "mmap", /* 197 = mmap */ "__syscall", /* 198 = __syscall */ "lseek", /* 199 = lseek */ "truncate", /* 200 = truncate */ "ftruncate", /* 201 = ftruncate */ - "old.nmmap", /* 202 = old nmmap */ - "old.nlseek", /* 203 = old nlseek */ - "old.ntruncate", /* 204 = old ntruncate */ - "old.nftruncate", /* 205 = old nftruncate */ + "#202", /* 202 = nosys */ + "#203", /* 203 = nosys */ + "#204", /* 204 = nosys */ + "#205", /* 205 = nosys */ "#206", /* 206 = nosys */ "#207", /* 207 = nosys */ "#208", /* 208 = nosys */ diff --git a/sys/kern/vfs_syscalls.c b/sys/kern/vfs_syscalls.c index 8bf0cf37dc6f..85c35a9bf292 100644 --- a/sys/kern/vfs_syscalls.c +++ b/sys/kern/vfs_syscalls.c @@ -1 +1 @@ -revision 1.24 intentionally removed +revision 1.25 intentionally removed diff --git a/sys/sys/resource.h b/sys/sys/resource.h index d745e70897a7..58c40a72817b 100644 --- a/sys/sys/resource.h +++ b/sys/sys/resource.h @@ -31,7 +31,7 @@ * SUCH DAMAGE. * * from: @(#)resource.h 7.5 (Berkeley) 3/17/91 - * $Id: resource.h,v 1.5 1993/12/20 12:43:27 cgd Exp $ + * $Id: resource.h,v 1.6 1994/05/04 01:38:59 cgd Exp $ */ #ifndef _SYS_RESOURCE_H_ @@ -90,13 +90,18 @@ struct rusage { #define RLIM_NLIMITS 9 /* number of resource limits */ -#define RLIM_INFINITY 0x7fffffff +#define RLIM_INFINITY (((u_quad_t)1 << 63) - 1) -struct rlimit { +struct orlimit { long rlim_cur; /* current (soft) limit */ long rlim_max; /* maximum value for rlim_cur */ }; +struct rlimit { + quad_t rlim_cur; /* current (soft) limit */ + quad_t rlim_max; /* maximum value for rlim_cur */ +}; + /* Load average structure. */ struct loadavg { fixpt_t ldavg[3]; diff --git a/sys/sys/syscall.h b/sys/sys/syscall.h index f46328c262cd..571d50d054de 100644 --- a/sys/sys/syscall.h +++ b/sys/sys/syscall.h @@ -2,7 +2,7 @@ * System call numbers. * * DO NOT EDIT-- this file is automatically generated. - * created from: syscalls.master,v 1.16 1994/04/29 04:29:14 + * created from: syscalls.master,v 1.17 1994/05/01 05:02:24 */ #ifndef _SYS_SYSCALL_H @@ -126,6 +126,7 @@ #define SYS_gettimeofday 116 #define SYS_getrusage 117 #define SYS_getsockopt 118 +#define SYS_resuba 119 #define SYS_readv 120 #define SYS_writev 121 #define SYS_settimeofday 122 @@ -150,8 +151,8 @@ /* 141 is old getpeername */ #define SYS_gethostid 142 #define SYS_sethostid 143 -#define SYS_getrlimit 144 -#define SYS_setrlimit 145 + /* 144 is old getrlimit */ + /* 145 is old setrlimit */ /* 146 is old killpg */ #define SYS_setsid 147 #define SYS_quotactl 148 @@ -173,17 +174,19 @@ #define SYS_setgid 181 #define SYS_setegid 182 #define SYS_seteuid 183 +#define SYS_lfs_bmapv 184 +#define SYS_lfs_markv 185 +#define SYS_lfs_segclean 186 +#define SYS_lfs_segwait 187 #define SYS_stat 188 #define SYS_fstat 189 #define SYS_lstat 190 +#define SYS_getrlimit 194 +#define SYS_setrlimit 195 #define SYS_mmap 197 #define SYS___syscall 198 #define SYS_lseek 199 #define SYS_truncate 200 #define SYS_ftruncate 201 - /* 202 is old nmmap */ - /* 203 is old nlseek */ - /* 204 is old ntruncate */ - /* 205 is old nftruncate */ #endif /* _SYS_SYSCALL_H */ diff --git a/sys/vm/vm_mmap.c b/sys/vm/vm_mmap.c index a3970af18015..52c121125de0 100644 --- a/sys/vm/vm_mmap.c +++ b/sys/vm/vm_mmap.c @@ -37,7 +37,7 @@ * * from: Utah Hdr: vm_mmap.c 1.3 90/01/21 * from: @(#)vm_mmap.c 7.5 (Berkeley) 6/28/91 - * $Id: vm_mmap.c,v 1.24 1994/04/29 04:41:56 cgd Exp $ + * $Id: vm_mmap.c,v 1.25 1994/05/04 01:39:05 cgd Exp $ */ /* @@ -234,15 +234,6 @@ mmap(p, uap, retval) } #if defined(COMPAT_43) || defined(COMPAT_SUNOS) -int -onmmap(p, uap, retval) - struct proc *p; - register struct mmap_args *uap; - int *retval; -{ - return (mmap(p, uap, retval)); -} - struct ommap_args { caddr_t addr; int len;