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
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
04b83988a0 unix: fix or skip failing tests on android and iOS
The mkfifo syscall is disallowed on android and iOS. sched_setaffinity
is disallowed on android. Skip all tests which use them.

/usr/bin does not exist on android. Use /system/bin in TestGetwd
instead, like TestChdirAndGetwd in the os package.

Like linux, android does not support Fchmodat with flags != 0. Adjust
TestFchmodat accordingly.

TestDevices might stat some device files which are not accessible, skip
those.

iOS cannot exec subprocesses, thus skip TestPassFD.

Fixes golang/go#25535

Change-Id: Ic764b9152f0a7b703ad4f47fdb1a9a5e94718154
Reviewed-on: https://go-review.googlesource.com/114395
Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
2018-05-24 13:58:53 +00:00
Tobias Klauser
328643532e unix: fix test compilation error on Go 1.7
testing.Run was introduced in Go 1.7. Skip the tests using it if built
with Go 1.6 or below.

Change-Id: I24c81426ea6d3eaaca5a565ad79b62b30e645d04
Reviewed-on: https://go-review.googlesource.com/78255
Reviewed-by: Ian Lance Taylor <iant@golang.org>
2017-11-20 17:00:34 +00:00
Tobias Klauser
85d1495063 unix: add Major, Minor and Mkdev functions on Linux
Add Major, Minor and Mkdev functions for converting devices numbers to
their major/minor components and vice versa.

The functions follow the behavior of glibc's corresponding macros. Also
add an explanatory comment about the device number format, so the magic
numbers make more sense.

Test the conversion macros with some well-known device numbers for
devices which should be present on any Linux system.

Fixes golang/go#8106

Change-Id: Id336317985d6ac85ee83bc54e5f23703257c9121
Reviewed-on: https://go-review.googlesource.com/50550
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
2017-07-25 14:02:08 +00:00