Граф коммитов

37 Коммитов

Автор SHA1 Сообщение Дата
Dmitri Shuralyov 1bfbee0e20 all: update go directive to 1.18
Done with:

go get go@1.18
go mod tidy
go fix ./...

Using go1.21.3.

Also update code generators to use only the new go:build lines,
not the old +build ones.

For golang/go#60268.

Change-Id: I6aabc42efb6ab3329981100e1db2263aac5e92a6
Reviewed-on: https://go-review.googlesource.com/c/sys/+/534222
Reviewed-by: Ian Lance Taylor <iant@google.com>
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
Auto-Submit: Dmitri Shuralyov <dmitshur@golang.org>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
2023-10-11 21:54:30 +00:00
cui fliter e7d7f63158 all: fix some comments
Change-Id: I7d5bfd4caac63820b26fc3408118c13e74e6448c
Reviewed-on: https://go-review.googlesource.com/c/sys/+/464238
Run-TryBot: Ian Lance Taylor <iant@google.com>
Auto-Submit: Ian Lance Taylor <iant@google.com>
Reviewed-by: Tobias Klauser <tobias.klauser@gmail.com>
Reviewed-by: Ian Lance Taylor <iant@google.com>
Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com>
Reviewed-by: Michael Knyszek <mknyszek@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
2023-01-31 16:01:37 +00:00
kxxt 84dc82d7e8 all: use grep -E/-F instead of fgrep/egrep
egrep and fgrep are obsolescent now.

This PR updates all egrep and fgrep commands to grep -E and grep -F.
Running egrep/fgrep command with grep v3.8 will output the following warning to stderr:
egrep: warning: egrep is obsolescent; using grep -E

see also:
https://www.phoronix.com/news/GNU-Grep-3.8-Stop-egrep-fgrep
https://lists.gnu.org/archive/html/info-gnu/2022-09/msg00001.html

Change-Id: I0c6b6a039063d6aee94e8500971001996d4e498c
GitHub-Last-Rev: 1eee614766
GitHub-Pull-Request: golang/sys#137
Reviewed-on: https://go-review.googlesource.com/c/sys/+/432835
Reviewed-by: Tobias Klauser <tobias.klauser@gmail.com>
Reviewed-by: Ian Lance Taylor <iant@google.com>
Reviewed-by: Carlos Amedee <carlos@golang.org>
Auto-Submit: Ian Lance Taylor <iant@google.com>
Run-TryBot: Ian Lance Taylor <iant@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
2022-10-06 21:19:17 +00:00
Tobias Klauser 76c7481b51 all: simplify unsafe.Slice usage in {Byte,UTF16}PtrToString
On windows, use unsafe.Slice instead of unsafeheader as already the case
for unix and plan9.

