summaryrefslogtreecommitdiff
path: root/src/syscall/exec_unix_test.go
Commit message (Collapse)AuthorAgeFilesLines
* syscall: move TestForegroundSignal create call out of goroutineIan Lance Taylor2021-04-271-5/+24
| | | | | | | | | | | | | | | | | That way the skip takes effect. Also ignore the result of calling TIOCSPGRP when cleaing up TestForeground. It has started to fail for some reason, and the result doesn't matter. Also call TIOCSPGRP to clean up in TestForegroundSignal. For #37217 Change-Id: I2e4282d7d91ad9a198eeb12cef01c2214c2a98c2 Reviewed-on: https://go-review.googlesource.com/c/go/+/314271 Trust: Ian Lance Taylor <iant@golang.org> Run-TryBot: Ian Lance Taylor <iant@golang.org> Reviewed-by: Cherry Zhang <cherryyz@google.com>
* syscall: restore signal mask after setting foreground process groupIan Lance Taylor2021-04-271-1/+40
| | | | | | | | | | | Fixes #37217 Change-Id: I0151bb77fc4c4552d1b19c31d784943b72f84b80 Reviewed-on: https://go-review.googlesource.com/c/go/+/313653 Trust: Ian Lance Taylor <iant@golang.org> Run-TryBot: Ian Lance Taylor <iant@golang.org> TryBot-Result: Go Bot <gobot@golang.org> Reviewed-by: Tobias Klauser <tobias.klauser@gmail.com>
* all: go fmt std cmd (but revert vendor)Russ Cox2021-02-201-0/+1
| | | | | | | | | | | | | | | | Make all our package sources use Go 1.17 gofmt format (adding //go:build lines). Part of //go:build change (#41184). See https://golang.org/design/draft-gobuild Change-Id: Ia0534360e4957e58cd9a18429c39d0e32a6addb4 Reviewed-on: https://go-review.googlesource.com/c/go/+/294430 Trust: Russ Cox <rsc@golang.org> Run-TryBot: Russ Cox <rsc@golang.org> TryBot-Result: Go Bot <gobot@golang.org> Reviewed-by: Jason A. Donenfeld <Jason@zx2c4.com> Reviewed-by: Ian Lance Taylor <iant@golang.org>
* syscall: use correct type for TIOCSPGRP/TIOCGPGRPJoel Sing2020-11-131-1/+3
| | | | | | | | | | | | | | | | These ioctls take a pid_t (generally a C integer aka int32) and not an int64 - we currently get away with this on little endian 64 bit platforms, since the bytes fall into the correct place, however this breaks on big endian 64 bit platforms (like openbsd/mips64). Update #40995 Change-Id: I622a0543fd562d97f76a7376a84fd2641e6d6a24 Reviewed-on: https://go-review.googlesource.com/c/go/+/267605 Trust: Joel Sing <joel@sing.id.au> Run-TryBot: Joel Sing <joel@sing.id.au> TryBot-Result: Go Bot <gobot@golang.org> Reviewed-by: Ian Lance Taylor <iant@golang.org>
* syscall: use MustHaveExec in TestExecIan Lance Taylor2020-10-171-0/+1
| | | | | | | | | | | For #41702 Change-Id: Ib2b15e52aa1fef2f5e644b316c726150252fa9f8 Reviewed-on: https://go-review.googlesource.com/c/go/+/262738 Trust: Ian Lance Taylor <iant@golang.org> Run-TryBot: Ian Lance Taylor <iant@golang.org> TryBot-Result: Go Bot <gobot@golang.org> Reviewed-by: Cherry Zhang <cherryyz@google.com>
* runtime: stop preemption during syscall.Exec on DarwinIan Lance Taylor2020-10-151-0/+45
| | | | | | | | | | | | | | | | | | | | | | On current macOS versions a program that receives a signal during an execve can fail with a SIGILL signal. This appears to be a macOS kernel bug. It has been reported to Apple. This CL partially works around the problem by using execLock to not send preemption signals during execve. Of course some other stray signal could occur, but at least we can avoid exacerbating the problem. We can't simply disable signals, as that would mean that the exec'ed process would start with all signals blocked, which it likely does not expect. Fixes #41702 Change-Id: I91b0add967b315671ddcf73269c4d30136e579b4 Reviewed-on: https://go-review.googlesource.com/c/go/+/262438 Trust: Ian Lance Taylor <iant@golang.org> Run-TryBot: Ian Lance Taylor <iant@golang.org> TryBot-Result: Go Bot <gobot@golang.org> Reviewed-by: Cherry Zhang <cherryyz@google.com>
* syscall: if Setctty, require that Ctty be a child descriptorIan Lance Taylor2020-05-011-0/+28
| | | | | | | | | | | | | | | | | | Ctty was always handled as a child descriptor, but in some cases passing a parent descriptor would also work. This depended on unpredictable details of the implementation. Reject those cases to avoid confusion. Also reject setting both Setctty and Foreground, as they use Ctty in incompatible ways. It's unlikely that any programs set both fields, as they don't make sense together. Fixes #29458 Change-Id: Ieba2d625711fd4b82c8e65e1feed02fd1fb25e6d Reviewed-on: https://go-review.googlesource.com/c/go/+/231638 Run-TryBot: Ian Lance Taylor <iant@golang.org> Reviewed-by: Damien Neil <dneil@google.com>
* syscall: add AIX operating systemClément Chigot2018-10-101-1/+1
| | | | | | | | | | | | | | | This commit adds AIX operating system to syscall package for ppc64 architecture. It also adds the file syscall_aix.go in the runtime package for syscalls needed during fork and exec. Updates: #25893 Change-Id: I301b1051b178a3efb7bbc39cdbd8e00b594d65ef Reviewed-on: https://go-review.googlesource.com/c/138720 Run-TryBot: Ian Lance Taylor <iant@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Ian Lance Taylor <iant@golang.org>
* all: extract "can I exec?" check from tests into internal/testenvRuss Cox2015-06-161-4/+3
| | | | | | | | Change-Id: I7b54be9d8b50b39e01c6be21f310ae9a10404e9d Reviewed-on: https://go-review.googlesource.com/10753 Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org> Reviewed-by: David Crawshaw <crawshaw@golang.org> Reviewed-by: Ian Lance Taylor <iant@golang.org>
* runtime, syscall: fix Solaris exec testsAram Hăvărneanu2015-03-241-12/+3
| | | | | | | | | Also fixes a long-existing problem in the fork/exec path. Change-Id: Idec40b1cee0cfb1625fe107db3eafdc0d71798f2 Reviewed-on: https://go-review.googlesource.com/8030 Reviewed-by: Minux Ma <minux@golang.org> Reviewed-by: Rob Pike <r@golang.org>
* syscall: disable test that forks on darwin/armDavid Crawshaw2015-03-231-2/+10
| | | | | | | | | | This test was introduced in cl/5130 and broke the darwin/arm builder. Also check some errors, which was making the failure hard to decipher. Change-Id: Ifb1d60b9971782cf8d2e979d83f8a81249d7ee9b Reviewed-on: https://go-review.googlesource.com/7932 Reviewed-by: Rob Pike <r@golang.org>
* syscall: Add Foreground and Pgid to SysProcAttrMichael MacInnis2015-03-231-0/+217
On Unix, when placing a child in a new process group, allow that group to become the foreground process group. Also, allow a child process to join a specific process group. When setting the foreground process group, Ctty is used as the file descriptor of the controlling terminal. Ctty has been added to the BSD and Solaris SysProcAttr structures and the handling of Setctty changed to match Linux. Change-Id: I18d169a6c5ab8a6a90708c4ff52eb4aded50bc8c Reviewed-on: https://go-review.googlesource.com/5130 Run-TryBot: Ian Lance Taylor <iant@golang.org> Reviewed-by: Ian Lance Taylor <iant@golang.org>