kqueue: Change error for kqueues rlimit from EMFILE to ENOMEM and document

this error condition in the kqueue(2) manual page.

Discussed with:	kib
This commit is contained in:
Jilles Tjoelker 2013-11-03 23:06:24 +00:00
parent 5e503d28c5
commit 1947c8a6d1
2 changed files with 9 additions and 2 deletions

View file

@ -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

View file

@ -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);