]> Cypherpunks repositories - gostls13.git/commit
internal/poll: use correct fcntl implementations
authorTobias Klauser <tklauser@distanz.ch>
Fri, 20 Dec 2019 22:34:23 +0000 (23:34 +0100)
committerTobias Klauser <tobias.klauser@gmail.com>
Tue, 31 Dec 2019 12:11:24 +0000 (12:11 +0000)
commitbbd25d26c0a86660fb3968137f16e74837b7a9c6
treee3d5b9963deaf74ac6945bbe9e120f3878bfe926
parentaa175a196d74f2788ec3d02b990487f7ca2af5b0
internal/poll: use correct fcntl implementations

Use the libc fcntl (via syscall.fcntl) on aix and solaris like it is
already done for darwin.

For the syscall-based fcntl implementation use FcntlSyscall from
internal/syscall/unix in order to get fcntl64 on 32-bit Linux
systems.

On aix, fcntl with F_DUPFD_CLOEXEC is not supported. Thus, defined
F_DUPFD_CLOEXEC = 0 in the syscall package and check its value before
calling fcntl(fd, syscall.F_DUPFD_CLOEXEC, 0).

On js/wasm, fcntl is not supported thus let its implementation return
ENOSYS directly.

Updates #36211

Change-Id: I96a2ea79e5c4eed2fefd94d0aefd72c940825682
Reviewed-on: https://go-review.googlesource.com/c/go/+/212278
Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
src/internal/poll/fcntl_js.go [new file with mode: 0644]
src/internal/poll/fcntl_libc.go [new file with mode: 0644]
src/internal/poll/fcntl_syscall.go [new file with mode: 0644]
src/internal/poll/fd_fsync_darwin.go
src/internal/poll/fd_fsync_posix.go
src/internal/poll/fd_unix.go
src/syscall/syscall_aix.go