On Wed, May 21, 2014 at 12:47 AM, Svante Signell <svante.sign...@gmail.com> wrote: > On Wed, 2014-05-21 at 01:27 +0200, Samuel Thibault wrote: >> Svante Signell, le Fri 16 May 2014 10:03:05 +0200, a écrit : >> > is used in gcc-4.9-4.9.0/src/libgo/go/net/fd_unix.go: >> > func dupCloseOnExec(fd int) (newfd int, err error) { >> > if atomic.LoadInt32(&tryDupCloexec) == 1 && syscall.F_DUPFD_CLOEXEC!=0 { >> > r0, _, e1 := syscall.Syscall(syscall.SYS_FCNTL, uintptr(fd), >> > syscall.F_DUPFD_CLOEXEC, 0) >> >> That code can not work as it is, fcntl is not a system call on >> GNU/Hurd. Why isn't gccgo just using the C fcntl function? That one >> will just work and be portable. > > I don't know, I'm not a go developer. Ask Ian.
It's a bug. That code, like most of libgo, is simply copied from the master Go library, and I never noticed the direct use of syscall.Syscall here. Ian