Commit 55a60cad authored by Tobias Klauser's avatar Tobias Klauser Committed by Tobias Klauser
Browse files

syscall: use dup3 in forkAndExecInChild on OpenBSD

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 system call first appeared in OpenBSD 5.7.

Change-Id: Ic06c2c7089dcdbd931ee24e5e8c316879d81474e
Reviewed-on: https://go-review.googlesource.com/c/go/+/389974


Trust: Tobias Klauser <tobias.klauser@gmail.com>
Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com>
Reviewed-by: default avatarIan Lance Taylor <iant@golang.org>
parent bf97c99b
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment