SusV2 and POSIX seem to have changed the prior standard
The value returned may be less than nbyte if the number of bytes
left in the file is less than nbyte, if the read() request was
interrupted by a signal, or if the file is a pipe or FIFO or
special file and has fewer than nbyte bytes immediately available
for reading.
The rationale mentions that
while( read(...) > 0)
must work
but, I think Linus is correct that many programs rely on
while( read(fd,&b,n) == n)
------------------susv2
If a read() is interrupted by a signal before it reads any data, it
will return -1 with errno set to [EINTR].
If a read() is interrupted by a signal after it has successfully
read some data, it will return the number of bytes read.
----------------------
The grim effects of "cancel" spread through the system.
-------------------------------------
The transitive closure of a design error is limited only by the size of
the program.
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/