-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 According to Vincent Lefevre on 3/7/2008 6:02 AM: | On 2008-03-06 22:58:16 -0700, Eric Blake wrote: | [HP-UX 11] |> | When reading from the pipe: |> | c = '#' |> | c = 'i' |> | ungetc result = '@' |> | c = <EOF> |> | c = <EOF> |> |> Bug. C99 is quite clear that implementations shall provide at least |> one byte of ungetc buffering for all streams, and that it cannot |> fail if there was a prior fgetc. | | As far as C99 is concerned, there is no bug: fflush() on an input | stream is an undefined behavior. So, anything can occur.
I stand corrected in this instance. Even in POSIX, fflush on a non-seekable input stream is undefined (it is only fflush on seekable input that was given definition by POSIX). POSIX is also explicit that when sharing a file description between two processes, the behavior is undefined if both read data from that pipe. But my questions about fflush on seekable input streams after ungetc still remain. - -- Don't work too hard, make some time for fun as well! Eric Blake [EMAIL PROTECTED] -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.5 (Cygwin) Comment: Public key at home.comcast.net/~ericblake/eblake.gpg Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFH0T+l84KuGfSFAYARArHoAJwIPHw/SZVlojKauz6hmVIZssKDhACfe18u aaSPqKShLpoUA3HI7gn7zzY= =Ccdi -----END PGP SIGNATURE-----