diff options
author | des <des@FreeBSD.org> | 2004-01-15 10:15:04 +0000 |
---|---|---|
committer | des <des@FreeBSD.org> | 2004-01-15 10:15:04 +0000 |
commit | f270054cd314ee2f822fb6cb1e04452749d4c214 (patch) | |
tree | 17db0a692fa4e5f4c64cebaf9205ad10ff29301e /sys/kern/uipc_usrreq.c | |
parent | eb1be5f02d7c125633ee09a54f1c6bbefbd1348a (diff) | |
download | FreeBSD-src-f270054cd314ee2f822fb6cb1e04452749d4c214.zip FreeBSD-src-f270054cd314ee2f822fb6cb1e04452749d4c214.tar.gz |
New file descriptor allocation code, derived from similar code introduced
in OpenBSD by Niels Provos. The patch introduces a bitmap of allocated
file descriptors which is used to locate available descriptors when a new
one is needed. It also moves the task of growing the file descriptor table
out of fdalloc(), reducing complexity in both fdalloc() and do_dup().
Debts of gratitude are owed to tjr@ (who provided the original patch on
which this work is based), grog@ (for the gdb(4) man page) and rwatson@
(for assistance with pxeboot(8)).
Diffstat (limited to 'sys/kern/uipc_usrreq.c')
-rw-r--r-- | sys/kern/uipc_usrreq.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/sys/kern/uipc_usrreq.c b/sys/kern/uipc_usrreq.c index 1f9ca3d..8dd9b7e 100644 --- a/sys/kern/uipc_usrreq.c +++ b/sys/kern/uipc_usrreq.c @@ -1047,7 +1047,7 @@ unp_externalize(control, controlp) fdp = (int *) CMSG_DATA(mtod(*controlp, struct cmsghdr *)); for (i = 0; i < newfds; i++) { - if (fdalloc(td, 0, &f)) + if (fdalloc(td, &f)) panic("unp_externalize fdalloc failed"); fp = *rp++; td->td_proc->p_fd->fd_ofiles[f] = fp; |