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