Eric Blake wrote: > we also need to > tweak the O_NOINHERIT flag of an existing fd without having to use dup in > cloexec.c (I'm hoping the windows functions GetHandleInformation and > SetHandleInformation work here).
I don't see how to make it work without a lot of dup() calls and without assuming that O_APPEND is not being used. > pipe2, dup3, accept4, mkostemp - GNU/Linux extensions - New modules to > match recent glibc extensions around the recently added syscalls on Linux > for passing O_CLOEXEC (or O_NONBLOCK) via the flag argument. With these functions, we can work around the impossibility of fcntl F_SETFD on mingw. As a starter, let me add some dummy documentation about these functions. 2009-08-22 Bruno Haible <[email protected]> Reference some new glibc functions. * doc/glibc-functions/accept4.texi: New file. * doc/glibc-functions/dup3.texi: New file. * doc/glibc-functions/mkostemp.texi: New file. * doc/glibc-functions/pipe2.texi: New file. * doc/gnulib.texi (Glibc stdlib.h): Refer to mkostemp. (Glibc sys/socket.h): Refer to accept4. (Glibc unistd.h): Refer to dup3, pipe2. Reported by Eric Blake. Changing permissions from . to 100644 --- doc/glibc-functions/accept4.texi.orig 2008-06-06 22:36:48.000000000 +0200 +++ doc/glibc-functions/accept4.texi 2009-08-22 15:18:45.000000000 +0200 @@ -0,0 +1,16 @@ +...@node accept4 +...@subsection @code{accept4} +...@findex accept4 + +Gnulib module: --- + +Portability problems fixed by Gnulib: +...@itemize +...@end itemize + +Portability problems not fixed by Gnulib: +...@itemize +...@item +This function is missing on all non-glibc platforms: +MacOS X 10.3, FreeBSD 6.0, NetBSD 3.0, OpenBSD 3.8, AIX 5.1, HP-UX 11, IRIX 6.5, OSF/1 5.1, Solaris 10, Cygwin, mingw, Interix 3.5, BeOS. +...@end itemize Changing permissions from . to 100644 --- doc/glibc-functions/dup3.texi.orig 2008-06-06 22:36:48.000000000 +0200 +++ doc/glibc-functions/dup3.texi 2009-08-22 14:53:56.000000000 +0200 @@ -0,0 +1,16 @@ +...@node dup3 +...@subsection @code{dup3} +...@findex dup3 + +Gnulib module: --- + +Portability problems fixed by Gnulib: +...@itemize +...@end itemize + +Portability problems not fixed by Gnulib: +...@itemize +...@item +This function is missing on all non-glibc platforms: +MacOS X 10.3, FreeBSD 6.0, NetBSD 3.0, OpenBSD 3.8, AIX 5.1, HP-UX 11, IRIX 6.5, OSF/1 5.1, Solaris 10, Cygwin, mingw, Interix 3.5, BeOS. +...@end itemize Changing permissions from . to 100644 --- doc/glibc-functions/mkostemp.texi.orig 2008-06-06 22:36:48.000000000 +0200 +++ doc/glibc-functions/mkostemp.texi 2009-08-22 15:18:56.000000000 +0200 @@ -0,0 +1,16 @@ +...@node mkostemp +...@subsection @code{mkostemp} +...@findex mkostemp + +Gnulib module: --- + +Portability problems fixed by Gnulib: +...@itemize +...@end itemize + +Portability problems not fixed by Gnulib: +...@itemize +...@item +This function is missing on all non-glibc platforms: +MacOS X 10.3, FreeBSD 6.0, NetBSD 3.0, OpenBSD 3.8, AIX 5.1, HP-UX 11, IRIX 6.5, OSF/1 5.1, Solaris 10, Cygwin, mingw, Interix 3.5, BeOS. +...@end itemize Changing permissions from . to 100644 --- doc/glibc-functions/pipe2.texi.orig 2008-06-06 22:36:48.000000000 +0200 +++ doc/glibc-functions/pipe2.texi 2009-08-22 14:54:04.000000000 +0200 @@ -0,0 +1,16 @@ +...@node pipe2 +...@subsection @code{pipe2} +...@findex pipe2 + +Gnulib module: --- + +Portability problems fixed by Gnulib: +...@itemize +...@end itemize + +Portability problems not fixed by Gnulib: +...@itemize +...@item +This function is missing on all non-glibc platforms: +MacOS X 10.3, FreeBSD 6.0, NetBSD 3.0, OpenBSD 3.8, AIX 5.1, HP-UX 11, IRIX 6.5, OSF/1 5.1, Solaris 10, Cygwin, mingw, Interix 3.5, BeOS. +...@end itemize --- doc/gnulib.texi.orig 2009-08-22 15:24:43.000000000 +0200 +++ doc/gnulib.texi 2009-08-22 15:20:28.000000000 +0200 @@ -5063,6 +5063,7 @@ * jrand48_r:: * lcong48_r:: * lrand48_r:: +* mkostemp:: * mrand48_r:: * nrand48_r:: * on_exit:: @@ -5103,6 +5104,7 @@ @include glibc-functions/jrand48_r.texi @include glibc-functions/lcong48_r.texi @include glibc-functions/lrand48_r.texi +...@include glibc-functions/mkostemp.texi @include glibc-functions/mrand48_r.texi @include glibc-functions/nrand48_r.texi @include glibc-functions/on_exit.texi @@ -5370,9 +5372,11 @@ @section Glibc Extensions to @code{<sys/socket.h>} @menu +* accept4:: * isfdtype:: @end menu +...@include glibc-functions/accept4.texi @include glibc-functions/isfdtype.texi @node Glibc sys/stat.h @@ -5655,6 +5659,7 @@ * brk:: * chroot:: * daemon:: +* dup3:: * endusershell:: * euidaccess:: * get_current_dir_name:: @@ -5666,6 +5671,7 @@ * getresuid:: * getusershell:: * group_member:: +* pipe2:: * profil:: * revoke:: * sbrk:: @@ -5685,6 +5691,7 @@ @include glibc-functions/brk.texi @include glibc-functions/chroot.texi @include glibc-functions/daemon.texi +...@include glibc-functions/dup3.texi @include glibc-functions/endusershell.texi @include glibc-functions/euidaccess.texi @include glibc-functions/get_current_dir_name.texi @@ -5696,6 +5703,7 @@ @include glibc-functions/getresuid.texi @include glibc-functions/getusershell.texi @include glibc-functions/group_member.texi +...@include glibc-functions/pipe2.texi @include glibc-functions/profil.texi @include glibc-functions/revoke.texi @include glibc-functions/sbrk.texi
