FreeBSD Bugzilla – Attachment 84265 Details for
Bug 120233
[libc] [patch] [request] FreeBSD is missing fcntl() operation F_DUP2FD
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
file.diff
file.diff (text/plain), 1.25 KB, created by
jau
on 2008-02-03 07:20:00 UTC
(
hide
)
Description:
file.diff
Filename:
MIME Type:
Creator:
jau
Created:
2008-02-03 07:20:00 UTC
Size:
1.25 KB
patch
obsolete
>--- sys/sys/fcntl.h.orig 2008-02-02 07:45:25.000000000 +0200 >+++ sys/sys/fcntl.h 2008-02-02 07:47:21.000000000 +0200 >@@ -176,6 +176,7 @@ > #define F_GETLK 7 /* get record locking information */ > #define F_SETLK 8 /* set record locking information */ > #define F_SETLKW 9 /* F_SETLK; wait if blocked */ >+#define F_DUP2FD 10 /* duplicate file descriptor, fixed */ > > /* file descriptor flags (F_GETFD, F_SETFD) */ > #define FD_CLOEXEC 1 /* close-on-exec flag */ >--- sys/kern/kern_descrip.c.orig 2008-02-02 07:39:50.000000000 +0200 >+++ sys/kern/kern_descrip.c 2008-02-02 07:41:31.000000000 +0200 >@@ -365,6 +365,7 @@ > */ > switch (cmd) { > case F_DUPFD: >+ case F_DUP2FD: > case F_GETFD: > case F_SETFD: > case F_GETFL: >@@ -405,6 +406,21 @@ > error = do_dup(td, DUP_VARIABLE, fd, newmin, td->td_retval); > break; > >+ case F_DUP2FD: >+ /* mtx_assert(&Giant, MA_NOTOWNED); */ >+ FILEDESC_UNLOCK(fdp); >+ newmin = arg; >+ PROC_LOCK(p); >+ if (newmin >= lim_cur(p, RLIMIT_NOFILE) || >+ newmin >= maxfilesperproc) { >+ PROC_UNLOCK(p); >+ error = EINVAL; >+ break; >+ } >+ PROC_UNLOCK(p); >+ error = do_dup(td, DUP_FIXED, fd, newmin, td->td_retval); >+ break; >+ > case F_GETFD: > /* mtx_assert(&Giant, MA_NOTOWNED); */ > td->td_retval[0] = (*pop & UF_EXCLOSE) ? FD_CLOEXEC : 0;
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 120233
: 84265