diff options
author | Paul Eggert <eggert@cs.ucla.edu> | 2016-11-26 14:53:29 -0800 |
---|---|---|
committer | Paul Eggert <eggert@cs.ucla.edu> | 2016-11-26 14:54:38 -0800 |
commit | b947d0524d64b5a139282fd48caa7a866e20513c (patch) | |
tree | 4719c46b1cefe2f15e1f1fd23fac8d09c091f112 /doc/posix-functions/freopen.texi | |
parent | 0a2d091427da29e9d956b108801cdfdc27713a09 (diff) | |
download | gnulib-b947d0524d64b5a139282fd48caa7a866e20513c.tar.gz |
freopen: work around glibc bug with closed fd
Work around glibc bug#15589, where freopen mishandles the case
where stdin etc. are already closed.
* doc/posix-functions/freopen.texi (freopen): Document the bug.
* lib/freopen.c (_GL_ALREADY_INCLUDING_STDIO_H): Define this
instead of __need_FILE, as the latter does not work with glibc.
Include <fcntl.h>, for open flags.
(rpl_freopen): Work around glibc bug.
* m4/freopen.m4 (gl_FUNC_FREOPEN): Check for bug.
* modules/freopen (Depends-on): Add fcntl-h.
* tests/test-freopen.c (main): Test for bug.
Diffstat (limited to 'doc/posix-functions/freopen.texi')
-rw-r--r-- | doc/posix-functions/freopen.texi | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/doc/posix-functions/freopen.texi b/doc/posix-functions/freopen.texi index d14c3e1e05..f79a05aefc 100644 --- a/doc/posix-functions/freopen.texi +++ b/doc/posix-functions/freopen.texi @@ -9,6 +9,10 @@ Gnulib module: freopen Portability problems fixed by Gnulib: @itemize @item +On some platforms, if @code{stream} does not already have an open +file descriptor, @code{freopen} returns the stream without opening +the file: glibc 2.24. +@item On platforms where @code{off_t} is a 32-bit type, @code{freopen} may not work correctly with files larger than 2 GB. (Cf. @code{AC_SYS_LARGEFILE}.) @item |