The pointers are already *byte/*uint16, so the type conversion can be
omitted as well.

Change-Id: Ida7264cc0c1948bf563ed91d51e637edcdafb77a
Reviewed-on: https://go-review.googlesource.com/c/sys/+/430515
Reviewed-by: Ian Lance Taylor <iant@google.com>
Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Bryan Mills <bcmills@google.com>
2022-09-13 15:31:01 +00:00
Tobias Klauser 87db552b00 plan9: use unsafe.Slice instead of unsafeheader package
Go 1.18 is the minimum supported Go version and unsafe.Slice was
introduced in Go 1.17.

Change-Id: I696dba9b932c522688ee55fdef43d8776f8afbe1
Reviewed-on: https://go-review.googlesource.com/c/sys/+/428516
Reviewed-by: Benny Siegert <bsiegert@gmail.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-09-07 06:24:15 +00:00
Russ Cox b5fbb4746d all: gofmt
Gofmt to update doc comments to the new formatting.

For golang/go#51082.

Change-Id: I9a1c4b671c06820a1c383ee515f7884965fefa54
Reviewed-on: https://go-review.googlesource.com/c/sys/+/399602
Reviewed-by: Ian Lance Taylor <iant@google.com>
Auto-Submit: Russ Cox <rsc@golang.org>
TryBot-Result: Gopher Robot <gobot@golang.org>
Run-TryBot: Russ Cox <rsc@golang.org>
2022-04-29 23:34:32 +00:00
Russ Cox 798191bca9 unix, plan9: avoid writing to p when Pipe(p) fails
Generally speaking Go functions make no guarantees
about what has happened to result parameters on error,
and Pipe is no exception: callers should avoid looking at
p if Pipe returns an error.

However, we had a bug in which ForkExec was using the
content of p after a failed Pipe, and others may too.
As a robustness fix, make Pipe avoid writing to p on failure.

windows.Pipe already avoided writing to p on failure.

For golang/go#50057.

Change-Id: I93ed06b06a9981793c119c1d7df689fbe79b4116
Reviewed-on: https://go-review.googlesource.com/c/sys/+/370614
Trust: Russ Cox <rsc@golang.org>
Reviewed-by: Filippo Valsorda <filippo@golang.org>
Run-TryBot: Russ Cox <rsc@golang.org>
TryBot-Result: Gopher Robot <gobot@golang.org>
2021-12-09 17:19:07 +00:00
Bryan C. Mills 99a53858aa all: add missing //go:build comments
These were apparently overlooked in CL 357329, CL 294490, CL 296889,
and other various updates to this module. (I noticed them via gopls
while investigating golang/go#49466.)

Updates golang/go#41184

Change-Id: Id042bb6fe5282e6d528e9315acf2ad29d0df58ba
Reviewed-on: https://go-review.googlesource.com/c/sys/+/362577
Trust: Bryan C. Mills <bcmills@google.com>
Run-TryBot: Bryan C. Mills <bcmills@google.com>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Reviewed-by: Tobias Klauser <tobias.klauser@gmail.com>
TryBot-Result: Go Bot <gobot@golang.org>
2021-11-10 15:43:04 +00:00
Jason A. Donenfeld 6e5568b54d unix,windows,plan9: add Byte{Slice,Ptr}ToString functions
We already provide ByteSliceFromString and BytePtrFromString, and on
Windows we provide UTF16FromString, UTF16PtrFromString, UTF16ToString,
and UTF16PtrToString. So this commit fills in the remaining two
Byte-oriented functions: ByteSliceToString and BytePtrToString. Since
the existing two are available on windows, unix, and plan9, we add the
remaining two to the same places. This helps eliminate unsafe pointer
options in addition to triggering checkptr in Go 1.15, by eliminating
the use of prior idioms for these types of casts.

Change-Id: I85ae49f2756e142c2462fe8b2428216b6992e089
Reviewed-on: https://go-review.googlesource.com/c/sys/+/263757
Run-TryBot: Jason A. Donenfeld <Jason@zx2c4.com>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Trust: Brad Fitzpatrick <bradfitz@golang.org>
Trust: Jason A. Donenfeld <Jason@zx2c4.com>
2020-10-20 23:07:47 +00:00
Visweswara R 6a60838ec2 plan9: modify mkall.sh to support zsyscall*.go files generation
Modify mkall.sh to support generation of zsyscall_plan9_{386,amd64,arm}.go
files. This does not generate any git diff as they were manually generated
with the same commands.

Fixes golang/go#29586

Change-Id: I5316fdb46f306974584eee653b439408294ea1cf
Reviewed-on: https://go-review.googlesource.com/c/sys/+/179041
Reviewed-by: David du Colombier <0intro@gmail.com>
Reviewed-by: Tobias Klauser <tobias.klauser@gmail.com>
2019-05-29 16:45:35 +00:00
Visweswara R cb59ee3660 plan9: replace "mksyscall.pl" with Go program
Modify unix/mksyscall.go to support plan9.
This does not generate any git diff besides the
command name in comments of generated files and
addition of +build tags.

Updates golang/go#27779

Change-Id: I359a80d1c08837d92a7095e5235867c29a2d2a60
Reviewed-on: https://go-review.googlesource.com/c/156157
Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Tobias Klauser <tobias.klauser@gmail.com>
2019-01-07 07:01:47 +00:00
Visweswara R badf558520 plan9: remove "use" function and calls from generated code.
Update mksyscall.pl to skip generating calls to "use".

See issue https://golang.org/issue/16607
and CL https://golang.org/cl/36616

Change-Id: Id36614fce5d98a8538edf4f4a7276e650b99b839
Reviewed-on: https://go-review.googlesource.com/c/156437
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Reviewed-by: Tobias Klauser <tobias.klauser@gmail.com>
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
2019-01-05 16:57:16 +00:00
Tobias Klauser 8883426083 plan9: follow convention for generated code comment
Follow the convertion (https://golang.org/s/generatedcode) for generated
code.

Change-Id: If06c4d5c3974a163ff75a9acc7141292eb43b7ef
Reviewed-on: https://go-review.googlesource.com/118818
Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2018-06-14 13:48:39 +00:00
Kevin Burke 01acb38716 plan9, unix, windows: add paragraph breaks in docs
Currently the doc string forms one run-on sentence when viewed in
a browser. Add an additional newline so the text is presented in
a browser the same way it is in the source code.

Change-Id: If93e45c5aec9edd195c6bf36cb757c5146368507
Reviewed-on: https://go-review.googlesource.com/101284
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2018-03-18 19:08:47 +00:00
Tobias Klauser 7dca6fe1f4 plan9: use bytes.IndexByte instead of a for loop
Change-Id: Iae896dc32e775cb469fc3d0d367fd7c7825161ec
Reviewed-on: https://go-review.googlesource.com/99516
Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2018-03-08 15:20:46 +00:00
Tobias Klauser 90f0fdc418 plan9: add arm support
Copy zsyscall_plan9_arm.go from syscall and add asm_plan9_arm.s which
just contains jumps to the corresponding syscall functions.

Change-Id: I0eed6449c622ae3f6e73abcb43edfd306e96753f
Reviewed-on: https://go-review.googlesource.com/89795
Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
2018-01-25 14:42:35 +00:00
Tobias Klauser 2493af8e3b plan9: move Unsetenv into env_plan9.go
Unsetenv was in its own file for Go 1.4 compatibility. This version is
no longer supported, so move Unsetenv with the other environment
specific functions.

Change-Id: I8b6621993f2ab0fbafe900b19dcaee7b5b3ed26f
Reviewed-on: https://go-review.googlesource.com/86540
Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
2018-01-08 22:11:54 +00:00
Tobias Klauser 9e4fff1f4d all: single space after period
Follow CL 20022 and consistently use single space after a period in
documentation.

Generated with:

$ perl -i -npe 's,^(\s*// .+[a-z]\.)  +([A-Z]),$1 $2,' $(git grep -l -E '^\s*//(.+\.)  +([A-Z])')

