On 19.03.2012 19:41, Seima wrote:
> Hi,
>
> Does C99 strictly require blocking I/O?
This is a strange way to ask the question. C99 strictly
requires the presence of functions like fread and fwrite that,
when given a buffer, a number of elements and element sizes, read or
write these elements to a FILE. This implies that when the functions
return the FILE somehow logically reflects these changes, and, when
reading, the input buffer is updated. In reality, a write will usually
go to a buffer first and hence will not block unnecessary, and a read
will read from a buffer and will not block unnecessary. However, such
changes will reflect in an update of internal structures that provide a
consistent view on the FILE.
What C99 does not have to offer are functions that request and IO
operation and return *before* any logical change has made to the file,
and/or before the buffer has been updated or used. POSIX does, though by
slightly different mechanisms.
> Can readers of this forum point to the section
> in the C99 specification which state the rules
> regarding I/O?
Has already been answered.