6 Commits

Author SHA1 Message Date
Tobias Klauser
7ff74af46e unix: drop go version tags for unsupported versions
go.mod specifies go 1.18. Drop go1.n version tags for older, unsupported
versions.

Change-Id: I8563bd2cc8e86bd560a45b885a9aa2e6bcc95c47
Reviewed-on: https://go-review.googlesource.com/c/sys/+/559415
Reviewed-by: Than McIntosh <thanm@google.com>
Auto-Submit: Tobias Klauser <tobias.klauser@gmail.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Ian Lance Taylor <iant@google.com>
2024-02-14 13:16:46 +00:00
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
Cherry Mui
a76c4d0a00 unix: take address in assembly for Darwin syscall wrappers
In Go 1.17 we will introduce a register-based ABI on some
platforms, as well as ABI wrappers to bridge the ABIs. For Darwin
syscall wrappers, it needs to be called directly, instead of
through wrappers. Currently, it is written as that the syscall
functions are defined in assembly and their addresses are taken
from Go using funcPC. In Go 1.17 this will result in the address
of the ABI wrapper, which is undesired.

In the syscall package in the standard library we changed to use
a compiler intrinsic internal/abi.FuncPCABI0 to take the address
of the syscall function. But that is not available to this repo
and not available in older versions of Go. Here we take a
different approach: taking the address directly from assembly.
This also ensures we get the address of the defined syscall
function, not the ABI wrapper.

Updates golang/go#45702.

Change-Id: Ia7480d0fb0ca4fb9bf2f36d2deb1e3e5e4eb8284
Reviewed-on: https://go-review.googlesource.com/c/sys/+/317894
Trust: Cherry Mui <cherryyz@google.com>
Run-TryBot: Cherry Mui <cherryyz@google.com>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Than McIntosh <thanm@google.com>
2021-05-07 16:14:34 +00:00
Russ Cox
9a76102bfb all: go fmt ./...
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>
2021-02-20 05:07:31 +00:00
Tobias Klauser
3421d5a6bb unix: avoid __getdirentries64 on darwin
Getdirentries is implemented with the __getdirentries64 function
in libSystem.dylib on darwin/{386,amd64}. That function can't be used in
an app store application.

Implement Getdirentries using the underlying
fdopendir/readdir_r/closedir for Go 1.13. The simulation isn't faithful,
and could be slow, but it should handle common cases.

For Go 1.12, fall back to raw syscalls since syscall.syscallPtr needed
to use fdopendir from libSystem.dylib is not available.

Follow CL 168479 and CL 170892 which did the same for syscall in the
stdlib.

Tested on darwin/amd64 with Go 1.11, Go 1.12 and Go 1.13

Fixes golang/go#34400

Change-Id: I631382aaea9ee7e0c4ed09e06ad5427efc620769
Reviewed-on: https://go-review.googlesource.com/c/sys/+/196478
Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Keith Randall <khr@golang.org>
2019-10-02 06:39:06 +00:00
Keith Randall
9fbf701fc3 unix: reverse default for 1.11/1.12 split
Make 1.11 the explicitly named case, and 1.12 the default.

Change-Id: Ic3674860eb9e8a5bb1cf1da12c5ac583cc0b0633
Reviewed-on: https://go-review.googlesource.com/c/155397
Reviewed-by: Tobias Klauser <tobias.klauser@gmail.com>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2018-12-21 06:53:00 +00:00