diff options
author | Eric Blake <ebb9@byu.net> | 2009-11-05 15:13:00 -0700 |
---|---|---|
committer | Eric Blake <ebb9@byu.net> | 2009-11-05 20:41:20 -0700 |
commit | 004f708a5eaa7610a3eba7f4c74e279bf63fb9ce (patch) | |
tree | dcc2e47bad63b4b779147375a8ea8ec838e01131 /doc/posix-functions/freopen.texi | |
parent | 46b36899e091f58a96df1d64c145d6ccf392718d (diff) | |
download | gnulib-004f708a5eaa7610a3eba7f4c74e279bf63fb9ce.tar.gz |
freopen-safer: new module
* modules/freopen-safer: New module.
* m4/stdio-safer.m4 (gl_FREOPEN_SAFER): New macro.
* lib/freopen-safer.c (freopen_safer): New file.
* lib/stdio-safer.h (freopen_safer): New declaration.
* lib/stdio--.h (freopen): New override.
* MODULES.html.sh (File stream based Input/Output): Mention it.
* doc/posix-functions/freopen.texi (freopen): Mention pitfalls and
freopen-safer module.
* doc/posix-functions/stderr.texi (stderr): Likewise.
* doc/posix-functions/stdin.texi (stdin): Likewise.
* doc/posix-functions/stdout.texi (stdout): Likewise.
* modules/freopen-safer-tests: New test.
* tests/test-reopen-safer.c: New file.
Signed-off-by: Eric Blake <ebb9@byu.net>
Diffstat (limited to 'doc/posix-functions/freopen.texi')
-rw-r--r-- | doc/posix-functions/freopen.texi | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/doc/posix-functions/freopen.texi b/doc/posix-functions/freopen.texi index b446823a85..c8b60c2d9e 100644 --- a/doc/posix-functions/freopen.texi +++ b/doc/posix-functions/freopen.texi @@ -23,4 +23,9 @@ This function does not fail when the file name argument ends in a slash and (without the slash) names a nonexistent file or a file that is not a directory, on some platforms: HP-UX 11.00, Solaris 9, Irix 5.3. +@item +Applications should not assume that @code{fileno(f)} will be the same +before and after a call to @code{freopen(name,mode,f)}. However, the +module freopen-safer can at least protect @code{stdin}, @code{stdout}, +and @code{stderr}. @end itemize |