Bug 91931
Summary: | fflush(3) is misleading about input streams | ||
---|---|---|---|
Product: | Documentation | Reporter: | cubbi |
Component: | man-pages | Assignee: | documentation_man-pages (documentation_man-pages) |
Status: | RESOLVED CODE_FIX | ||
Severity: | normal | CC: | mtk.manpages |
Priority: | P1 | ||
Hardware: | All | ||
OS: | Linux | ||
Kernel Version: | Subsystem: | ||
Regression: | No | Bisected commit-id: |
Description
cubbi
2015-01-23 16:15:25 UTC
Thanks for the report. I think you are more or less right. One question though: should the text not be in terms of "block buffered stream" rather than "seekable device"? Thanks, Michael I don't see how buffering strategy would be relevant: it calls lseek(2) the same way whether the streams are setvbuf'd line-buffered or block-buffered. POSIX wording is simply "the file is one capable of seeking" (In reply to cubbi from comment #0) > On a very minor note, fflush(3) also claims that > "The standards do not specify the behavior for input streams" > > This is no longer precisely correct; POSIX specifies behavior for seekable > input streams to move fileno's offset to match FILE's offset and undo all > ungetc's: > http://pubs.opengroup.org/onlinepubs/9699919799/functions/fflush.html and > glibc conforms to that (or tries to, > https://sourceware.org/bugzilla/show_bug.cgi?id=5994 is still open) Thanks. I modified the text to note that POSIX.1-2008 does add specification for input streams. |