Re: manipulating sigmask from filesystems and drivers

Date: Fri Aug 02 2002 - 10:59:37 EST

On Thu, Aug 01, 2002 at 03:40:56PM -0700, Linus Torvalds wrote:
> On Thu, 1 Aug 2002, David Woodhouse wrote:
> >
> > said:
> > > Any regular file IO is supposed to give you the full result.
> >
> > read(2) is permitted to return -EINTR.
> It is _not_ allowed to do that for regular UNIX filesystems.

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)


     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
More majordomo info at
Please read the FAQ at

This archive was generated by hypermail 2b29 : Wed Aug 07 2002 - 22:00:19 EST