[Gurusamy Sarathy <gsar@activestate.com>] ferror() after fread() on a FILE* opened for write

Andreas Jaeger aj@arthur.rhein-neckar.de
Wed Jul 21 09:45:00 GMT 1999


>>>>> 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).

But this is marked as a new addition.

Andreas
-- 
 Andreas Jaeger   aj@arthur.rhein-neckar.de    jaeger@informatik.uni-kl.de
  for pgp-key finger ajaeger@aixd1.rhrk.uni-kl.de


More information about the Libc-hacker mailing list