summaryrefslogtreecommitdiffstats
path: root/sys/kern/sys_generic.c
diff options
context:
space:
mode:
Diffstat (limited to 'sys/kern/sys_generic.c')
-rw-r--r--sys/kern/sys_generic.c7
1 files changed, 1 insertions, 6 deletions
diff --git a/sys/kern/sys_generic.c b/sys/kern/sys_generic.c
index 90946ea..209e5a9 100644
--- a/sys/kern/sys_generic.c
+++ b/sys/kern/sys_generic.c
@@ -1013,13 +1013,8 @@ poll(td, uap)
* least enough for the current limits. We want to be reasonably
* safe, but not overly restrictive.
*/
- PROC_LOCK(td->td_proc);
- if ((nfds > lim_cur(td->td_proc, RLIMIT_NOFILE)) &&
- (nfds > FD_SETSIZE)) {
- PROC_UNLOCK(td->td_proc);
+ if (nfds > maxfilesperproc && nfds > FD_SETSIZE)
return (EINVAL);
- }
- PROC_UNLOCK(td->td_proc);
ni = nfds * sizeof(struct pollfd);
if (ni > sizeof(smallbits))
bits = malloc(ni, M_TEMP, M_WAITOK);
OpenPOWER on IntegriCloud