summaryrefslogtreecommitdiff
path: root/src/syscall/syscall_windows_test.go
Commit message (Collapse)AuthorAgeFilesLines
* os, syscall: don't consider stderr output as part of hostnameDmitri Shuralyov2022-05-091-1/+1
| | | | | | | | | | | | | | | | | | | | | A successful invocation of the hostname command prints the hostname to stdout and exits with code 0. No part of the hostname is printed to stderr, so don't consider it. This avoids false positive failures in environments where hostname prints some extraneous information (such as performance warnings) to stderr, and makes the test a bit more robust. Fixes #52781. Change-Id: I46aa6fbf95b6616bacf9c2b5e412b0851b230744 Reviewed-on: https://go-review.googlesource.com/c/go/+/405014 Auto-Submit: Dmitri Shuralyov <dmitshur@golang.org> Run-TryBot: Dmitri Shuralyov <dmitshur@golang.org> Reviewed-by: Bryan Mills <bcmills@google.com> Reviewed-by: Dmitri Shuralyov <dmitshur@google.com> Reviewed-by: Jason Donenfeld <Jason@zx2c4.com> TryBot-Result: Gopher Robot <gobot@golang.org>
* syscall: disable c-shared test when no cgo, for windows/armJason A. Donenfeld2021-06-151-0/+1
| | | | | | | | | | | | | | | The windows/arm port does not yet support cgo, so disable a test that requires it. This fixes a regression from CL 327969, which added support for arm64, but errantly dropped the t.Skip for both arm and arm64, rather than just for arm64. With this commit, we make the test specific to cgo, rather than the architecture. Change-Id: Ibe1166c1965e007c7af899b07ded65f2a2633ddd Reviewed-on: https://go-review.googlesource.com/c/go/+/327970 Trust: Jason A. Donenfeld <Jason@zx2c4.com> Run-TryBot: Jason A. Donenfeld <Jason@zx2c4.com> TryBot-Result: Go Bot <gobot@golang.org> Reviewed-by: Bryan C. Mills <bcmills@google.com>
* syscall: rewrite handle inheritance test to use C rather than PowershellJason A. Donenfeld2021-06-151-16/+22
| | | | | | | | | | | | | | | | | | | In CL 327210, we disabled this test on arm platforms, because the powershell shipped with those systems isn't native, which means it'd refuse to load native DLLs. This commit rewrites the test to simply not use Powershell, and instead compiles a trivial C program that tests for the same thing. Reverting CL 316269 makes this test fail, as desired, while applying it makes this test succeed. Fixes #46701 Change-Id: If39612c57bf74c63adf58e2c49b5cb739b461fe5 Reviewed-on: https://go-review.googlesource.com/c/go/+/327969 Trust: Jason A. Donenfeld <Jason@zx2c4.com> Trust: Alex Brainman <alex.brainman@gmail.com> Run-TryBot: Jason A. Donenfeld <Jason@zx2c4.com> TryBot-Result: Go Bot <gobot@golang.org> Reviewed-by: Alex Brainman <alex.brainman@gmail.com>
* syscall: do not load native libraries on non-native powershell on armJason A. Donenfeld2021-06-111-0/+4
| | | | | | | | | | | | | | | The powershell that currently ships on ARM Windows isn't native, so it won't load native DLLs. So just skip the tests for now, and reenable it if this ever changes. Updates #46701. Change-Id: I2559fdf13cb65d3ecdc4c6f6df7dec1b490b9651 Reviewed-on: https://go-review.googlesource.com/c/go/+/327210 TryBot-Result: Go Bot <gobot@golang.org> Reviewed-by: Ian Lance Taylor <iant@golang.org> Trust: Jason A. Donenfeld <Jason@zx2c4.com> Run-TryBot: Jason A. Donenfeld <Jason@zx2c4.com>
* syscall: do not change stdio handle inheritanceAlex Brainman2021-05-081-0/+65
| | | | | | | | | | | | | | | | | | | Before the CL 288297 all Go process handles had to be made non-inheritable - otherwise they would escape into the child process. But now this is not necessary. This CL stops changing inheritance flag of stdint, stdout and stderr handles. Fixes #44876 Change-Id: Ib8fcf8066c30282293d96c34486b01b4c04f7116 Reviewed-on: https://go-review.googlesource.com/c/go/+/316269 Trust: Alex Brainman <alex.brainman@gmail.com> Trust: Jason A. Donenfeld <Jason@zx2c4.com> Run-TryBot: Alex Brainman <alex.brainman@gmail.com> TryBot-Result: Go Bot <gobot@golang.org> Reviewed-by: Jason A. Donenfeld <Jason@zx2c4.com>
* syscall: replace os.MkdirTemp with T.TempDirianwoolf2021-04-071-5/+1
| | | | | | | | | | | Updates #45402 Change-Id: I573133d6b987e8ac23e3e2018652612af684c755 Reviewed-on: https://go-review.googlesource.com/c/go/+/307990 Run-TryBot: Ian Lance Taylor <iant@golang.org> TryBot-Result: Go Bot <gobot@golang.org> Reviewed-by: Ian Lance Taylor <iant@golang.org> Reviewed-by: Emmanuel Odeke <emmanuel@orijtech.com>
* syscall: use runtime.KeepAlive for ProcThreadAttributeList argumentsJason A. Donenfeld2021-03-111-36/+0
| | | | | | | | | | | | | | | | | | It turns out that if you write Go pointers to Go memory, the Go compiler must be involved so that it generates various calls to the GC in the process. Letting Windows write Go pointers to Go memory violated this. So, we replace that with just a boring call to runtime.KeepAlive. That's not a great API, but this is all internal code anyway. We fix it up more elegantly for external consumption in x/sys/windows with CL 300369. Fixes #44900. Change-Id: Id6599a793af9c4815f6c9387b00796923f32cb97 Reviewed-on: https://go-review.googlesource.com/c/go/+/300349 Trust: Jason A. Donenfeld <Jason@zx2c4.com> Run-TryBot: Jason A. Donenfeld <Jason@zx2c4.com> TryBot-Result: Go Bot <gobot@golang.org> Reviewed-by: Matthew Dempsky <mdempsky@google.com>
* syscall: treat proc thread attribute lists as unsafe.PointersJason A. Donenfeld2021-03-041-0/+36
| | | | | | | | | | | | | | | | | | | | | | | | It turns out that the proc thread update function doesn't actually allocate new memory for its arguments and instead just copies the pointer values into the preallocated memory. Since we were allocating that memory as []byte, the garbage collector didn't scan it for pointers to Go allocations and freed them. We _could_ fix this by requiring that all users of this use runtime.KeepAlive for everything they pass to the update function, but that seems harder than necessary. Instead, we can just do the allocation as []unsafe.Pointer, which means the GC can operate as intended and not free these from beneath our feet. In order to ensure this remains true, we also add a test for this. Fixes #44662. Change-Id: Ib392ba8ceacacec94b11379919c8179841cba29f Reviewed-on: https://go-review.googlesource.com/c/go/+/297389 Trust: Jason A. Donenfeld <Jason@zx2c4.com> Trust: Alex Brainman <alex.brainman@gmail.com> Trust: Bryan C. Mills <bcmills@google.com> Run-TryBot: Jason A. Donenfeld <Jason@zx2c4.com> TryBot-Result: Go Bot <gobot@golang.org> Reviewed-by: Ian Lance Taylor <iant@golang.org>
* all: update to use os.ReadFile, os.WriteFile, os.CreateTemp, os.MkdirTempRuss Cox2020-12-091-2/+1
| | | | | | | | | | | | | | | | | | | | | | As part of #42026, these helpers from io/ioutil were moved to os. (ioutil.TempFile and TempDir became os.CreateTemp and MkdirTemp.) Update the Go tree to use the preferred names. As usual, code compiled with the Go 1.4 bootstrap toolchain and code vendored from other sources is excluded. ReadDir changes are in a separate CL, because they are not a simple search and replace. For #42026. Change-Id: If318df0216d57e95ea0c4093b89f65e5b0ababb3 Reviewed-on: https://go-review.googlesource.com/c/go/+/266365 Trust: Russ Cox <rsc@golang.org> Run-TryBot: Russ Cox <rsc@golang.org> TryBot-Result: Go Bot <gobot@golang.org> Reviewed-by: Ian Lance Taylor <iant@golang.org>
* syscall: update TOKEN_ALL_ACCESS according to WinNT.hThanabodee Charoenpiriyakij2018-06-111-0/+6
| | | | | | | | | | | TOKEN_ALL_ACCESS was changed at some stage by Microsoft. Updates #25775 Change-Id: I3e18914207a0020b2ebfb99f4e57aa55f9de813b Reviewed-on: https://go-review.googlesource.com/117635 TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Alex Brainman <alex.brainman@gmail.com>
* build: move package sources from src/pkg to srcRuss Cox2014-09-081-0/+72
Preparation was in CL 134570043. This CL contains only the effect of 'hg mv src/pkg/* src'. For more about the move, see golang.org/s/go14nopkg.