diff options
| author | Tobias Klauser <tklauser@distanz.ch> | 2021-09-01 14:57:18 +0200 |
|---|---|---|
| committer | Tobias Klauser <tobias.klauser@gmail.com> | 2021-09-02 09:24:44 +0000 |
| commit | d13d62c49adca86f2101bc0b7d5a394197ece81b (patch) | |
| tree | d6e6c8994b5ce35ac39e382e7ad6d9c48c5a2ca8 /src/syscall/exec_linux.go | |
| parent | 840b4292c9cd5472babf562d3b6eaf727926fd90 (diff) | |
| download | go-d13d62c49adca86f2101bc0b7d5a394197ece81b.tar.xz | |
os, syscall: remove fallback to pipe syscall on Linux
The minimum required Linux kernel version for Go 1.18 will be changed to
2.6.32, see #45964. The pipe2 syscall was added in 2.6.27, so the
fallback to use the pipe syscall in os.Pipe and syscall.forkExecPipe on
Linux can be removed.
For #45964
Change-Id: I033a534f2b39e9bafc9980c9ce980e92f1e3a136
Reviewed-on: https://go-review.googlesource.com/c/go/+/346789
Trust: Tobias Klauser <tobias.klauser@gmail.com>
Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Diffstat (limited to 'src/syscall/exec_linux.go')
| -rw-r--r-- | src/syscall/exec_linux.go | 14 |
1 files changed, 1 insertions, 13 deletions
diff --git a/src/syscall/exec_linux.go b/src/syscall/exec_linux.go index ccc0e39e30..68bce7559b 100644 --- a/src/syscall/exec_linux.go +++ b/src/syscall/exec_linux.go @@ -553,19 +553,7 @@ childerror: // Try to open a pipe with O_CLOEXEC set on both file descriptors. func forkExecPipe(p []int) (err error) { - err = Pipe2(p, O_CLOEXEC) - // pipe2 was added in 2.6.27 and our minimum requirement is 2.6.23, so it - // might not be implemented. - if err == ENOSYS { - if err = Pipe(p); err != nil { - return - } - if _, err = fcntl(p[0], F_SETFD, FD_CLOEXEC); err != nil { - return - } - _, err = fcntl(p[1], F_SETFD, FD_CLOEXEC) - } - return + return Pipe2(p, O_CLOEXEC) } func formatIDMappings(idMap []SysProcIDMap) []byte { |
