Hash :
b5b8e4ac
Author :
Date :
2009-10-09T21:28:40
dup2: work around FreeBSD 6.1 bug dup2(1,1000000) needs to fail with EBADF (per POSIX), not EMFILE, based on our usage of it in other modules. * m4/dup2.m4 (gl_FUNC_DUP2): Detect bug. * doc/posix-functions/dup2.texi (dup2): Document it. Reported by Nelson H. F. Beebe and Jim Meyering. Signed-off-by: Eric Blake <ebb9@byu.net>
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
@node dup2
@section @code{dup2}
@findex dup2
POSIX specification: @url{http://www.opengroup.org/onlinepubs/9699919799/functions/dup2.html}
Gnulib module: dup2
Portability problems fixed by Gnulib:
@itemize
@item
This function always returns 0 for success on some platforms:
mingw.
@item
This function can hang when duplicating an fd to itself on some platforms:
mingw.
@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
extremely large targets, which interferes with using
@code{dup2(fd,fd)==fd)} as the minimal @code{EBADF} filter:
FreeBSD 6.1, Cygwin 1.5.
@item
This function is missing on some older platforms.
@end itemize
Portability problems not fixed by Gnulib:
@itemize
@end itemize