Florian Lehner
2f2cc5dae4
unix: update IFLA and NETKIT constants with Linux kernel 6.7
...
Change-Id: I5034ceb384f6a4945a969b00ca420c80aa03d941
Reviewed-on: https://go-review.googlesource.com/c/sys/+/561575
TryBot-Result: Gopher Robot <gobot@golang.org >
Auto-Submit: Tobias Klauser <tobias.klauser@gmail.com >
Reviewed-by: David Chase <drchase@google.com >
Run-TryBot: 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-07 19:22:56 +00:00
Joshua Sing
bef1bd8971
unix: move mksyscall regexp to package level variables
...
Avoid compiling regular expressions for each loop iteration, rather
declare them as package level variables so they are only compiled once.
Change-Id: I5c29a44e986ef8d97326134e8fc8e983671e68d8
Reviewed-on: https://go-review.googlesource.com/c/sys/+/542955
Reviewed-by: Joel Sing <joel@sing.id.au >
Run-TryBot: Joel Sing <joel@sing.id.au >
Reviewed-by: Carlos Amedee <carlos@golang.org >
Reviewed-by: Cherry Mui <cherryyz@google.com >
TryBot-Result: Gopher Robot <gobot@golang.org >
2024-01-27 04:55:52 +00:00
Mauri de Souza Meneguzzo
5710a32031
unix/linux: update Linux kernel to 6.7
...
Change-Id: Ie0cc6803af5b3ede657ce516e657b0356cd91175
GitHub-Last-Rev: 255f0ebf45
GitHub-Pull-Request: golang/sys#185
Reviewed-on: https://go-review.googlesource.com/c/sys/+/554555
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com >
TryBot-Result: Gopher Robot <gobot@golang.org >
Run-TryBot: Mauri de Souza Meneguzzo <mauri870@gmail.com >
Reviewed-by: Bryan Mills <bcmills@google.com >
Run-TryBot: Bryan Mills <bcmills@google.com >
Reviewed-by: Cherry Mui <cherryyz@google.com >
Reviewed-by: Tobias Klauser <tobias.klauser@gmail.com >
2024-01-23 21:43:30 +00:00
Meng Zhuo
f69d32aa92
unix: in TestDirent, make as many ReadDirent calls as are needed
...
This CL just port CL 376334 from main repo with minor modification.
Fixes golang/go#65015
Change-Id: I327d33bde39a2fcb818e28bcb7ff524ca19c4a38
Reviewed-on: https://go-review.googlesource.com/c/sys/+/554875
Reviewed-by: Bryan Mills <bcmills@google.com >
Run-TryBot: M Zhuo <mzh@golangcn.org >
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com >
TryBot-Result: Gopher Robot <gobot@golang.org >
2024-01-10 01:52:35 +00:00
Florian Lehner
0d9df52791
unix: add more SECCOMP constants
...
Update the SECCOMP regex to fetch more SECCOMP constants.
Change-Id: I192ff7cb11fc38f0b0f08d6cba0a4f8649f9775e
Reviewed-on: https://go-review.googlesource.com/c/sys/+/553776
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com >
Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com >
TryBot-Result: Gopher Robot <gobot@golang.org >
Reviewed-by: Matthew Dempsky <mdempsky@google.com >
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com >
Auto-Submit: Tobias Klauser <tobias.klauser@gmail.com >
Reviewed-by: Matt Layher <mdlayher@gmail.com >
2024-01-08 20:16:52 +00:00
Tobias Klauser
32cdffc661
unix: don't redefine constants already defined in glibc headers
...
These are all present in glibc 2.37 which is currently used to generate
these constants.
Change-Id: I3ffbd8f8581e85e8854222ad3f2c7f44aac106c7
Reviewed-on: https://go-review.googlesource.com/c/sys/+/552417
Reviewed-by: David Chase <drchase@google.com >
Auto-Submit: Tobias Klauser <tobias.klauser@gmail.com >
Reviewed-by: Matt Layher <mdlayher@gmail.com >
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com >
Reviewed-by: Than McIntosh <thanm@google.com >
2023-12-27 21:45:51 +00:00
Josh Rickmar
f0c7190c5e
unix: remove extra trailing newlines in zsyscall_openbsd_*.go
...
These newlines are written by mksyscall.go but should not appear in the final
generated files once the output is passed through gofmt. This is done by
mkall.sh but I had written a custom script just to generate these openbsd
zsyscall files in CL 468095.
Running the mksyscall.go output through gofmt fixes this issue.
Fixes golang/go#64820
Change-Id: I1b1bf55145bd5a5208e091ded24a973f953c479f
GitHub-Last-Rev: 514272bd56
GitHub-Pull-Request: golang/sys#183
Reviewed-on: https://go-review.googlesource.com/c/sys/+/551715
Reviewed-by: Tobias Klauser <tobias.klauser@gmail.com >
Reviewed-by: Carlos Amedee <carlos@golang.org >
Run-TryBot: Jorropo <jorropo.pgm@gmail.com >
TryBot-Result: Gopher Robot <gobot@golang.org >
Reviewed-by: Than McIntosh <thanm@google.com >
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com >
2023-12-21 14:55:30 +00:00
Lionel Jouin
5ff87d7bfd
unix: add Netfilter and NFTables constants
...
Fixes golang/go#64426
Change-Id: I7332f73e27396d187ed63715100af299a949eaf9
GitHub-Last-Rev: a6b267b590
GitHub-Pull-Request: golang/sys#182
Reviewed-on: https://go-review.googlesource.com/c/sys/+/545495
Auto-Submit: Tobias Klauser <tobias.klauser@gmail.com >
Reviewed-by: Tobias Klauser <tobias.klauser@gmail.com >
Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com >
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com >
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com >
Reviewed-by: Mauri de Souza Meneguzzo <mauri870@gmail.com >
TryBot-Result: Gopher Robot <gobot@golang.org >
Reviewed-by: Michael Knyszek <mknyszek@google.com >
2023-12-01 17:42:15 +00:00
Alexandru Matei
13b15b780d
unix: add IoctlLoopConfigure on linux
...
LOOP_CONFIGURE ioctl is used to setup and configure all loop device
parameters in a single step.
Add to the unix package a new function that exposes LOOP_CONFIGURE.
Fixes golang/go#63962
Change-Id: Ia169d268b52b1384febc6bff9c707b721ab2bb24
GitHub-Last-Rev: f9cc4c94cb
GitHub-Pull-Request: golang/sys#181
Reviewed-on: https://go-review.googlesource.com/c/sys/+/540075
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com >
Reviewed-by: David Chase <drchase@google.com >
Reviewed-by: Tobias Klauser <tobias.klauser@gmail.com >
Auto-Submit: Tobias Klauser <tobias.klauser@gmail.com >
Reviewed-by: Matthew Dempsky <mdempsky@google.com >
Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com >
TryBot-Result: Gopher Robot <gobot@golang.org >
2023-11-18 01:08:36 +00:00
Konstantin Burkalev
e4099bfacb
unix: fix trimmed socket opt string in GetsockoptString
...
Fixes golang/go#63217
Change-Id: Ia1b0ae88b7e7a7c611067a0b30e454b66f45ce51
Reviewed-on: https://go-review.googlesource.com/c/sys/+/530897
Reviewed-by: Mauri de Souza Meneguzzo <mauri870@gmail.com >
Reviewed-by: Cherry Mui <cherryyz@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: Heschi Kreinick <heschi@google.com >
Reviewed-by: Tobias Klauser <tobias.klauser@gmail.com >
2023-11-08 17:59:55 +00:00
Tobias Klauser
9888904928
unix: update BPF constants for Linux kernel 6.6
...
This re-adds BPF_F_KPROBE_MULTI_RETURN which was removed by CL 538378
because it was changed from a #define to an enum in the upstream bpf.h
header, see
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=c5487f8d9186
Fixes golang/go#63969
Change-Id: Icbf180d8fb8d51fd2fa4a29a615f7071abda9a8b
Reviewed-on: https://go-review.googlesource.com/c/sys/+/540395
Reviewed-by: Heschi Kreinick <heschi@google.com >
Auto-Submit: Tobias Klauser <tobias.klauser@gmail.com >
Reviewed-by: Bryan Mills <bcmills@google.com >
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com >
Reviewed-by: Mauri de Souza Meneguzzo <mauri870@gmail.com >
2023-11-08 17:48:45 +00:00
Tobias Klauser
2d0c73638b
unix: use fchmodat2 in Fchmodat
...
The fchmodat2 syscall was added in Linux kernel 6.6. Use it in Fchmodat
if flags are given. It will return ENOSYS on older kernels (or EINVAL or
any other bogus error in some container implementations).
Fixes golang/go#61636
Change-Id: Ibbc9a08733b7186907b2fe5837cb997446c38357
Reviewed-on: https://go-review.googlesource.com/c/sys/+/539635
Reviewed-by: Heschi Kreinick <heschi@google.com >
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com >
Reviewed-by: Bryan Mills <bcmills@google.com >
Reviewed-by: Mauri de Souza Meneguzzo <mauri870@gmail.com >
2023-11-06 18:22:10 +00:00
Josh Rickmar
ec230dae7f
unix: use fcntl(2) libc stub on OpenBSD
...
Future OpenBSD releases will remove the syscall(2) interface.
This converts the Fcntl functions to use fcntl(2) from libc,
rather than indirectly through syscall(2).
Updates golang/go#63900 .
Change-Id: I50c3b91cb40245653c772e65b0b15c625974bebe
GitHub-Last-Rev: 9c62104c43
GitHub-Pull-Request: golang/sys#179
Reviewed-on: https://go-review.googlesource.com/c/sys/+/538995
Reviewed-by: Bryan Mills <bcmills@google.com >
Reviewed-by: Joel Sing <joel@sing.id.au >
Reviewed-by: Cherry Mui <cherryyz@google.com >
Run-TryBot: Joel Sing <joel@sing.id.au >
TryBot-Result: Gopher Robot <gobot@golang.org >
Reviewed-by: Mauri de Souza Meneguzzo <mauri870@gmail.com >
2023-11-06 12:49:47 +00:00
Joel Sing
cb378ae1ff
syscall: call getfsstat via libc on openbsd
...
On openbsd, call getfsstat directly via libc, instead of calling it
via syscall.Syscall.
Updates golang/go#63900
Change-Id: I99a3555b3207754b107dbabf63440569fca93eea
Reviewed-on: https://go-review.googlesource.com/c/sys/+/538976
Reviewed-by: Cherry Mui <cherryyz@google.com >
Run-TryBot: Joel Sing <joel@sing.id.au >
Reviewed-by: Tobias Klauser <tobias.klauser@gmail.com >
Reviewed-by: Josh Rickmar <jrick@zettaport.com >
Reviewed-by: Bryan Mills <bcmills@google.com >
TryBot-Result: Gopher Robot <gobot@golang.org >
2023-11-03 11:48:45 +00:00
Josh Rickmar
661d749b94
unix: use libc stubs for OpenBSD pledge+unveil
...
Future OpenBSD releases will remove the syscall(2) interface.
This converts the Pledge and Unveil calls to use pledge(2) and
unveil(2) from libc, rather than indirectly through syscall(2).
Updates golang/go#63900 .
Change-Id: I61e22d8f52f16c8f5e4c0717acae0d5bf4271503
GitHub-Last-Rev: ebc0461460
GitHub-Pull-Request: golang/sys#146
Reviewed-on: https://go-review.googlesource.com/c/sys/+/468095
Reviewed-by: Cherry Mui <cherryyz@google.com >
Reviewed-by: Mauri de Souza Meneguzzo <mauri870@gmail.com >
Reviewed-by: Joel Sing <joel@sing.id.au >
Reviewed-by: Tobias Klauser <tobias.klauser@gmail.com >
Run-TryBot: Joel Sing <joel@sing.id.au >
TryBot-Result: Gopher Robot <gobot@golang.org >
Reviewed-by: Aaron Bieber <aaron@bolddaemon.com >
Reviewed-by: Bryan Mills <bcmills@google.com >
2023-11-03 07:50:05 +00:00
Mauri de Souza Meneguzzo
1168e2596d
unix/linux: update Linux kernel to v6.6
...
Update the Dockerfile to clone Linux v6.6 and commit the
changes generated by GOOS=linux ./mkall.sh.
Fixes golang/go#63833
Change-Id: I35e0b01598809d18e04b073ef1abd58ae936f43c
GitHub-Last-Rev: b2a502ffc6
GitHub-Pull-Request: golang/sys#178
Reviewed-on: https://go-review.googlesource.com/c/sys/+/538378
Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com >
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com >
TryBot-Result: Gopher Robot <gobot@golang.org >
Auto-Submit: Tobias Klauser <tobias.klauser@gmail.com >
Reviewed-by: Bryan Mills <bcmills@google.com >
Reviewed-by: Tobias Klauser <tobias.klauser@gmail.com >
Reviewed-by: Cherry Mui <cherryyz@google.com >
2023-10-31 17:02:05 +00:00
Josh Rickmar
249e16f7ca
unix: require minimum OpenBSD 6.4 for pledge, unveil
...
OpenBSD 7.3 and 7.4 are the only supported OpenBSD releases. This change simplifies the version detection and error handling to require at least OpenBSD 6.4 to call the Pledge and Unveil functions.
Updates golang/go#63569 .
Change-Id: I6bd0d58807a73a532ddd2d3239687ca19a93db9d
GitHub-Last-Rev: d03d157e76
GitHub-Pull-Request: golang/sys#177
Reviewed-on: https://go-review.googlesource.com/c/sys/+/537355
TryBot-Result: Gopher Robot <gobot@golang.org >
Run-TryBot: Joel Sing <joel@sing.id.au >
Reviewed-by: David Chase <drchase@google.com >
Reviewed-by: Cherry Mui <cherryyz@google.com >
Reviewed-by: Joel Sing <joel@sing.id.au >
2023-10-31 10:36:12 +00:00
F Y
1e638101df
unix: stop counting trailing NUL for abstract addresses starting with NUL
...
Changes trailing-NUL-counting behavior for abstract addresses
starting with the NUL character to be the same as abstract
addresses starting with the @ character.
For golang/go#63579 .
Change-Id: I2f26de4bcf614c4635ad188b1afa3d14ebd9a95f
Reviewed-on: https://go-review.googlesource.com/c/sys/+/535955
Reviewed-by: Ian Lance Taylor <iant@google.com >
Auto-Submit: Ian Lance Taylor <iant@google.com >
Reviewed-by: Benny Siegert <bsiegert@gmail.com >
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com >
2023-10-23 09:05:11 +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
Mauri de Souza Meneguzzo
1d9f0b6d88
unix: add linux cachestat system call
...
The cachestat system call is an alternative to mincore that offers more
extensive page cache statistics, aiming to enhance scalability. It was added
on Linux 6.5.
Fixes golang/go#61917
Change-Id: If1b6b96f859dd6bf09f1a0c048abfa743a42c540
GitHub-Last-Rev: d18fbb9c48
GitHub-Pull-Request: golang/sys#176
Reviewed-on: https://go-review.googlesource.com/c/sys/+/533242
Reviewed-by: Ian Lance Taylor <iant@google.com >
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com >
Auto-Submit: Ian Lance Taylor <iant@google.com >
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com >
2023-10-10 00:36:02 +00:00
Tobias Klauser
2964e1e4b1
unix: remove unused readlen and writelen
...
These were originally added when copying over files from package
syscall. However, their use was removed in CL 129500043. New ports kept
adding these wrappers without using them. They are still unused, so
remove them.
Change-Id: I2ffffe98a5c999d23b63d1f04ee4ad8f807ee736
Reviewed-on: https://go-review.googlesource.com/c/sys/+/531356
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com >
Reviewed-by: Than McIntosh <thanm@google.com >
Auto-Submit: Tobias Klauser <tobias.klauser@gmail.com >
Reviewed-by: Ian Lance Taylor <iant@google.com >
2023-09-28 17:55:56 +00:00
Tobias Klauser
807530fc6d
unix: remove lists of unimplemented syscalls
...
These lists are incomplete and out of date, so there's not much point
in keeping them around.
Change-Id: I0a45905c774b751f0a744f1df88bccb0554a6ab1
Reviewed-on: https://go-review.googlesource.com/c/sys/+/530896
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 >
Reviewed-by: Bryan Mills <bcmills@google.com >
2023-09-27 13:17:34 +00:00
Mark Ryan
8858c729c9
unix: update riscv_hwprobe constants
...
Linux 6.5 enhanced the riscv_hwprobe syscall to detect four new
RISC-V extensions, V, Zba, Zbb and Zbs. Update the hwprobe
constants in unix so these extensions can be detected by Go
programs.
Updates golang/go#61416
Change-Id: Id6b4566c5c96fe3429fad54e93d3459cb5317642
Reviewed-on: https://go-review.googlesource.com/c/sys/+/530895
Reviewed-by: Ian Lance Taylor <iant@google.com >
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com >
Reviewed-by: Than McIntosh <thanm@google.com >
Auto-Submit: Ian Lance Taylor <iant@google.com >
Reviewed-by: Tobias Klauser <tobias.klauser@gmail.com >
2023-09-26 16:44:26 +00:00
Mark Ryan
aa9470e40d
unix/linux: update to Linux kernel 6.5
...
Update the Dockerfile to clone Linux v6.5 and commit the changes
generated by GOOS=linux ./mkall.sh
Change-Id: Ibd753579f8771d0d4b86e5398ed4690bb6095c6e
Reviewed-on: https://go-review.googlesource.com/c/sys/+/530115
Auto-Submit: Ian Lance Taylor <iant@google.com >
Reviewed-by: Ian Lance Taylor <iant@google.com >
Reviewed-by: Matthew Dempsky <mdempsky@google.com >
Reviewed-by: Mauri de Souza Meneguzzo <mauri870@gmail.com >
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com >
2023-09-22 16:23:25 +00:00
Kir Kolyshkin
c7ff727a8c
unix: fix double copy in (*SockaddrALG).sockaddr
...
The code uses ByteSliceFromString first, which
- checks that the string does not contain \0;
- copies the string to a byte slice which ends with \0.
Next, it does one more copy, to sa.raw fields.
Double copying is not needed because:
- the code already checks that there's an extra byte for \0 in the
sa.raw field;
- there is no need to check for \0 byte in the middle of the fields
(those are hash and cipher names, and an unknown name will result in
EINVAL from the kernel).
While at it, remove the use of magic numbers.
Change-Id: I0cf096fad6f974507d4aa8d429f077000b3bb639
Reviewed-on: https://go-review.googlesource.com/c/sys/+/527836
TryBot-Result: Gopher Robot <gobot@golang.org >
Auto-Submit: Ian Lance Taylor <iant@golang.org >
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com >
Run-TryBot: Kirill Kolyshkin <kolyshkin@gmail.com >
Reviewed-by: Bryan Mills <bcmills@google.com >
Reviewed-by: Tobias Klauser <tobias.klauser@gmail.com >
Reviewed-by: Ian Lance Taylor <iant@google.com >
2023-09-15 18:45:27 +00:00
Kir Kolyshkin
c7cbcbbfad
unix: add TestSockaddrALG
...
Change-Id: I5e5c173289831100360e35cdf2ddd46b173695f9
Reviewed-on: https://go-review.googlesource.com/c/sys/+/527837
Reviewed-by: Bryan Mills <bcmills@google.com >
Reviewed-by: Tobias Klauser <tobias.klauser@gmail.com >
Run-TryBot: Kirill Kolyshkin <kolyshkin@gmail.com >
TryBot-Result: Gopher Robot <gobot@golang.org >
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com >
Auto-Submit: Ian Lance Taylor <iant@google.com >
Reviewed-by: Ian Lance Taylor <iant@google.com >
2023-09-15 15:06:25 +00:00
Kir Kolyshkin
8d9dcc467b
unix: modernize test helpers
...
Test helper functions mktmpfifo and chtmpdir were written
before t.Cleanup was available, which necessitated returning
of a cleanup function and the use of defer.
Let's use t.Cleanup (available since Go 1.14) and simplify the callers.
While at it,
- use t.Helper (added in Go 1.9);
- simplify some error messages (errors that come from os package
usually doesn't need to be wrapped).
Change-Id: Id981ae1c85fa2642a76358a31fc18a9af2f78711
Reviewed-on: https://go-review.googlesource.com/c/sys/+/526695
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com >
Reviewed-by: Ian Lance Taylor <iant@google.com >
Auto-Submit: Ian Lance Taylor <iant@google.com >
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com >
2023-09-14 22:16:50 +00:00
Tobias Klauser
a26c6dedca
unix: use errnoErr in generated wrappers on solaris
...
To prevent allocations at runtime for common errno values (EAGAIN,
EINVAL, ENOENT).
This was omitted from CL 8190 because the solaris port was broken
otherwise at that time.
Change-Id: I6061d071dddf34d0fd022e0ecfb854b01c56b723
Reviewed-on: https://go-review.googlesource.com/c/sys/+/528375
Reviewed-by: Heschi Kreinick <heschi@google.com >
TryBot-Result: Gopher Robot <gobot@golang.org >
Auto-Submit: Tobias Klauser <tobias.klauser@gmail.com >
Reviewed-by: Ian Lance Taylor <iant@google.com >
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com >
Run-TryBot: Ian Lance Taylor <iant@golang.org >
2023-09-14 17:25:13 +00:00
Kir Kolyshkin
5a17ddab9a
unix: remove the use of ioutil
...
Trivial changes.
Change-Id: If7ffa47bb4c3b2bae784091e94516b0f4fc197d2
Reviewed-on: https://go-review.googlesource.com/c/sys/+/526300
Reviewed-by: Tobias Klauser <tobias.klauser@gmail.com >
Reviewed-by: Heschi Kreinick <heschi@google.com >
Run-TryBot: Kirill Kolyshkin <kolyshkin@gmail.com >
TryBot-Result: Gopher Robot <gobot@golang.org >
Reviewed-by: Ian Lance Taylor <iant@google.com >
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com >
Auto-Submit: Tobias Klauser <tobias.klauser@gmail.com >
2023-09-13 18:34:52 +00:00
Kir Kolyshkin
fdc7ef4071
all: remove ioutil usage from tests
...
This removes the remaining (and trivial) use of deprecated ioutil
package from test files.
Replacements are easy:
ioutil.ReadAll -> io.ReadAll
ioutil.ReadDir -> os.ReadDir
ioutil.ReadFile -> os.ReadFile
ioutil.WriteFile -> os.WriteFile
While at it, simplify some error reporting.
Change-Id: I60a242fd3c08d8fe571a18f16716439a9acdd59d
Reviewed-on: https://go-review.googlesource.com/c/sys/+/526299
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com >
Reviewed-by: Heschi Kreinick <heschi@google.com >
Reviewed-by: Ian Lance Taylor <iant@google.com >
Run-TryBot: Kirill Kolyshkin <kolyshkin@gmail.com >
TryBot-Result: Gopher Robot <gobot@golang.org >
Auto-Submit: Tobias Klauser <tobias.klauser@gmail.com >
2023-09-12 16:41:27 +00:00
Kir Kolyshkin
fc717d344a
unix: remove usage of ioutil.TempFile in tests
...
Mostly change that to os.Create(filepath.Join(t.TempDir(), "filename"))
so that the cleanup is done automatically (and, because this is a new
directory, we do not need to have a "create unique temp file name"
logic).
While at it, fix some log/error messages -- if an error is coming from
e.g. os package, it is already wrapped, so there's no need to add more
context.
Change-Id: I62f13679f256b94095be5ca1e77a3fa302f01b97
Reviewed-on: https://go-review.googlesource.com/c/sys/+/526298
Reviewed-by: Heschi Kreinick <heschi@google.com >
Reviewed-by: Ian Lance Taylor <iant@google.com >
Reviewed-by: Tobias Klauser <tobias.klauser@gmail.com >
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com >
TryBot-Result: Gopher Robot <gobot@golang.org >
Auto-Submit: Ian Lance Taylor <iant@google.com >
Run-TryBot: Kirill Kolyshkin <kolyshkin@gmail.com >
2023-09-12 16:41:25 +00:00
Kir Kolyshkin
cb4ecd9fe9
unix: use filepath in tests where appropriate
...
Change-Id: I0b80cdf4fcf48b80139bf4439f4c78954c972382
Reviewed-on: https://go-review.googlesource.com/c/sys/+/527155
TryBot-Result: Gopher Robot <gobot@golang.org >
Auto-Submit: Ian Lance Taylor <iant@google.com >
Reviewed-by: 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 >
Reviewed-by: Heschi Kreinick <heschi@google.com >
Run-TryBot: Ian Lance Taylor <iant@golang.org >
2023-09-12 16:41:14 +00:00
Kir Kolyshkin
0e97d69659
all: use t.TempDir in tests
...
This removes all usage of ioutil.TempDir in tests (and a few cases of
os.TempDir as well, while we're at it), which simplifies test cleanup a
lot.
Compile tested (go test -c) for most platforms (except zos).
Change-Id: I9178f5ec615c0a6cfef36e8de78c6b72e055b7cb
Reviewed-on: https://go-review.googlesource.com/c/sys/+/526297
Reviewed-by: Tobias Klauser <tobias.klauser@gmail.com >
Reviewed-by: Cherry Mui <cherryyz@google.com >
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com >
Reviewed-by: Ian Lance Taylor <iant@google.com >
Reviewed-by: qiulaidongfeng <2645477756@qq.com >
Auto-Submit: Ian Lance Taylor <iant@golang.org >
2023-09-08 15:25:11 +00:00
Kir Kolyshkin
0514fecd90
unix: rm unused zos test helper functions
...
These functions are not used anywhere in zos tests.
Checked with:
git grep -wE 'mktmpfifo|touch|chtmpdir' \
$(git grep -lw zos | grep _test.go; ls *_zos_test.go)
Change-Id: Ie8b25640578e1c607dd4e4f0fe4e7869f8e3f5d3
Reviewed-on: https://go-review.googlesource.com/c/sys/+/526296
Reviewed-by: Tobias Klauser <tobias.klauser@gmail.com >
Reviewed-by: Cherry Mui <cherryyz@google.com >
Reviewed-by: Ian Lance Taylor <iant@google.com >
Auto-Submit: Ian Lance Taylor <iant@google.com >
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com >
Reviewed-by: Dustin Ward <wardddustin@gmail.com >
2023-09-07 23:38:50 +00:00
Tobias Klauser
bfd1ebb2bc
unix: remove unused ptracePtr on darwin
...
ptracePtr was introduced in CL 469835 for darwin but it's not used on
this platform. Also, the argument types for addr and data were swapped
in the generated ptrace1Ptr (probably because the change was not
generated but done manually).
This change also includes generated changes moving some definitions in
zsyscall_darwin_*.go and removing some empty lines in
zsyscall_darwin_*.s. These changes result from running ./mkall on
darwin/amd64 and darwin/arm64.
For golang/go#58387
Change-Id: I90bba3be7fbc8c77815450d0b666a2948b63fab0
Reviewed-on: https://go-review.googlesource.com/c/sys/+/526455
Auto-Submit: Tobias Klauser <tobias.klauser@gmail.com >
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 >
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com >
2023-09-07 20:52:23 +00:00
Dmitri Shuralyov
81cb935067
unix, windows: use ^TestName$ regular pattern for invoking a single test
...
For reasons motivated in the commit message of CL 524948.
Change-Id: I0085411f30a77634962239ee36d15e7b6ef893ef
Reviewed-on: https://go-review.googlesource.com/c/sys/+/525618
Auto-Submit: Dmitri Shuralyov <dmitshur@golang.org >
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com >
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com >
Reviewed-by: Ian Lance Taylor <iant@google.com >
2023-09-06 00:53:53 +00:00
chenguoqi
51546915a6
unix/linux: update to gcc 13.2.0, qemu 8.0.3 for loong64 and and Go 1.21.0 for all
...
Running `GOOS=linux GOARCH={amd64,arm64,loong64,mips64le,riscv64} ./mkall.sh`
produces no changes, as expected.
Update Loong64's cross toolchain to support for the ELF psABI v2.0 relocs [1].
Updates #58784 .
[1]: https://loongson.github.io/LoongArch-Documentation/LoongArch-ELF-ABI-EN.html
Change-Id: I676893b934d8cfc30b9f3702fc92a5ab82f7f116
Reviewed-on: https://go-review.googlesource.com/c/sys/+/483455
Auto-Submit: Tobias Klauser <tobias.klauser@gmail.com >
Auto-Submit: Ian Lance Taylor <iant@google.com >
Reviewed-by: Meidan Li <limeidan@loongson.cn >
Run-TryBot: Ian Lance Taylor <iant@google.com >
Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com >
Reviewed-by: Tobias Klauser <tobias.klauser@gmail.com >
TryBot-Result: Gopher Robot <gobot@golang.org >
Reviewed-by: Bryan Mills <bcmills@google.com >
Reviewed-by: Ian Lance Taylor <iant@google.com >
2023-08-25 20:53:44 +00:00
Andy Pan
552c4e8192
unix: avoid setting O_NONBLOCK needlessly by checking flags beforehand
...
Change-Id: I227118221df469a677f3ff140ca7b94acb7f9571
Reviewed-on: https://go-review.googlesource.com/c/sys/+/517576
TryBot-Result: Gopher Robot <gobot@golang.org >
Reviewed-by: Michael Knyszek <mknyszek@google.com >
Run-TryBot: Andy Pan <panjf2000@gmail.com >
Reviewed-by: Ian Lance Taylor <iant@google.com >
Reviewed-by: Tobias Klauser <tobias.klauser@gmail.com >
Run-TryBot: Ian Lance Taylor <iant@google.com >
Auto-Submit: Ian Lance Taylor <iant@google.com >
2023-08-10 14:36:31 +00:00
Kir Kolyshkin
ee578879d8
unix: add SchedSetAttr and SchedGetAttr for Linux
...
Add wrappers for sched_getattr(2) and sched_setattr(2), as well as
various SCHED_ values usable for these.
The kludge in linux/types.go is needed so we can include both
linux/sched/types.h (for struct sched_attr) and sched.h (for a few
defines from include/bits/cpu-set.h).
Unfortunately, they both define struct sched_param, thus the need to
mask one of the definitions.
Change-Id: I3e13cf49ccef7ae81a75d33826d18de84a52106d
Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com >
Reviewed-on: https://go-review.googlesource.com/c/sys/+/516756
Reviewed-by: Ian Lance Taylor <iant@google.com >
Auto-Submit: Ian Lance Taylor <iant@google.com >
Run-TryBot: Ian Lance Taylor <iant@golang.org >
Reviewed-by: Michael Knyszek <mknyszek@google.com >
TryBot-Result: Gopher Robot <gobot@golang.org >
Run-TryBot: Ian Lance Taylor <iant@google.com >
2023-08-09 15:08:02 +00:00
Mark Ryan
104d4017fa
unix: add riscv_hwprobe for riscv64
...
The riscv_hwprobe system call was introduced in Linux 6.4 and allows
the caller to determine a number of interesting pieces of information
about the underlying RISC-V CPUs, e.g., which extensions they support
and whether they allow fast unaligned memory accesses. For more information
please see:
https://docs.kernel.org/riscv/hwprobe.html
We also update linux/mksysnum.go to ensure that the generated syscall constants
written to the zsysnum_linux_*.go files are always sorted by their syscall numbers
in ascending order.
Updates golang/go#61416
Change-Id: Iedb0a86adb65faac9061b9a5969ffa09eb5b303a
Reviewed-on: https://go-review.googlesource.com/c/sys/+/510795
TryBot-Result: Gopher Robot <gobot@golang.org >
Reviewed-by: Matthew Dempsky <mdempsky@google.com >
Auto-Submit: Ian Lance Taylor <iant@google.com >
Reviewed-by: Ian Lance Taylor <iant@google.com >
Run-TryBot: Ian Lance Taylor <iant@google.com >
2023-07-26 11:14:25 +00:00
Ed Schouten
70f4e408de
unix: retry fetching of lists through sysctl if the size changes
...
On macOS, the SysctlKinfoProcSlice() function may be used to fetch the contents of the process table. As the process table may grow between the first and second call to sysctl(), the second call may fail with ENOMEM. In that case we simply need to retry.
Change-Id: I40229653ed383603c33762f37b0dc2e7de47bcb6
GitHub-Last-Rev: b63b6b8471
GitHub-Pull-Request: golang/sys#169
Reviewed-on: https://go-review.googlesource.com/c/sys/+/513036
Run-TryBot: Ian Lance Taylor <iant@google.com >
Auto-Submit: Ian Lance Taylor <iant@google.com >
TryBot-Result: Gopher Robot <gobot@golang.org >
Reviewed-by: Matthew Dempsky <mdempsky@google.com >
Run-TryBot: Ian Lance Taylor <iant@golang.org >
Reviewed-by: Ian Lance Taylor <iant@google.com >
2023-07-26 11:12:51 +00:00
Lorenz Brun
ad7130c58d
unix: add more block device ioctl numbers
...
This adds a few additional ioctl numbers for performing various block
device operations.
Change-Id: I1dc836f4017bbc175b2dee759fece728f1caa010
Reviewed-on: https://go-review.googlesource.com/c/sys/+/511597
Auto-Submit: Ian Lance Taylor <iant@google.com >
Reviewed-by: Ian Lance Taylor <iant@google.com >
Reviewed-by: Bryan Mills <bcmills@google.com >
Run-TryBot: Bryan Mills <bcmills@google.com >
Run-TryBot: Ian Lance Taylor <iant@google.com >
TryBot-Result: Gopher Robot <gobot@golang.org >
2023-07-20 23:00:54 +00:00
cui fliter
c406141231
all: fix some typos
...
Change-Id: Id4bf4ce8aee8b98baa2f1a9c62a72a9554f7d557
Reviewed-on: https://go-review.googlesource.com/c/sys/+/510595
TryBot-Result: Gopher Robot <gobot@golang.org >
Run-TryBot: Ian Lance Taylor <iant@google.com >
Auto-Submit: Ian Lance Taylor <iant@google.com >
Run-TryBot: shuang cui <imcusg@gmail.com >
Reviewed-by: Ian Lance Taylor <iant@google.com >
Reviewed-by: Heschi Kreinick <heschi@google.com >
2023-07-19 19:13:37 +00:00
Mauri de Souza Meneguzzo
25d0004552
unix: fix last argument of pselect6 on linux
...
On Linux, the last argument of pselect6 system call is **not** a
sigseg_t * pointer, but instead it is a structure of the form:
struct {
const sigset_t *ss; /* Pointer to signal set */
size_t ss_len; /* Size (in bytes) of object pointed
};
See man 2 pselect6.
Fixes #61251
Change-Id: Id0aa122a77796713bc6d624dc395d396fbc0c5e2
GitHub-Last-Rev: cb3c6d7da9
GitHub-Pull-Request: golang/sys#167
Reviewed-on: https://go-review.googlesource.com/c/sys/+/510195
Reviewed-by: Bryan Mills <bcmills@google.com >
Reviewed-by: Ian Lance Taylor <iant@google.com >
TryBot-Result: Gopher Robot <gobot@golang.org >
Run-TryBot: Ian Lance Taylor <iant@google.com >
Auto-Submit: Ian Lance Taylor <iant@google.com >
2023-07-19 00:01:56 +00:00
Tobias Klauser
3fead03e7d
unix: add Mremap for netbsd
...
Fixes golang/go#60409
Change-Id: I2d872a1a6fb63c27ab3753deff370e1c2f752bdd
Reviewed-on: https://go-review.googlesource.com/c/sys/+/508397
Auto-Submit: Tobias Klauser <tobias.klauser@gmail.com >
Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com >
Reviewed-by: Benny Siegert <bsiegert@gmail.com >
TryBot-Result: Gopher Robot <gobot@golang.org >
Reviewed-by: Ian Lance Taylor <iant@google.com >
2023-07-13 05:43:33 +00:00
Tobias Klauser
a1a9c4b846
unix/linux: update to Linux kernel 6.4 and Go 1.21rc2
...
Also fix the glibc 2.37 release date in a comment.
Change-Id: Ibd972a2846f0085bacf67c847ce4726bf130d5ba
Reviewed-on: https://go-review.googlesource.com/c/sys/+/506017
TryBot-Result: Gopher Robot <gobot@golang.org >
Auto-Submit: Carlos Amedee <carlos@golang.org >
Reviewed-by: Ian Lance Taylor <iant@google.com >
Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com >
Reviewed-by: Carlos Amedee <carlos@golang.org >
2023-06-27 17:19:37 +00:00
Jordan Whited
d1abdad3a4
unix/linux: update TUN flags and virtio_net_hdr constants
...
TUN_F_USO{4,6} and VIRTIO_NET_HDR_GSO_UDP_L4 are new in Linux v6.2.
Change-Id: I7e3dc34118d1c03afeb87fb8699d8167a6e49b7f
GitHub-Last-Rev: c658b9bf0f
GitHub-Pull-Request: golang/sys#165
Reviewed-on: https://go-review.googlesource.com/c/sys/+/506455
Reviewed-by: Carlos Amedee <carlos@golang.org >
Auto-Submit: Carlos Amedee <carlos@golang.org >
TryBot-Result: Gopher Robot <gobot@golang.org >
Reviewed-by: Tobias Klauser <tobias.klauser@gmail.com >
Run-TryBot: Ian Lance Taylor <iant@golang.org >
Run-TryBot: Ian Lance Taylor <iant@google.com >
Reviewed-by: Ian Lance Taylor <iant@google.com >
Auto-Submit: Ian Lance Taylor <iant@google.com >
2023-06-27 15:33:31 +00:00
Anton Kuklin
e0c3b6e6ae
unix: add Mremap for linux
...
For golang/go#60409
Change-Id: I75a9732ee996f0aeb91599d80803f96ada468c27
GitHub-Last-Rev: c348b6194d
GitHub-Pull-Request: golang/sys#164
Reviewed-on: https://go-review.googlesource.com/c/sys/+/502715
Auto-Submit: Ian Lance Taylor <iant@google.com >
TryBot-Result: Gopher Robot <gobot@golang.org >
Reviewed-by: Bryan Mills <bcmills@google.com >
Reviewed-by: Ian Lance Taylor <iant@google.com >
Run-TryBot: Ian Lance Taylor <iant@google.com >
2023-06-16 19:37:35 +00:00
Tobias Klauser
ca096e46e8
unix: add missing IFLA_* consts on linux
...
Change-Id: Ib221d98f8d7e5aac7ff2db207cdd92145fe1dc60
Reviewed-on: https://go-review.googlesource.com/c/sys/+/503715
Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com >
Reviewed-by: Ian Lance Taylor <iant@google.com >
Auto-Submit: Tobias Klauser <tobias.klauser@gmail.com >
TryBot-Result: Gopher Robot <gobot@golang.org >
Reviewed-by: Bryan Mills <bcmills@google.com >
2023-06-16 18:27:27 +00:00
Tobias Klauser
df9fef2097
unix/linux: update to Linux kernel 6.3 and Go 1.20.5
...
Change-Id: I347341ae0e45e73477e9a310a3749d37bafa8da7
Reviewed-on: https://go-review.googlesource.com/c/sys/+/503255
Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com >
Reviewed-by: Ian Lance Taylor <iant@google.com >
Auto-Submit: Tobias Klauser <tobias.klauser@gmail.com >
Reviewed-by: Bryan Mills <bcmills@google.com >
TryBot-Result: Gopher Robot <gobot@golang.org >
2023-06-16 18:27:25 +00:00