poll tests: Avoid test failure on BSD and Solaris systems.
[gnulib.git] / doc / posix-functions / freopen.texi
blob4b6cd8b13b75a3bd8ff1038f1a8bd49597ddd514
1 @node freopen
2 @section @code{freopen}
3 @findex freopen
5 POSIX specification:@* @url{https://pubs.opengroup.org/onlinepubs/9699919799/functions/freopen.html}
7 Gnulib module: freopen
9 Portability problems fixed by Gnulib:
10 @itemize
11 @item
12 On some platforms, if @code{stream} does not already have an open
13 file descriptor, @code{freopen} returns the stream without opening
14 the file: glibc 2.24.
15 @item
16 On platforms where @code{off_t} is a 32-bit type, @code{freopen} may not work
17 correctly with files larger than 2 GB@.  (Cf. @code{AC_SYS_LARGEFILE}.)
18 @item
19 On Windows platforms (excluding Cygwin), this function does usually not
20 recognize the @file{/dev/null} filename.
21 @end itemize
23 Portability problems not fixed by Gnulib:
24 @itemize
25 @item
26 On Windows platforms (excluding Cygwin), this function does not set @code{errno}
27 upon failure.
28 @item
29 This function does not support a @code{NULL} file name argument on some
30 platforms:
31 OpenBSD 4.9, AIX 7.1, HP-UX 11.23, IRIX 6.5, Solaris 10, mingw, MSVC 14.
32 @item
33 This function does not fail when the file name argument ends in a slash
34 and (without the slash) names a nonexistent file or a file that is not a
35 directory, on some platforms:
36 HP-UX 11.00, Solaris 9.
37 @item
38 Applications should not assume that @code{fileno(f)} will be the same
39 before and after a call to @code{freopen(name,mode,f)}.  However, the
40 module @code{freopen-safer} can at least protect @code{stdin}, @code{stdout},
41 and @code{stderr}.
42 @end itemize