[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <4B7C25B3.5010206@cea.fr>
Date: Wed, 17 Feb 2010 18:21:55 +0100
From: THIELL Stephane <stephane.thiell@....fr>
To: Davide Libenzi <davidel@...ilserver.org>
CC: Eric Dumazet <eric.dumazet@...il.com>,
Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
Andrew Morton <akpm@...ux-foundation.org>
Subject: Re: [patch/rfc] Make poll/select report error (POLLNVAL and EBADF)
for unsupported files
> On Mon, 15 Feb 2010, Eric Dumazet wrote:
>
>
>> Hmm, according to POSIX :
>>
>> The poll() function shall support regular files, terminal and
>> pseudo-terminal devices, FIFOs, pipes, sockets ...
>>
>> Regular files shall always poll TRUE for reading and writing.
>>
>>
As POSIX says poll(2) have to support regular files (and it seems all
possible user file descriptors), then wouldn't it be better/more
coherent to have epoll(7) behave the same way (ie. support regular files
instead of epoll_ctl(2) returning EPERM), in order to allow generic code
handling both very common situations like:
$ cat replay_file | application
and
$ application < replay_file
...where for instance the application doesn't know the origine of its fd 0 (pipe, file, or something else).
Regards,
Stephane Thiell
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists