public inbox for glibc-bugs@sourceware.org help / color / mirror / Atom feed
From: "eblake at redhat dot com" <sourceware-bugzilla@sourceware.org> To: glibc-bugs@sourceware.org Subject: [Bug stdio/12724] fclose violates POSIX 2008 on seekable input streams Date: Fri, 17 Jan 2014 22:10:00 -0000 [thread overview] Message-ID: <bug-12724-131-CPQbcLokdf@http.sourceware.org/bugzilla/> (raw) In-Reply-To: <bug-12724-131@http.sourceware.org/bugzilla/> https://sourceware.org/bugzilla/show_bug.cgi?id=12724 --- Comment #7 from Eric Blake <eblake at redhat dot com> --- Intuitively, glibc is broken as long as: $ seq 3 > file $ { sed -n 1q; sed -n 1q; cat; } < file has incorrect output. On Solaris, where fclose (and fflush(NULL) and exit()) correctly sync the seekable position of the FILE* back to the underyling fd, the above test has the POSIX-mandated behavior of acting like 'tail -n+3 file'. [It is possible to use gnulib's 'close-stdin' module to make 'sed' work around glibc's bug, and in fact, coreutils already does so for all of its programs which use stdin without reading to EOF; but we shouldn't have to work around the bug in every single program that reads partial input from stdin when we can instead fix it completely by fixing glibc] -- You are receiving this mail because: You are on the CC list for the bug.
next prev parent reply other threads:[~2014-01-17 22:10 UTC|newest] Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top 2011-05-02 20:21 [Bug libc/12724] New: " eblake at redhat dot com 2011-05-14 1:11 ` [Bug libc/12724] " drepper.fsp at gmail dot com 2011-07-27 17:34 ` eblake at redhat dot com 2011-08-12 15:31 ` matz at suse dot de 2011-09-23 1:30 ` vapier at gentoo dot org 2012-02-21 2:39 ` [Bug stdio/12724] " jsm28 at gcc dot gnu.org 2012-07-03 5:24 ` vapier at gentoo dot org 2012-11-29 15:19 ` carlos_odonell at mentor dot com 2012-12-01 19:56 ` carlos_odonell at mentor dot com 2012-12-03 23:57 ` carlos at systemhalted dot org 2012-12-11 11:48 ` hannes at stressinduktion dot org 2014-01-17 22:06 ` eblake at redhat dot com 2014-01-17 22:10 ` eblake at redhat dot com [this message] 2014-01-17 23:11 ` joseph at codesourcery dot com 2014-06-27 13:27 ` fweimer at redhat dot com 2020-04-14 0:18 ` eblake at redhat dot com 2020-04-14 0:19 ` eblake at redhat dot com
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=bug-12724-131-CPQbcLokdf@http.sourceware.org/bugzilla/ \ --to=sourceware-bugzilla@sourceware.org \ --cc=glibc-bugs@sourceware.org \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).