Change-Id: Ia29ad823668f060e81293e848a79fc4b4857d94b
Reviewed-on: https://go-review.googlesource.com/73530
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
2017-10-25 20:39:07 +00:00
David du Colombier 5eaf0df67e plan9: add mount and bind flags
Thanks Skip Tavakkolian.

Fixes golang/go#14452.

Change-Id: I0a4ef49edae61bb37f49b1071dd5c31e88ad6c04
Reviewed-on: https://go-review.googlesource.com/19729
Reviewed-by: Rob Pike <r@golang.org>
2016-02-22 20:26:01 +00:00
Ian Lance Taylor 833a04a105 plan9: fix duplicated copyright header in mksysnum_plan9.sh
Fixes golang/go#13569.

Change-Id: I8af36bc81afa6b8bc0e80b3f35f0b60707bfb91b
Reviewed-on: https://go-review.googlesource.com/17713
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2015-12-11 03:36:51 +00:00
David du Colombier 86577e58ba x/sys/plan9: implement the environment functions by wrapping syscall
Make Plan 9 implementation similar to Unix.

Fixes golang/go#10803.

Change-Id: Ib2f069a68370792daf926ec2a393f9cf16c2816b
Reviewed-on: https://go-review.googlesource.com/10104
Reviewed-by: Rob Pike <r@golang.org>
2015-05-15 15:33:54 +00:00
Alex Brainman fd399679d2 plan9: skip pwd_plan9_go15.go unless on plan9
Fixes build.

Change-Id: Ib090c951b192ec5d4e145aa2d302d140f99b1417
Reviewed-on: https://go-review.googlesource.com/10099
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2015-05-15 03:08:47 +00:00
David du Colombier 7353fe07c1 plan9: make pwd process-wide on Plan 9
From main repo: https://go-review.googlesource.com/#/c/6350
                https://go-review.googlesource.com/#/c/6385

