This is the mail archive of the libc-alpha@sourceware.cygnus.com mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: [Keith Owens <kaos@ocs.com.au>] libc/1174: stdio without SA_RESTART loses output


> I don't think anything but I have to verify this.  The code causing
> this behaviour was introduced because of a POSIX conformance
> test. This required that it is possible to interrupt a blocking fwrite
> using a signal (e.g., SIGALRM).

Please explain what you mean by "interrupt a blocking fwrite".  POSIX says
that fwrite must propagate the result of the underlying function write, and
that when it writes less than the full amount it must set the error
indicator (ferror).  So I would say that when write returns a short write
count because of being interrupted by a signal, fwrite should return an
appropriate short write count after setting the error indicator.  The
application can then respond appropriately (as it would if it called write
and got a short write count).

(Most applications, of course, will just want to use SA_RESTART to avoid
all this nonsense.)

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]