PATCH: linux-generic dup2 behaviour
Arnd Bergmann
arnd@arndb.de
Wed Sep 14 13:13:00 GMT 2011
On Wednesday 14 September 2011, Roland McGrath wrote:
> Frankly the kernel behavior in that case seems anti-useful to me. It's
> clear that it was explicitly intended, but I don't know the rationale.
> Perhaps you can find some LKML discussion from the time dup3 was
> introduced, or raise the subject there to get some clarification.
FWIW, the current dup3 behavior was introduced in a patch "[PATCH] get rid
of corner case in dup3() entirely" that you can find at
http://www.kerneltrap.com/mailarchive/git-commits-head/2008/7/27/2701254
The original dup3 patch shortly before that had the current CLOEXEC
semantics, but was handling dup3(fd,fd,0) just like dup2(fd,fd):
http://www.kerneltrap.com/mailarchive/linux-netdev/2008/5/6/1745254
Arnd
More information about the Libc-ports
mailing list