aboutsummaryrefslogtreecommitdiff
path: root/src/syscall/exec_freebsd.go
AgeCommit message (Collapse)Author
2023-01-25syscall: clean up variable declarations in forkAndExecInChildBryan C. Mills
The various forkAndExecInChild implementations have comments explaining that they pre-declare variables to force allocations to occur before forking, but then later use ":=" declarations for additional variables. To make it clearer that those ":=" declarations do not allocate, we move their declarations up to the predeclared blocks. For #57208. Change-Id: Ie8cb577fa7180b51b64d6dc398169053fdf8ea97 Reviewed-on: https://go-review.googlesource.com/c/go/+/456516 Auto-Submit: Bryan Mills <bcmills@google.com> Reviewed-by: Ian Lance Taylor <iant@google.com> Run-TryBot: Bryan Mills <bcmills@google.com> TryBot-Result: Gopher Robot <gobot@golang.org>
2022-12-12syscall: fix shadowing bugs in forkAndExecInChildBryan C. Mills
Fixes #57208. Updates #23152. Change-Id: Icc9a74aeb26f1b6f151162c5d6bf1b4d7cd54d0a Reviewed-on: https://go-review.googlesource.com/c/go/+/456515 Run-TryBot: Bryan Mills <bcmills@google.com> Reviewed-by: Russ Cox <rsc@golang.org> TryBot-Result: Gopher Robot <gobot@golang.org>
2022-10-02syscall: remove redundant type conversioncui fliter
Change-Id: Iae290216687fd1ce8be720600157fb78cc2446d0 GitHub-Last-Rev: 4fba64ecb14a704d39f6ecc33989522bcac6656f GitHub-Pull-Request: golang/go#55959 Reviewed-on: https://go-review.googlesource.com/c/go/+/436881 Auto-Submit: Ian Lance Taylor <iant@google.com> Run-TryBot: Ian Lance Taylor <iant@google.com> Reviewed-by: Dmitri Shuralyov <dmitshur@google.com> Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com> TryBot-Result: Gopher Robot <gobot@golang.org> Reviewed-by: Ian Lance Taylor <iant@google.com>
2022-04-05all: separate doc comment from //go: directivesRuss Cox
A future change to gofmt will rewrite // Doc comment. //go:foo to // Doc comment. // //go:foo Apply that change preemptively to all comments (not necessarily just doc comments). For #51082. Change-Id: Iffe0285418d1e79d34526af3520b415a12203ca9 Reviewed-on: https://go-review.googlesource.com/c/go/+/384260 Trust: Russ Cox <rsc@golang.org> Run-TryBot: Russ Cox <rsc@golang.org> Reviewed-by: Ian Lance Taylor <iant@golang.org> TryBot-Result: Gopher Robot <gobot@golang.org>
2021-10-14syscall: use fcntl with F_DUP2FD_CLOEXEC in forkAndExecInChild on FreeBSDTobias Klauser
Use fcntl(oldfd, F_DUP2FD_CLOEXEC, newfd) to duplicate the file descriptor and mark is as close-on-exec instead of dup2 & fcntl. FreeBSD implements dup3 like this in libc. Change-Id: I36e37bc61c2e31561adb49001f287764125a74de Reviewed-on: https://go-review.googlesource.com/c/go/+/355571 Trust: Tobias Klauser <tobias.klauser@gmail.com> Reviewed-by: Ian Lance Taylor <iant@golang.org>
2021-10-14syscall: add support for SysProcAttr.Pdeathsig on FreeBSDTobias Klauser
Fixes #46258 Change-Id: I63f70e67274a9df39c757243b99b12e50a9e4784 Reviewed-on: https://go-review.googlesource.com/c/go/+/355570 Trust: Tobias Klauser <tobias.klauser@gmail.com> Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com> TryBot-Result: Go Bot <gobot@golang.org> Reviewed-by: Ian Lance Taylor <iant@golang.org>
2021-10-14syscall: separate ProcSysAttr and forkAndExecInChild for FreeBSDTobias Klauser
To allow adding fields to ProcSysAttr which are supported on FreeBSD but not on other BSDs. For now exec_freebsd.go is an exact copy of exec_bsd.go with adjusted build tags and copyright year. For #46258 For #46259 Change-Id: I7667a0cdf1ca86ef64a147b77c06db70c5f8eb90 Reviewed-on: https://go-review.googlesource.com/c/go/+/355569 Trust: Tobias Klauser <tobias.klauser@gmail.com> Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com> TryBot-Result: Go Bot <gobot@golang.org> Reviewed-by: Ian Lance Taylor <iant@golang.org>
2018-02-14syscall, os: use pipe2 syscall on NetBSD instead of pipeTobias Klauser
The pipe2 syscall is part of NetBSD since version 6.0 and thus exists in all officially supported versions (6.0 through 6.1 and 7.0+). Follows CL 38426 Change-Id: I7b62b507300c3dfbcc6ae56408a7d7088ddccc77 Reviewed-on: https://go-review.googlesource.com/94035 Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com> Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org> Reviewed-by: Benny Siegert <bsiegert@gmail.com> TryBot-Result: Gobot Gobot <gobot@golang.org>
2017-11-28all: drop support for FreeBSD 9 or belowMikio Hara
This change drops the support for FreeBSD 9 or below and simplifies platform-dependent code for the sake of maintenance. Updates #7187. Fixes #11412. Updates #16064. Updates #18854. Fixes #19072. Change-Id: I9129130aafbfc7d0d7e9b674b6fc6cb31b7381be Reviewed-on: https://go-review.googlesource.com/64910 Reviewed-by: Ian Lance Taylor <iant@golang.org>
2017-03-21syscall, os: fix FreeBSD 9 buildBrad Fitzpatrick
I broke FreeBSD 9 in https://golang.org/cl/38426 by using Pipe2. We still want to support FreeBSD 9 for one last release (Go 1.9 will be the last), and FreeBSD 9 doesn't have Pipe2. So this still uses Pipe2, but falls back to Pipe on error. Updates #18854 Updates #19072 Change-Id: I1de90fb83606c93fb84b4b86fba31e207a702835 Reviewed-on: https://go-review.googlesource.com/38430 Reviewed-by: Rob Pike <r@golang.org> Reviewed-by: Ian Lance Taylor <iant@golang.org> Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org>
2017-03-21syscall, os: use pipe2 syscall on FreeBSD instead of pipeBrad Fitzpatrick
The pipe2 syscall exists in all officially supported FreeBSD versions: 10, 11 and future 12. The pipe syscall no longer exists in 11 and 12. To build and run Go on these versions, kernel needs COMPAT_FREEBSD10 option. Based on Gleb Smirnoff's https://golang.org/cl/38422 Fixes #18854 Change-Id: I8e201ee1b15dca10427c3093b966025d160aaf61 Reviewed-on: https://go-review.googlesource.com/38426 Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org> Reviewed-by: Rob Pike <r@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org>