public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* No NONBLOCK flag for dup3() or epoll_create1()?
@ 2008-08-20 16:49 Michael Kerrisk
  2008-08-24 19:35 ` Davide Libenzi
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: Michael Kerrisk @ 2008-08-20 16:49 UTC (permalink / raw)
  To: Ulrich Drepper; +Cc: Andrew Morton, Al Viro, lkml, Davide Libenzi

Ulrich

I've been doing some testing (2.6.27-rc3) of your new
file-descriptor-creating syscalls that accept flags.  According to

http://udrepper.livejournal.com/20407.html

all of the system calls should accept a *_NONBLOCK flag.  All of them do,
except for two:
dup3(olfd, newfd, flags)
and
epoll_create1(flags).

For epoll_create1() this certainly appears to be an oversight, since I can't
think of a reason not to support *_NONBLOCK.

For dup3() it is perhaps also an oversight.  However, it's not really clear
to me whether supporting O_NONBLOCK makes sense, since that would change the
file status flags of the open file description that is (also) referred to by
oldfd.  (Furthermore, given a open file description for which O_NONBLOCK is
already enabled, it is not possible to make a dup3() call that disables
O_NONBLOCK, which is an odd asymmetry in the API.)  What are your thoughts on
this?

Cheers,

Michael


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: No NONBLOCK flag for dup3() or epoll_create1()?
  2008-08-20 16:49 No NONBLOCK flag for dup3() or epoll_create1()? Michael Kerrisk
@ 2008-08-24 19:35 ` Davide Libenzi
  2008-08-29 20:44 ` Michael Kerrisk
  2008-09-02  0:34 ` Ulrich Drepper
  2 siblings, 0 replies; 6+ messages in thread
From: Davide Libenzi @ 2008-08-24 19:35 UTC (permalink / raw)
  To: Michael Kerrisk; +Cc: Ulrich Drepper, Andrew Morton, Al Viro, lkml

On Wed, 20 Aug 2008, Michael Kerrisk wrote:

> Ulrich
> 
> I've been doing some testing (2.6.27-rc3) of your new
> file-descriptor-creating syscalls that accept flags.  According to
> 
> http://udrepper.livejournal.com/20407.html
> 
> all of the system calls should accept a *_NONBLOCK flag.  All of them do,
> except for two:
> dup3(olfd, newfd, flags)
> and
> epoll_create1(flags).
> 
> For epoll_create1() this certainly appears to be an oversight, since I can't
> think of a reason not to support *_NONBLOCK.

Traditionally the no-wait epoll_wait() has been achieved with a zero 
timeout, but _NONBLOCK support can be easily added if seen as necessary.



- Davide



^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: No NONBLOCK flag for dup3() or epoll_create1()?
  2008-08-20 16:49 No NONBLOCK flag for dup3() or epoll_create1()? Michael Kerrisk
  2008-08-24 19:35 ` Davide Libenzi
@ 2008-08-29 20:44 ` Michael Kerrisk
  2008-09-02  0:34 ` Ulrich Drepper
  2 siblings, 0 replies; 6+ messages in thread
From: Michael Kerrisk @ 2008-08-29 20:44 UTC (permalink / raw)
  To: Ulrich Drepper; +Cc: Andrew Morton, Al Viro, lkml, Davide Libenzi

Ping!

On Wed, Aug 20, 2008 at 6:49 PM, Michael Kerrisk
<mtk.manpages@googlemail.com> wrote:
> Ulrich
>
> I've been doing some testing (2.6.27-rc3) of your new
> file-descriptor-creating syscalls that accept flags.  According to
>
> http://udrepper.livejournal.com/20407.html
>
> all of the system calls should accept a *_NONBLOCK flag.  All of them do,
> except for two:
> dup3(olfd, newfd, flags)
> and
> epoll_create1(flags).
>
> For epoll_create1() this certainly appears to be an oversight, since I can't
> think of a reason not to support *_NONBLOCK.
>
> For dup3() it is perhaps also an oversight.  However, it's not really clear
> to me whether supporting O_NONBLOCK makes sense, since that would change the
> file status flags of the open file description that is (also) referred to by
> oldfd.  (Furthermore, given a open file description for which O_NONBLOCK is
> already enabled, it is not possible to make a dup3() call that disables
> O_NONBLOCK, which is an odd asymmetry in the API.)  What are your thoughts
> on
> this?
>
> Cheers,
>
> Michael
>
>



-- 
Michael Kerrisk
Linux man-pages maintainer; http://www.kernel.org/doc/man-pages/
man-pages online: http://www.kernel.org/doc/man-pages/online_pages.html
Found a bug? http://www.kernel.org/doc/man-pages/reporting_bugs.html

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: No NONBLOCK flag for dup3() or epoll_create1()?
  2008-08-20 16:49 No NONBLOCK flag for dup3() or epoll_create1()? Michael Kerrisk
  2008-08-24 19:35 ` Davide Libenzi
  2008-08-29 20:44 ` Michael Kerrisk
@ 2008-09-02  0:34 ` Ulrich Drepper
  2008-09-02  5:06   ` Michael Kerrisk
  2008-09-02  5:07   ` Michael Kerrisk
  2 siblings, 2 replies; 6+ messages in thread
From: Ulrich Drepper @ 2008-09-02  0:34 UTC (permalink / raw)
  To: Michael Kerrisk
  Cc: Ulrich Drepper, Andrew Morton, Al Viro, lkml, Davide Libenzi

On Wed, Aug 20, 2008 at 9:49 AM, Michael Kerrisk
<mtk.manpages@googlemail.com> wrote:
> I've been doing some testing (2.6.27-rc3) of your new
> file-descriptor-creating syscalls that accept flags.  According to
>
> http://udrepper.livejournal.com/20407.html
>
> all of the system calls should accept a *_NONBLOCK flag.

