]> Cypherpunks repositories - gostls13.git/commit
syscall: use fcntl F_DUP2FD_CLOEXEC in forkAndExecInChild on solaris
authorTobias Klauser <tklauser@distanz.ch>
Wed, 14 Sep 2022 08:45:15 +0000 (10:45 +0200)
committerGopher Robot <gobot@golang.org>
Thu, 15 Sep 2022 21:07:18 +0000 (21:07 +0000)
commita7db14241cf59f9d3bf4e1a68cf9e503e1a05211
treefb7b97e1852b88addfc6c3bd18d3e0097ca28641
parente0822b55ac2076112507016bc08d52999c25d728
syscall: use fcntl F_DUP2FD_CLOEXEC in forkAndExecInChild on solaris

Use fcntl(oldfd, F_DUP2FD_CLOEXEC, newfd) to duplicate the file
descriptor and mark is as close-on-exec instead of dup2 & fcntl.

Note that the value for F_DUP2FD_CLOEXEC is different on Solaris and
Illumos and thus the definition is moved from zerrors_solaris_amd64.go
to solaris/illumos specific files.

Change-Id: I9a52801d1a01471ec3f065520575e3fafee92855
Reviewed-on: https://go-review.googlesource.com/c/go/+/428375
Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com>
Auto-Submit: Jenny Rakoczy <jenny@golang.org>
Reviewed-by: Ian Lance Taylor <iant@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Jenny Rakoczy <jenny@golang.org>
Run-TryBot: Jenny Rakoczy <jenny@golang.org>
Run-TryBot: Ian Lance Taylor <iant@google.com>
src/syscall/exec_libc.go
src/syscall/syscall_illumos.go
src/syscall/syscall_solaris.go
src/syscall/syscall_solarisonly.go [new file with mode: 0644]
src/syscall/zerrors_solaris_amd64.go