Change-Id: Ieba5ff60fc501be9aa4739860c8fe026f8b3eb67
Reviewed-on: https://go-review.googlesource.com/8721
Reviewed-by: Rob Pike <r@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2015-04-12 18:03:11 +00:00
David du Colombier d3c664b24d plan9: reduce the set of architecture-dependent files on Plan 9
From main repo: https://go-review.googlesource.com/#/c/2167

Change-Id: I2043458a432ccd2aa8b206adc107ac7b215e355f
Reviewed-on: https://go-review.googlesource.com/8720
Reviewed-by: Rob Pike <r@golang.org>
2015-04-11 10:39:11 +00:00
David Symonds 1da8e6ee6d sys: add import comments.
Change-Id: I0ebbb4f2da41bea7871f893332f2e4847b1bfefa
Reviewed-on: https://go-review.googlesource.com/1241
Reviewed-by: Andrew Gerrand <adg@golang.org>
2014-12-09 22:46:33 +00:00
Andrew Gerrand dea3d764c2 go.sys: use golang.org/x/... import paths
LGTM=bradfitz, rsc
R=rsc, bradfitz
CC=golang-codereviews
https://golang.org/cl/171050043
2014-11-10 08:56:17 +11:00
Brad Fitzpatrick c65f27ffe6 go.sys: add Unsetenv
LGTM=r
R=r
CC=golang-codereviews
https://golang.org/cl/153810043
2014-10-01 12:10:37 -07:00
Rob Pike 417a323d1f go.sys/plan9: define "use" in plan9/syscall.go
LGTM=0intro
R=rsc, 0intro
CC=golang-codereviews
https://golang.org/cl/141870043
2014-09-09 11:25:43 -07:00
Rob Pike 477fd0357c go.sys/plan9: update to use "use"
LGTM=rsc, aram, 0intro
R=rsc, aram, 0intro
CC=golang-codereviews
https://golang.org/cl/138280043
2014-09-09 11:02:42 -07:00
David du Colombier 02c66d5dc9 go.sys/plan9: use syscall.ErrorString instead of NewError
LGTM=bradfitz, r
R=r, bradfitz
CC=golang-codereviews
https://golang.org/cl/126090044
2014-08-25 02:23:33 +02:00
Rob Pike fcfc1156f8 go.sys/plan9: delete Exec etc.
These are being deleted from go.sys because in general they can
only be implemented in close coordination with the runtime.

LGTM=0intro
R=golang-codereviews, 0intro
CC=golang-codereviews
https://golang.org/cl/132810043
2014-08-22 15:33:52 -07:00
Rob Pike ba5045e1e0 go.sys/plan9: just jump to syscall.Syscall etc.
Don't re-implement these functions.

LGTM=rsc
R=rsc
CC=golang-codereviews
https://golang.org/cl/124350045
2014-08-14 12:05:46 -07:00
Rob Pike b87d025ac4 go.sys/plan9: use syscall.ErrorString for errors
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.
Will apply the corresponding change to the other packages once
this is approved.

Also delete some deprecated code. This is a new package; no need
to carry the past.

LGTM=rsc
R=rsc
CC=golang-codereviews
https://golang.org/cl/126250043
2014-08-14 09:29:35 -07:00
Rob Pike 279b3782ad go.sys: fix imports to cgc/p/go.sys, add build tags
Approach but probably not achieve a green build.

LGTM=adg
R=golang-codereviews, adg
CC=golang-codereviews
https://golang.org/cl/126120043
2014-08-12 22:59:00 -07:00
Rob Pike 8768103c90 go.sys/all: update #includes to new location
Darwin/amd64 now builds. No others tested yet.
mkall.sh also runs correctly. The updates, which are
substantial, are not yet applied to avoid unnecessary churn.
Restore mkerrors.sh, which is needed in the unix directory.

LGTM=rsc
R=rsc
CC=golang-codereviews
https://golang.org/cl/122410044
2014-08-12 14:05:03 -07:00
Rob Pike 8442dd2c63 go.sys: update package names
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
2014-08-11 15:58:26 -07:00
Rob Pike 20acc5cf31 go.sys: copy files from syscall package to go.sys/{plan9,windows,unix}
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
2014-08-11 14:48:46 -07:00