Make all our package sources use Go 1.17 gofmt format
(adding //go:build lines).
Not strictly necessary but will avoid spurious changes
as files are edited.
Part of //go:build change (#41184).
See https://golang.org/design/draft-gobuild
Change-Id: I01667f826428426a39c84717d02efa25fa44553c
Reviewed-on: https://go-review.googlesource.com/c/sys/+/294490
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Keith Randall <khr@golang.org>
Reviewed-by: Josh Bleecher Snyder <josharian@gmail.com>
Reviewed-by: Matt Layher <mdlayher@gmail.com>
Trust: Josh Bleecher Snyder <josharian@gmail.com>
Trust: Russ Cox <rsc@golang.org>
Run-TryBot: Josh Bleecher Snyder <josharian@gmail.com>
Run-TryBot: Russ Cox <rsc@golang.org>
Resolves a number of issues, except for the clen function being
unused on Linux, as that would require a larger refactor which
probably isn't strictly necessary.
$ staticcheck .
affinity_linux.go:94:8: const m3 is unused (U1000)
affinity_linux.go:95:8: const m4 is unused (U1000)
sendfile_test.go:41:2: the goroutine calls T.Fatal, which must be called in the same goroutine as the test (SA2002)
sendfile_test.go:47:6: this value of err is never used (SA4006)
syscall_linux_test.go:519:21: should use time.Since instead of time.Now().Sub (S1012)
syscall_linux_test.go:530:21: should use time.Since instead of time.Now().Sub (S1012)
syscall_test.go:66:2: this value of ts is never used (SA4006)
syscall_test.go:67:2: this value of ts is never used (SA4006)
syscall_unix.go:88:6: func clen is unused (U1000)
Change-Id: I2611b4559339cea758b5da27ea1f36fb8cc2df3f
Reviewed-on: https://go-review.googlesource.com/c/sys/+/188037
Run-TryBot: Matt Layher <mdlayher@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
On AIX, Stat_t's fields dealing with time are of type StTimespec while
all other GOOS are using Timespec.
StTimespec and Timespec are the same on ppc but not in ppc64. Therefore,
values returned by ppc64 syscalls need to be adjusted in order to
allow the use of Timespec instead of StTimespec.
Fixesgolang/go#32073
Change-Id: I0c212bf1741a27c49e995bf928d4941b6d583e54
Reviewed-on: https://go-review.googlesource.com/c/sys/+/177838
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Birthtime/Birthtimespec was renamed to Btim to match the others.
Also unexport the [ACMB]tim_ext fields on freebsd 386.
Update mkpost.go to do the renames.
Ran the following on the existing ztypes_*.go files:
#!/bin/sh
set -e
for f in ztypes_*.go; do
cat $f | go run mkpost.go | gofmt > $f.tmp
mv $f.tmp $f
done;
cat ztypes_freebsd_386.go | env GOOS=freebsd GOARCH=386 go run mkpost.go | gofmt > ztypes_freebsd_386.go.tmp
mv ztypes_freebsd_386.go{.tmp,}
Fixesgolang/go#31735
Change-Id: I15765d690ee8d2be6bbb37f465322bc019722e08
Reviewed-on: https://go-review.googlesource.com/c/sys/+/175157
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
They were missed yesterday when adding the tags for all the other unix variants.
LGTM=aram
R=rsc, aram
CC=golang-codereviews
https://golang.org/cl/126150043
Semi-automatic migration from package syscall to package {plan9,windows,unix}.
No builds attempted yet, but this gets a lot of noise behind us so subsequent
CLs will be more concise and easier to follow.
Subsequent CLs will have semantic content.
LGTM=rsc
R=golang-codereviews, rsc
CC=golang-codereviews
https://golang.org/cl/121520043
This CL copies to each package of go.sys the files from syscall it will need.
Different directories have different files, but these:
mkall.sh
str.go
syscall.go
mksyscall.pl
race.go
race0.go
syscall_test.go
are copied to all three.
No changes yet, these are just copies. They are not ready to use yet:
package names are wrong, for starters. But this clean copy will make
it easier to follow the changes as the packages are enabled.
LGTM=rsc
R=golang-codereviews, rsc
CC=golang-codereviews
https://golang.org/cl/126960043