public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* dup2() vs dup3() inconsistency when
@ 2008-10-09 12:10 Michael Kerrisk
  2008-10-09 17:21 ` H. Peter Anvin
  0 siblings, 1 reply; 18+ messages in thread
From: Michael Kerrisk @ 2008-10-09 12:10 UTC (permalink / raw)
  To: Al Viro; +Cc: Ulrich Drepper, LKML

Al,

your 2008-07-26 commit 6c5d0512a091480c9f981162227fdb1c9d70e555 for
fs/fcntl.c:sys_dup3 contains

+       if (unlikely(oldfd == newfd))
+               return -EINVAL;

This makes dup2() and dup3() differ with respect to the oldfd==newfd
case (dup2() becomes a no-op, just returning oldfd, dup3() gives the
EINVAL error.

Your commit log doesn't explain the rationale for this change.  What
is it?  (I could guess that it is to error on a case that may be a
user programming error, but I want to check this with you, so that I
add the right text to the man page.)

Cheers,

Michael


-- 
Michael Kerrisk
Linux man-pages maintainer; http://www.kernel.org/doc/man-pages/
git://git.kernel.org/pub/scm/docs/man-pages/man-pages.git
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] 18+ messages in thread
[parent not found: <bl2EV-7G2-9@gated-at.bofh.it>]

end of thread, other threads:[~2008-10-10 14:07 UTC | newest]

Thread overview: 18+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-10-09 12:10 dup2() vs dup3() inconsistency when Michael Kerrisk
2008-10-09 17:21 ` H. Peter Anvin
2008-10-09 20:31   ` Ulrich Drepper
2008-10-09 20:43     ` H. Peter Anvin
2008-10-09 20:52       ` Ulrich Drepper
2008-10-09 20:57         ` H. Peter Anvin
2008-10-09 21:04           ` Ulrich Drepper
2008-10-10  5:04           ` Michael Kerrisk
2008-10-10 12:09             ` Bernd Petrovitsch
2008-10-10 12:15               ` Michael Kerrisk
2008-10-10 13:02                 ` Bernd Petrovitsch
2008-10-10 13:15                   ` Michael Kerrisk
2008-10-10 13:31                     ` Bernd Petrovitsch
2008-10-10  5:01     ` Michael Kerrisk
2008-10-10 13:43     ` Heikki Orsila
     [not found] <bl2EV-7G2-9@gated-at.bofh.it>
     [not found] ` <bl7v3-5sk-17@gated-at.bofh.it>
     [not found]   ` <blasN-OS-9@gated-at.bofh.it>
     [not found]     ` <blaCu-Z0-11@gated-at.bofh.it>
     [not found]       ` <blaMj-18o-23@gated-at.bofh.it>
     [not found]         ` <blaMj-18o-21@gated-at.bofh.it>
     [not found]           ` <bliqg-2DH-1@gated-at.bofh.it>
2008-10-10 11:42             ` Bodo Eggert
2008-10-10 11:59               ` Michael Kerrisk
2008-10-10 13:19                 ` Bodo Eggert

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