Commit 5786a54c authored by Tobias Klauser's avatar Tobias Klauser Committed by Tobias Klauser
Browse files

syscall: use dup3 in forkAndExecInChild on NetBSD

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

The dup3 syscall was added in NetBSD 6.0.

Change-Id: I01a4f8c62bfa8fb7f9f3166070380dd2002bb564
Reviewed-on: https://go-review.googlesource.com/c/go/+/358755


Trust: Tobias Klauser <tobias.klauser@gmail.com>
Trust: Benny Siegert <bsiegert@gmail.com>
Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com>
Reviewed-by: default avatarBenny Siegert <bsiegert@gmail.com>
TryBot-Result: Go Bot <gobot@golang.org>
parent ca5f65d7
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment