summaryrefslogtreecommitdiff
path: root/sys/kern
diff options
context:
space:
mode:
authorTheo de Raadt <deraadt@cvs.openbsd.org>2003-06-23 04:26:54 +0000
committerTheo de Raadt <deraadt@cvs.openbsd.org>2003-06-23 04:26:54 +0000
commitaf657e86986592ceb9d961e5251264dacb8f8370 (patch)
tree32676b60e530e8642d412508327c9a6e54b274bb /sys/kern
parent822b697c68012e41a39169a609996ec99f0e3eec (diff)
fix nfds type; tedu marc ok
Diffstat (limited to 'sys/kern')
-rw-r--r--sys/kern/sys_generic.c9
-rw-r--r--sys/kern/syscalls.master4
2 files changed, 9 insertions, 4 deletions
diff --git a/sys/kern/sys_generic.c b/sys/kern/sys_generic.c
index 8572ddf4af0..ebac87a0030 100644
--- a/sys/kern/sys_generic.c
+++ b/sys/kern/sys_generic.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: sys_generic.c,v 1.42 2003/06/02 23:28:06 millert Exp $ */
+/* $OpenBSD: sys_generic.c,v 1.43 2003/06/23 04:26:53 deraadt Exp $ */
/* $NetBSD: sys_generic.c,v 1.24 1996/03/29 00:25:32 cgd Exp $ */
/*
@@ -924,7 +924,12 @@ sys_poll(struct proc *p, void *v, register_t *retval)
struct timeval atv;
int timo, ncoll, i, s, error, error2;
extern int nselcoll, selwait;
- u_int nfds = SCARG(uap, nfds);
+ u_int nfds;
+
+ if (SCARG(uap, nfds) < 0)
+ return (EINVAL);
+
+ nfds = SCARG(uap, nfds);
/* Standards say no more than MAX_OPEN; this is possibly better. */
if (nfds > min((int)p->p_rlimit[RLIMIT_NOFILE].rlim_cur, maxfiles))
diff --git a/sys/kern/syscalls.master b/sys/kern/syscalls.master
index 93743d81d1e..2b70eaeb954 100644
--- a/sys/kern/syscalls.master
+++ b/sys/kern/syscalls.master
@@ -1,4 +1,4 @@
-; $OpenBSD: syscalls.master,v 1.59 2003/06/22 21:34:16 deraadt Exp $
+; $OpenBSD: syscalls.master,v 1.60 2003/06/23 04:26:53 deraadt Exp $
; $NetBSD: syscalls.master,v 1.32 1996/04/23 10:24:21 mycroft Exp $
; @(#)syscalls.master 8.2 (Berkeley) 1/13/94
@@ -487,7 +487,7 @@
int inherit); }
251 STD { int sys_rfork(int flags); }
252 STD { int sys_poll(struct pollfd *fds, \
- unsigned long nfds, int timeout); }
+ int nfds, int timeout); }
253 STD { int sys_issetugid(void); }
254 STD { int sys_lchown(const char *path, uid_t uid, gid_t gid); }
255 STD { pid_t sys_getsid(pid_t pid); }