On Tue, 2012-10-16 at 23:40 +0200, Samuel Thibault wrote: > Hello, > > Svante Signell, le Fri 24 Aug 2012 04:52:15 +0200, a écrit : > > - file descriptors were read, sorted, and the good ones registered. > > I have to say I don't understand why doing it. If there is any file > descriptor which is not valid, the whole call has to return EBADF, > that's what POSIX asks.
According to POSIX that is correct for select(). However, I think you missed the line below in my message: Note: Only for the poll case, select was not yet implemented! And there POSIX says: The poll() function shall support regular files, terminal and pseudo-terminal devices, FIFOs, pipes, sockets and [XSR] [Option Start] STREAMS-based files. [Option End] The behavior of poll() on elements of fds that refer to other types of file is unspecified. and RETURN VALUE Upon successful completion, poll() shall return a non-negative value. A positive value indicates the total number of file descriptors that have been selected (that is, file descriptors for which the revents member is non-zero).