From mboxrd@z Thu Jan 1 00:00:00 1970 From: Andreas Schwab To: libc-hacker@sourceware.cygnus.com (GNU C Library) Subject: Re: [Gurusamy Sarathy ] ferror() after fread() on a FILE* opened for write Date: Wed, 21 Jul 1999 09:53:00 -0000 Message-id: References: <19990721150806.B4B9D57BA@ocean.lucon.org> X-SW-Source: 1999-07/msg00077.html Andreas Jaeger writes: |> >>>>> Ulrich Drepper writes: |> |> Uli> hjl@lucon.org (H.J. Lu) writes: |> >> This patch should pass the test. The problem is _IO_file_xsgetn |> >> and _IO_XXX_file_xsputn may call read/write directly. |> |> Uli> This is not necessary. Don't add it. |> |> Are you sure? Check the current Posix draft of the Austin Group for |> fread/fgetc and fwrite/fputc. They explicitly mention EBADF for: |> |> The filedescriptor underlying stream is not a valid file descriptor |> open for reading (writing with fwrite/fputc). If you use std{in,out,err} then the underlying fd _is_ valid for both read and write (until you change that with freopen). Andreas. -- Andreas Schwab "And now for something schwab@suse.de completely different." SuSE GmbH, Schanzäckerstr. 10, D-90443 Nürnberg