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>
Only x86-based CPUs have an FSBASE. The current code happens to build
on FreeBSD/aarch64 and FreeBSD/arm, but that's only because we
incorrectly declare PTRACE_GETFSBASE on those platforms.
Change-Id: I128c91bcdb0704a210af13806c1cd285470b5eda
GitHub-Last-Rev: 5e88573c0f
GitHub-Pull-Request: golang/sys#62
Reviewed-on: https://go-review.googlesource.com/c/sys/+/223697
Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Tobias Klauser <tobias.klauser@gmail.com>
CL 179099 introduced ptrace support for freebsd but it seems the
PtraceIoDesc type was not generated by cgo -godefs through mkall.sh
as it contains an uint member. Regenerate the type and adjust
PtraceIoDesc to deal with the type difference on 32-bit vs. 64-bit.
Change-Id: I1ec9662aa8e1b199ebe557387aa27827f23d9d40
Reviewed-on: https://go-review.googlesource.com/c/sys/+/215242
Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
All the implementations of NsecToTimespec and NsecToTimeval were the
same other than types. Write a single version that uses
GOARCH/GOOS-specific setTimespec and setTimeval functions to handle the
types.
The logic in NsecToTimespec and NsecToTimeval caused times before 1970
to have a negative usec/nsec. The Linux kernel requires that usec
contain a positive number; for consistency, we do this for both
NsecToTimespec and NsecToTimeval.
Follow CL 30826 which did the same for syscall.
Change-Id: Id6c6f4fef8450251447d1a5b01f35c2a36b5aeb1
Reviewed-on: https://go-review.googlesource.com/73170
Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
All implementations of these functions are identical.
Follow CL 30819 which did the same for syscall.
Change-Id: I3c78f05ea12251306f3e100a006d266154a5238e
Reviewed-on: https://go-review.googlesource.com/72378
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
It wasn't in linux/arm.
Tested with:
$ for x in $(go tool dist list ) ; do \
export GOOS=$(echo $x | cut -d/ -f1); \
export GOARCH=$(echo $x | cut -d/ -f2); \
echo "$GOOS; $GOARCH"; go install .; done
... which all pass, except openbsd/arm which is still broken exactly
how it was broken previously.
Fixesgolang/go#14643
Change-Id: Ie7ae861b581b539178de26f15ba3f4bdd0e9b785
Reviewed-on: https://go-review.googlesource.com/21013
Reviewed-by: Ian Lance Taylor <iant@golang.org>
If we use a local type, it won't compare properly with errors from
the rest of the standard library. Errors are the one type from syscall
that propagates through the system, so it's important to have only
one type for them.
Ditto for syscall.Signal.
LGTM=dave
R=rsc, dave
CC=golang-codereviews
https://golang.org/cl/123490043
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