This was never the intention.


> For epoll_create1() this certainly appears to be an oversight, since I can't
> think of a reason not to support *_NONBLOCK.

I can.  There is already a method to not block (zero timeout).  We
should not provide multiple ways to get the same functionality.  It
would require changes in the epoll code as well.  That's not worth it.


>  (Furthermore, given a open file description for which O_NONBLOCK is
> already enabled, it is not possible to make a dup3() call that disables
> O_NONBLOCK, which is an odd asymmetry in the API.)

That's why I didn't add support for the flag.  It's hardly useful to
add this support.

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: No NONBLOCK flag for dup3() or epoll_create1()?
  2008-09-02  0:34 ` Ulrich Drepper
@ 2008-09-02  5:06   ` Michael Kerrisk
  2008-09-02  5:07   ` Michael Kerrisk
  1 sibling, 0 replies; 6+ messages in thread
From: Michael Kerrisk @ 2008-09-02  5:06 UTC (permalink / raw)
  To: Ulrich Drepper
  Cc: Ulrich Drepper, Andrew Morton, Al Viro, lkml, Davide Libenzi

On Mon, Sep 1, 2008 at 5:34 PM, Ulrich Drepper <drepper@gmail.com> wrote:
> On Wed, Aug 20, 2008 at 9:49 AM, Michael Kerrisk
> <mtk.manpages@googlemail.com> wrote:
>> I've been doing some testing (2.6.27-rc3) of your new
>> file-descriptor-creating syscalls that accept flags.  According to
>>
>> http://udrepper.livejournal.com/20407.html
>>
>> all of the system calls should accept a *_NONBLOCK flag.
>
> This was never the intention.

All of the below makes some sense, but is at odds with what you posted
on your blog entry, which documents *_NONBLOCK for both
epoll_create1() and dup3().  Thus, I needed to check with you since
the "intention" stated in the blog post differs from the actual
implementation.

>> For epoll_create1() this certainly appears to be an oversight, since I can't
>> think of a reason not to support *_NONBLOCK.
>
> I can.  There is already a method to not block (zero timeout).  We
> should not provide multiple ways to get the same functionality.

Though, one reason to do so would be consistency with the other
changed APIs.  (There are many cases where *ix API provides more than
one way of getting the same functionality.)

> It
> would require changes in the epoll code as well.  That's not worth it.
>
>
>>  (Furthermore, given a open file description for which O_NONBLOCK is
>> already enabled, it is not possible to make a dup3() call that disables
>> O_NONBLOCK, which is an odd asymmetry in the API.)
>
> That's why I didn't add support for the flag.  It's hardly useful to
> add this support.

Cheers,

Michael


-- 
Michael Kerrisk
Linux man-pages maintainer; http://www.kernel.org/doc/man-pages/
man-pages online: http://www.kernel.org/doc/man-pages/online_pages.html
Found a bug? http://www.kernel.org/doc/man-pages/reporting_bugs.html

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: No NONBLOCK flag for dup3() or epoll_create1()?
  2008-09-02  0:34 ` Ulrich Drepper
  2008-09-02  5:06   ` Michael Kerrisk
@ 2008-09-02  5:07   ` Michael Kerrisk
  1 sibling, 0 replies; 6+ messages in thread
From: Michael Kerrisk @ 2008-09-02  5:07 UTC (permalink / raw)
  To: Ulrich Drepper
  Cc: Ulrich Drepper, Andrew Morton, Al Viro, lkml, Davide Libenzi

On Mon, Sep 1, 2008 at 5:34 PM, Ulrich Drepper <drepper@gmail.com> wrote:
> On Wed, Aug 20, 2008 at 9:49 AM, Michael Kerrisk
> <mtk.manpages@googlemail.com> wrote:
>> I've been doing some testing (2.6.27-rc3) of your new
>> file-descriptor-creating syscalls that accept flags.  According to
>>
>> http://udrepper.livejournal.com/20407.html
>>
>> all of the system calls should accept a *_NONBLOCK flag.
>
> This was never the intention.

All of the below makes some sense, but is at odds with what you posted
on your blog entry, which documents *_NONBLOCK for both
epoll_create1() and dup3().  Thus, I needed to check with you since
the "intention" stated in the blog post differs from the actual
implementation.

>> For epoll_create1() this certainly appears to be an oversight, since I can't
>> think of a reason not to support *_NONBLOCK.
>
> I can.  There is already a method to not block (zero timeout).  We
> should not provide multiple ways to get the same functionality.

Though, one reason to do so would be consistency with the other
changed APIs.  (There are many cases where *ix API provides more than
one way of getting the same functionality.)

> It
> would require changes in the epoll code as well.  That's not worth it.
>
>
>>  (Furthermore, given a open file description for which O_NONBLOCK is
>> already enabled, it is not possible to make a dup3() call that disables
>> O_NONBLOCK, which is an odd asymmetry in the API.)
>
> That's why I didn't add support for the flag.  It's hardly useful to
> add this support.

Cheers,

Michael


-- 
Michael Kerrisk
Linux man-pages maintainer; http://www.kernel.org/doc/man-pages/
man-pages online: http://www.kernel.org/doc/man-pages/online_pages.html
Found a bug? http://www.kernel.org/doc/man-pages/reporting_bugs.html

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2008-09-02  5:07 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-08-20 16:49 No NONBLOCK flag for dup3() or epoll_create1()? Michael Kerrisk
2008-08-24 19:35 ` Davide Libenzi
2008-08-29 20:44 ` Michael Kerrisk
2008-09-02  0:34 ` Ulrich Drepper
2008-09-02  5:06   ` Michael Kerrisk
2008-09-02  5:07   ` Michael Kerrisk

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox