Fix slight argument bogosity with getgroups(), setgroups(), select(),

and swapctl().  For the former three, they use an 'int' in their user-land
prototype which was a 'u_int' in the kernel, which screwed up automatic
generation/checking of lint syscall stubs.  For the latter, the user-land
prototype uses a "const char *", but the syscall just used "char *".

From Chris Demetriou <cgd@pa.dec.com>.
This commit is contained in:
thorpej 1997-11-04 21:24:14 +00:00
parent 5e82d82867
commit 97d2a58201
4 changed files with 18 additions and 12 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: kern_prot.c,v 1.40 1997/04/23 18:59:58 mycroft Exp $ */
/* $NetBSD: kern_prot.c,v 1.41 1997/11/04 21:24:14 thorpej Exp $ */
/*
* Copyright (c) 1982, 1986, 1989, 1990, 1991, 1993
@ -182,13 +182,15 @@ sys_getgroups(p, v, retval)
register_t *retval;
{
register struct sys_getgroups_args /* {
syscallarg(u_int) gidsetsize;
syscallarg(int) gidsetsize;
syscallarg(gid_t *) gidset;
} */ *uap = v;
register struct pcred *pc = p->p_cred;
register u_int ngrp;
int error;
if (SCARG(uap, gidsetsize) < 0)
return (EINVAL);
if ((ngrp = SCARG(uap, gidsetsize)) == 0) {
*retval = pc->pc_ucred->cr_ngroups;
return (0);
@ -479,7 +481,7 @@ sys_setgroups(p, v, retval)
register_t *retval;
{
struct sys_setgroups_args /* {
syscallarg(u_int) gidsetsize;
syscallarg(int) gidsetsize;
syscallarg(const gid_t *) gidset;
} */ *uap = v;
register struct pcred *pc = p->p_cred;
@ -488,6 +490,8 @@ sys_setgroups(p, v, retval)
if ((error = suser(pc->pc_ucred, &p->p_acflag)) != 0)
return (error);
if (SCARG(uap, gidsetsize) < 0)
return (EINVAL);
ngrp = SCARG(uap, gidsetsize);
if (ngrp > NGROUPS)
return (EINVAL);

View File

@ -1,4 +1,4 @@
/* $NetBSD: sys_generic.c,v 1.34 1997/10/15 17:04:14 mycroft Exp $ */
/* $NetBSD: sys_generic.c,v 1.35 1997/11/04 21:24:17 thorpej Exp $ */
/*
* Copyright (c) 1982, 1986, 1989, 1993
@ -536,7 +536,7 @@ sys_select(p, v, retval)
register_t *retval;
{
register struct sys_select_args /* {
syscallarg(u_int) nd;
syscallarg(int) nd;
syscallarg(fd_set *) in;
syscallarg(fd_set *) ou;
syscallarg(fd_set *) ex;
@ -548,6 +548,8 @@ sys_select(p, v, retval)
int s, ncoll, error = 0, timo;
size_t ni;
if (SCARG(uap, nd) < 0)
return (EINVAL);
if (SCARG(uap, nd) > p->p_fd->fd_nfiles) {
/* forgiving; slightly wrong */
SCARG(uap, nd) = p->p_fd->fd_nfiles;

View File

@ -1,4 +1,4 @@
$NetBSD: syscalls.master,v 1.63 1997/10/20 22:05:06 thorpej Exp $
$NetBSD: syscalls.master,v 1.64 1997/11/04 21:24:18 thorpej Exp $
; @(#)syscalls.master 8.2 (Berkeley) 1/13/94
@ -160,9 +160,9 @@
77 OBSOL vlimit
78 STD { int sys_mincore(caddr_t addr, size_t len, \
char *vec); }
79 STD { int sys_getgroups(u_int gidsetsize, \
79 STD { int sys_getgroups(int gidsetsize, \
gid_t *gidset); }
80 STD { int sys_setgroups(u_int gidsetsize, \
80 STD { int sys_setgroups(int gidsetsize, \
const gid_t *gidset); }
81 STD { int sys_getpgrp(void); }
82 STD { int sys_setpgid(int pid, int pgid); }
@ -181,7 +181,7 @@
90 STD { int sys_dup2(int from, int to); }
91 UNIMPL getdopt
92 STD { int sys_fcntl(int fd, int cmd, ... void *arg); }
93 STD { int sys_select(u_int nd, fd_set *in, fd_set *ou, \
93 STD { int sys_select(int nd, fd_set *in, fd_set *ou, \
fd_set *ex, struct timeval *tv); }
94 UNIMPL setdopt
95 STD { int sys_fsync(int fd); }
@ -503,7 +503,7 @@
269 UNIMPL
270 STD { int sys_posix_rename(const char *from, \
const char *to); }
271 STD { int sys_swapctl(int cmd, void *arg, int misc); }
271 STD { int sys_swapctl(int cmd, const void *arg, int misc); }
272 STD { int sys_getdents(int fd, char *buf, size_t count); }
273 STD { int sys_minherit(void *addr, size_t len, \
int inherit); }

View File

@ -1,4 +1,4 @@
/* $NetBSD: vm_swap.c,v 1.47 1997/10/17 19:06:05 pk Exp $ */
/* $NetBSD: vm_swap.c,v 1.48 1997/11/04 21:24:22 thorpej Exp $ */
/*
* Copyright (c) 1995, 1996, 1997 Matthew R. Green
@ -442,7 +442,7 @@ sys_swapctl(p, v, retval)
{
struct sys_swapctl_args /* {
syscallarg(int) cmd;
syscallarg(void *) arg;
syscallarg(const void *) arg;
syscallarg(int) misc;
} */ *uap = (struct sys_swapctl_args *)v;
struct vnode *vp;