diff --git a/lib/libc/sys/kqueue.2 b/lib/libc/sys/kqueue.2 index ed3a8adfa73..75c8207e744 100644 --- a/lib/libc/sys/kqueue.2 +++ b/lib/libc/sys/kqueue.2 @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd January 21, 2013 +.Dd November 4, 2013 .Dt KQUEUE 2 .Os .Sh NAME @@ -532,6 +532,13 @@ system call fails if: .Bl -tag -width Er .It Bq Er ENOMEM The kernel failed to allocate enough memory for the kernel queue. +.It Bq Er ENOMEM +The +.Dv RLIMIT_KQUEUES +rlimit +(see +.Xr getrlimit 2 ) +for the current user would be exceeded. .It Bq Er EMFILE The per-process descriptor table is full. .It Bq Er ENFILE diff --git a/sys/kern/kern_event.c b/sys/kern/kern_event.c index a80e50d1fab..2b08c1b4b77 100644 --- a/sys/kern/kern_event.c +++ b/sys/kern/kern_event.c @@ -712,7 +712,7 @@ sys_kqueue(struct thread *td, struct kqueue_args *uap) RLIMIT_KQUEUES))) { PROC_UNLOCK(p); crfree(cred); - return (EMFILE); + return (ENOMEM); } PROC_UNLOCK(p);