dup3 syscall - atomic set O_CLOEXEC with dup2

Václav Zeman v.haisman at sh.cvut.cz
Fri Jan 13 07:28:54 UTC 2012


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 copy)
> @@ -110,6 +110,7 @@
>  /* Flags for do_dup() */
>  #define DUP_FIXED	0x1	/* Force fixed allocation */
>  #define DUP_FCNTL	0x2	/* fcntl()-style errors */
> +#define DUP_CLOEXEC	0x4	/* Enable O_CLOEXEC on the new fs */
s/fs/fd/? -----------------------------------------------------^^

-- 
VZ



More information about the freebsd-hackers mailing list