5 POSIX specification:@* @url{http://www.opengroup.org/onlinepubs/9699919799/functions/dup2.html}
7 Gnulib module: dup2 or dup2-obsolete
9 Portability problems fixed by either Gnulib module @code{dup2} or @code{dup2-obsolete}:
12 This function always returns 0 for success on some platforms:
16 This function can hang when duplicating an fd to itself on some platforms:
20 This function crashes when invoked with invalid arguments on some platforms:
21 Cygwin 1.7.17, MSVC 9.
24 This function crashes when invoked with valid arguments on some platforms:
28 This function fails with @code{EINVAL} when duplicating an fd to itself:
32 This function resets the @code{FD_CLOEXEC} flag when duplicating an fd
33 to itself on some platforms:
37 This function returns 0 for @code{dup2 (1, 1)} on some platforms:
41 This function may return @code{-EBADF} instead of @code{-1} on some platforms:
42 Linux releases between July 2008 and May 2009 (versions 2.6.27 to 2.6.29).
45 This function returns @code{EMFILE} instead of @code{EBADF} for
46 large targets, which interferes with using
47 @code{dup2(fd,fd)==fd)} as the minimal @code{EBADF} filter:
48 AIX 7.1, FreeBSD 6.1, Cygwin 1.5.
51 Portability problems fixed by Gnulib module @code{dup2-obsolete}:
54 This function is missing on some older platforms.
57 Portability problems not fixed by Gnulib: