Re: Writing to the hard disk, and checking for error to exit(1)?



matevzb wrote:
On Dec 13, 7:33 pm, Richard Heathfield <r...@xxxxxxxxxxxxxxx> wrote:
<snip>
Look up ferror(). Cf <stdio.h>

Also consider using EXIT_FAILURE instead of 1. Cf <stdlib.h>

There was (still is?) an issue with HPUX where fprintf() would block if
the disk got full, so this might not always work. Does this behaviour
conform to the Standard? I only found "The fprintf function returns the
number of characters transmitted, or a negative value if an output or
encoding error occurred."

It can conform to the standard. But then again, an implementation that
waits three days after each statement can also conform to the standard.

.



Relevant Pages

  • Re: I dont get how the computer arrives at 2^31
    ... > Standard isn't always as careful with the language it uses. ... something that will make its functionality "equivalent" to fprintf(). ... function that created the va_list value passed to vfprintf(). ... The reason is that, unless ...
    (comp.std.c)
  • Re: [Maybe OT] How to convince people about the importance of ANSI standards conformance ?
    ... > I am working on a legacy user space app, ... > partially conform to any standard. ... meaning the compiler and it's headers. ...
    (comp.lang.c)
  • Re: future C standards
    ... of the C standard, which is something that Jacob is free to choose to do. ... does not conform to any standard. ... there's nothing unusual about being surprised by bugs. ... It's the requirements that shouldn't surprise you. ...
    (comp.std.c)
  • Re: future C standards
    ... of the C standard, which is something that Jacob is free to choose to do. ... does not conform to any standard. ... fully conforming implementations of C99 are sufficiently rare that "nearly conforming" implementations are still to be valued. ... there's nothing unusual about being surprised by bugs. ...
    (comp.std.c)
  • Re: pointer one past malloc.ed memory
    ... Specifically, the compiler transforms: ... When not optimizing, the compiler ... to make this work (in Standard C). ... the system as a whole can still conform. ...
    (comp.lang.c)