Re: dup3 syscall - atomic set O_CLOEXEC with dup2

2012-01-12 Thread Davide Italiano
On Thu, Jan 12, 2012 at 6:01 AM, Eitan Adler li...@eitanadler.com wrote: This is an implementation of dup3 for FreeBSD: man page here (with a FreeBSD patch coming soon): https://www.kernel.org/doc/man-pages/online/pages/man2/dup.2.html Is this implementation correct? If so any objection to

Re: Assigning the PRIV_NETINET_BINDANY privilege required for setsockopt(IP_BINDANY)

2012-01-12 Thread Robert N. M. Watson
On 12 Jan 2012, at 06:03, Adrian Chadd wrote: On 11 January 2012 15:26, Gerald McNulty gmn...@gmail.com wrote: Using IP_BINDANY to facilitate transparent proxying works as specified. According the ip(4) man page and sys/netinet/ip_output.c, the PRIV_NETINET_BINDANY privilege is required in

Re: dup3 syscall - atomic set O_CLOEXEC with dup2

2012-01-12 Thread Ed Schouten
Hello Eitan, * Eitan Adler li...@eitanadler.com, 20120112 06:01: This is an implementation of dup3 for FreeBSD: man page here (with a FreeBSD patch coming soon): https://www.kernel.org/doc/man-pages/online/pages/man2/dup.2.html Is this implementation correct? If so any objection to adding

Re: dup3 syscall - atomic set O_CLOEXEC with dup2

2012-01-12 Thread Kostik Belousov
On Thu, Jan 12, 2012 at 12:01:29AM -0500, Eitan Adler wrote: This is an implementation of dup3 for FreeBSD: man page here (with a FreeBSD patch coming soon): https://www.kernel.org/doc/man-pages/online/pages/man2/dup.2.html Is this implementation correct? If so any objection to adding this

Re: dup3 syscall - atomic set O_CLOEXEC with dup2

2012-01-12 Thread Ed Schouten
* Ed Schouten e...@80386.nl, 20120112 10:56: I suspect that not long after we add dup3(), some random person asks us to implement F_DUP3FD. Any chance you can implement this without using a system call, but through fcntl()? Never mind. This seems to be non-trivial, as fcntl() just takes

Re: dup3 syscall - atomic set O_CLOEXEC with dup2

2012-01-12 Thread Kostik Belousov
On Thu, Jan 12, 2012 at 12:08:40PM +0200, Kostik Belousov wrote: On Thu, Jan 12, 2012 at 12:01:29AM -0500, Eitan Adler wrote: This is an implementation of dup3 for FreeBSD: man page here (with a FreeBSD patch coming soon): https://www.kernel.org/doc/man-pages/online/pages/man2/dup.2.html

Re: dup3 syscall - atomic set O_CLOEXEC with dup2

2012-01-12 Thread Ed Schouten
Hi Kostik, * Kostik Belousov kostik...@gmail.com, 20120112 11:08: +int +sys_dup3(struct thread * const td, struct dup3_args * const uap) { The td and uap are not constant in the prototypes generated by makesyscalls.sh. This makes me seriosly wonder was the patch compiled at all

Re: dup3 syscall - atomic set O_CLOEXEC with dup2

2012-01-12 Thread Eitan Adler
Thank you for your comments. I will hopefully have version 2 of the diff tonight. On Thu, Jan 12, 2012 at 4:56 AM, Ed Schouten e...@80386.nl wrote: I suspect that not long after we add dup3(), some random person asks us to implement F_DUP3FD. Any chance you can implement this without using a

Re: Processes' FIBs

2012-01-12 Thread Oliver Fromme
Bjoern A. Zeeb wrote: On 11. Jan 2012, at 15:06 , Oliver Fromme wrote: I'm currently looking at the source code of ps, but adding a field for the FIB isn't as trivial as I thought because ps only sees struct kinfo_proc (via sysctl kern.proc.*) which doesn't contain the FIB. procstat

Re: dup3 syscall - atomic set O_CLOEXEC with dup2

2012-01-12 Thread Eitan Adler
Okay - here is version 2 (compile and run tested) Index: sys/kern/kern_descrip.c === --- sys/kern/kern_descrip.c (revision 229830) +++ sys/kern/kern_descrip.c (working copy) @@ -110,6 +110,7 @@ /* Flags for do_dup() */

Re: Processes' FIBs

2012-01-12 Thread Julian Elischer
On 1/12/12 6:04 AM, Oliver Fromme wrote: Bjoern A. Zeeb wrote: On 11. Jan 2012, at 15:06 , Oliver Fromme wrote: I'm currently looking at the source code of ps, but adding a field for the FIB isn't as trivial as I thought because ps only sees struct kinfo_proc (via sysctl

Re: dup3 syscall - atomic set O_CLOEXEC with dup2

2012-01-12 Thread Václav Zeman
On Thu, 12 Jan 2012 22:07:58 -0500, Eitan Adler wrote: Okay - here is version 2 (compile and run tested) Index: sys/kern/kern_descrip.c === --- sys/kern/kern_descrip.c (revision 229830) +++ sys/kern/kern_descrip.c (working