Hash :
cfcb5fc6
Author :
Date :
2020-07-08T02:52:09
dup2: Remove support for some very old platforms. * m4/dup2-obsolete.m4: Remove file. * modules/dup2-obsolete: Remove file. * m4/dup2.m4 (gl_FUNC_DUP2): Assume module 'dup2-obsolete' is absent. Don't define HAVE_DUP2. * lib/unistd.in.h (dup2): Assume HAVE_DUP2 is 1. * lib/dup2.c: Likewise. * modules/dup2 (Depends-on, configure.ac): Likewise. (Depends-on): Remove dup2-obsolete. * m4/unistd_h.m4 (gl_UNISTD_H_DEFAULTS): Don't initialize HAVE_DUP2. * modules/unistd (Makefile.am): Don't substitute HAVE_DUP2. * doc/posix-functions/dup2.texi: Don't mention module 'dup2-obsolete'.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58
@node dup2
@section @code{dup2}
@findex dup2
POSIX specification:@* @url{https://pubs.opengroup.org/onlinepubs/9699919799/functions/dup2.html}
Gnulib module: dup2
Portability problems fixed by Gnulib:
@itemize
@item
This function is declared in a different header file (namely, @code{<io.h>})
on some platforms:
MSVC 14.
@item
This function always returns 0 for success on some platforms:
mingw, MSVC 14.
@item
This function can hang when duplicating an fd to itself on some platforms:
mingw, MSVC 14.
@item
This function crashes when invoked with invalid arguments on some platforms:
Cygwin 1.7.17, MSVC 14.
@item
This function crashes when invoked with valid arguments on some platforms:
Cygwin 1.7.25.
@item
This function fails with @code{EINVAL} when duplicating an fd to itself:
Android.
@item
This function resets the @code{FD_CLOEXEC} flag when duplicating an fd
to itself on some platforms:
Haiku.
@item
This function returns 0 for @code{dup2 (1, 1)} on some platforms:
Cygwin 1.5.x.
@item
This function may return @code{-EBADF} instead of @code{-1} on some platforms:
Linux releases between July 2008 and May 2009 (versions 2.6.27 to 2.6.29).
@item
This function returns @code{EMFILE} instead of @code{EBADF} for
large targets, which interferes with using
@code{dup2(fd,fd)==fd)} as the minimal @code{EBADF} filter:
AIX 7.1, FreeBSD 6.1, Cygwin 1.5.
@end itemize
Portability problems not fixed by Gnulib:
@itemize
@end itemize