syscall: make linux Dup2 match other systems

You could argue for changing all the others, but
Linux is outvoted, and the only time it matters
is when newfd==-1, in which case you can call Dup.

R=golang-dev, r
CC=golang-dev
https://golang.org/cl/5650073
This commit is contained in:
Russ Cox 2012-02-13 00:11:36 -05:00
parent 878153682e
commit 65ba8ee07e
4 changed files with 7 additions and 10 deletions

View file

@ -802,7 +802,7 @@ func Mount(source string, target string, fstype string, flags uintptr, data stri
//sys Close(fd int) (err error)
//sys Creat(path string, mode uint32) (fd int, err error)
//sysnb Dup(oldfd int) (fd int, err error)
//sysnb Dup2(oldfd int, newfd int) (fd int, err error)
//sysnb Dup2(oldfd int, newfd int) (err error)
//sysnb EpollCreate(size int) (fd int, err error)
//sysnb EpollCreate1(flag int) (fd int, err error)
//sysnb EpollCtl(epfd int, op int, fd int, event *EpollEvent) (err error)