Commit Graph

1587 Commits

Author SHA1 Message Date
Nuno Cruces
39dbc8e308 API tweaks, tests. 2024-06-24 15:48:17 +01:00
Nuno Cruces
be024e2a16 x/sys: add unsafe mmap, munmap, mremap
Fixes golang/go#56123
2024-06-13 15:03:10 +01:00
Alex Brainman
348425aa18 windows/svc: do not pass theService to windows.RegisterServiceCtrlHandlerEx
windows.RegisterServiceCtrlHandlerEx context parameter is uintptr, so it
is unsafe to pass pointers in that parameter. Use theService global
variable in ctlHandler function instead.

Fixes golang/go#67437

Change-Id: I84c910eaa354603c2a5114421cd61788cb40b86f
Reviewed-on: https://go-review.googlesource.com/c/sys/+/591475
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Michael Pratt <mpratt@google.com>
Reviewed-by: Quim Muntal <quimmuntal@gmail.com>
Reviewed-by: David Chase <drchase@google.com>
2024-06-13 07:32:15 +00:00
Meng Zhuo
673e0f94c1 unix: skip ethtool driver test for busy interface
This CL skips IoctlGetEthtoolDrvinfo on busy interface tests since
ethtool getting the same result too.

Fixes golang/go#67350

Change-Id: Ia65678e3caab8a9dd42b9cdb8e4cb7f7f0b476da
Reviewed-on: https://go-review.googlesource.com/c/sys/+/586435
Reviewed-by: Tobias Klauser <tobias.klauser@gmail.com>
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
Reviewed-by: Cherry Mui <cherryyz@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
v0.21.0
2024-05-17 15:15:09 +00:00
Mauri de Souza Meneguzzo
6943ab67c4 unix/linux: update glibc to 2.39
Change-Id: I5c2b996180073ca10f1b7c86201a19eaf0557e43
GitHub-Last-Rev: a092f56935
GitHub-Pull-Request: golang/sys#195
Reviewed-on: https://go-review.googlesource.com/c/sys/+/585136
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>
2024-05-13 22:24:33 +00:00
Mauri de Souza Meneguzzo
92f3ad6e7f unix: update to Linux kernel 6.9
Change-Id: Ib7bd9dabfcb8234c522ec357d32bfa3e87af53db
GitHub-Last-Rev: 4bea205222
GitHub-Pull-Request: golang/sys#194
Reviewed-on: https://go-review.googlesource.com/c/sys/+/585135
Reviewed-by: Dmitri Shuralyov <dmitshur@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: Mauri de Souza Meneguzzo <mauri870@gmail.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
2024-05-13 21:43:45 +00:00
JoeyShapiro
f34bb9fccc windows: add net user enum
In the go windows package, you can get user information by using
`NetUserGetInfo` along with a specified level. However, there is
no way to get a list of the users.
The only options are to
1. know the users,
2. brute force users, or
3. use an external tool or command (`net users`).

I suggest adding a function that implements the windows api for
`NetUserEnum`. This will allow a built in way to enumerate
users and follow the standard.

A side note is that I used `buf **byte` because
it is how the others are done, but using `buf *byte`
works just as well.

Change-Id: Ifcc916659eb1d796175cd18acd2e81f2661bfcd2
GitHub-Last-Rev: 3d01bca920
GitHub-Pull-Request: golang/sys#190
Reviewed-on: https://go-review.googlesource.com/c/sys/+/578475
Reviewed-by: Alex Brainman <alex.brainman@gmail.com>
Auto-Submit: Cherry Mui <cherryyz@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: David Chase <drchase@google.com>
Reviewed-by: Cherry Mui <cherryyz@google.com>
2024-05-09 17:46:52 +00:00
Florian Lehner
6dfb94eaa3 unix: add types for SOCK_DIAG
Change-Id: Ifcc90735b6e42b6c9971d4ba15c31b8169e005fe
Reviewed-on: https://go-review.googlesource.com/c/sys/+/579996
Reviewed-by: Cherry Mui <cherryyz@google.com>
Reviewed-by: Ian Lance Taylor <iant@google.com>
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>
2024-05-06 17:39:26 +00:00
dustin-ward
7d69d983c4 unix: extend support for z/OS
This change syncs the IBM internal version of sys/unix with the public
repository.

There are a variety of new syscalls and const definitions that have been
accumulated over the past few years to support developers using Go on
the platform. Old simulations of calls like 'epoll' and 'fstatfs' have
been replaced with their real counterparts. The zos/s390x syscalls also
have extensive trampolining to handle zos systems that might not have
support for some of these new system calls.

Closes golang/go#67071

Change-Id: I973d9e0abca2b05365308cf2b890438e50ae5957
Reviewed-on: https://go-review.googlesource.com/c/sys/+/582035
Reviewed-by: David Chase <drchase@google.com>
Reviewed-by: Bill O'Farrell <billotosyr@gmail.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>
v0.20.0
2024-05-03 20:28:26 +00:00
Michal Hruby
7758090324 cpu: add support for sve2 detection
Fixes golang/go#66952

Change-Id: Idaf2ce3b09baf33cf29079677a83a51ea9c4b255
GitHub-Last-Rev: eac00886d1
GitHub-Pull-Request: golang/sys#193
Reviewed-on: https://go-review.googlesource.com/c/sys/+/580655
Reviewed-by: Ian Lance Taylor <iant@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Auto-Submit: Ian Lance Taylor <iant@google.com>
Reviewed-by: David Chase <drchase@google.com>
Reviewed-by: Tobias Klauser <tobias.klauser@gmail.com>
2024-05-03 16:45:19 +00:00
Tobias Klauser
9a28524796 windows: drop go version tags for unsupported versions
go.mod specifies go 1.18. Drop go1.n version tags for older, unsupported
versions.

Change-Id: I7a23a9f4ba558999ac417b7b4647fa1061d69c06
Reviewed-on: https://go-review.googlesource.com/c/sys/+/566038
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: Quim Muntal <quimmuntal@gmail.com>
Reviewed-by: Cherry Mui <cherryyz@google.com>
2024-04-16 22:18:47 +00:00
Tobias Klauser
27dc90bcf4 unix: update to Linux kernel 6.4
Change-Id: I88b628a97f5cfb76083968be2ff2e9857ce56557
Reviewed-on: https://go-review.googlesource.com/c/sys/+/577975
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: Carlos Amedee <carlos@golang.org>
2024-04-11 16:37:17 +00:00
Tom Payne
cabba82f75 windows: use uint32 for serial comm flags for consistency
This is a follow-up to https://go-review.googlesource.com/c/sys/+/572295
and specifically the comment
https://go-review.googlesource.com/c/sys/+/572295/comment/a00e1a2e_e3b01666/.

All other structs and methods us uint32 in golang.org/x/sys/windows
for flag bitmasks, so make the serial communication structs use uint32
to be consistent with the rest of the package.

As a side effect the DTR_CONTROL_* and RTS_CONTROL_* constants are
updated to reflect the positions of the bits in the 32-bit flags.

Change-Id: Ie19774a8ef5411d7df1e5b0d36806aa1d401fa86
GitHub-Last-Rev: bc93d94a45
GitHub-Pull-Request: golang/sys#189
Reviewed-on: https://go-review.googlesource.com/c/sys/+/575635
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
Auto-Submit: Dmitri Shuralyov <dmitshur@golang.org>
Reviewed-by: Alex Brainman <alex.brainman@gmail.com>
Reviewed-by: Than McIntosh <thanm@google.com>
v0.19.0
2024-04-04 14:40:38 +00:00
Tom Payne
1a50d9738b windows: add serial comm functions
Serial ports are still widely used to communicate with a large range of
devices.

This change adds the remaining functions described in "Serial
Communications in Win32", enabling Go applications and libraries to be
written that support the full set of serial port functionality on
Windows.

x/sys/unix already has equivalent functionality through termios.

See https://learn.microsoft.com/en-us/previous-versions/ms810467(v=msdn.10).

Change-Id: I57f9ed6b7dbcc2331f740bd95b6483f141b0ad6f
GitHub-Last-Rev: 0a5a7441ce
GitHub-Pull-Request: golang/sys#187
Reviewed-on: https://go-review.googlesource.com/c/sys/+/572295
Reviewed-by: David Chase <drchase@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Than McIntosh <thanm@google.com>
Reviewed-by: Alex Brainman <alex.brainman@gmail.com>
2024-04-02 01:45:51 +00:00
Peter Hoogendijk
95f07eca87 x/sys/windows: add func windows.DisconnectNamedPipe(handle Handle) (err error)
Fixes golang/go#66234

Change-Id: I1e4a94e1ca8c01a29bab18e0bf12238c511fe1c6
Reviewed-on: https://go-review.googlesource.com/c/sys/+/570435
Reviewed-by: Quim Muntal <quimmuntal@gmail.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Michael Knyszek <mknyszek@google.com>
Reviewed-by: Alex Brainman <alex.brainman@gmail.com>
Reviewed-by: Cherry Mui <cherryyz@google.com>
2024-03-12 20:49:51 +00:00
Mackenzie Malainey
4be02d3543 unix: expose mmap calls on z/OS
The calls `Mmap` and `Munmap` were removed for z/OS.
Syscall removed occurred in: 508397

This change exposes them in a z/OS specific file
(to remove the accidental deletion of them in future refactors of the APIs for `unix-like` OSes).

Change-Id: Ice0cabfb4547cab2ffa7130b7c26d9cc38233afe
GitHub-Last-Rev: e7b4680e63
GitHub-Pull-Request: golang/sys#186
Reviewed-on: https://go-review.googlesource.com/c/sys/+/569359
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Ian Lance Taylor <iant@google.com>
Auto-Submit: Ian Lance Taylor <iant@google.com>
Reviewed-by: Michael Knyszek <mknyszek@google.com>
2024-03-08 16:26:02 +00:00
Ilya Hanov
360f961f89 unix: add API for fsconfig system call
Fixes golang/go#59537

Change-Id: I8d806ace3adad423c633813455d8f758706cee1d
Reviewed-on: https://go-review.googlesource.com/c/sys/+/484995
Reviewed-by: Than McIntosh <thanm@google.com>
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>
v0.18.0
2024-02-16 13:31:09 +00:00
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
Yuval Pavel Zholkover
6b4eab51c2 unix: suppress ENOMEM errors from sysctl's implementing Uname(uname *Utsname) on FreeBSD due to truncated fields.
Fixes golang/go#65585.

Change-Id: I7e529eaef224be977e3b0c20d071802f49b297e7
Reviewed-on: https://go-review.googlesource.com/c/sys/+/562617
Reviewed-by: Than McIntosh <thanm@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: Ian Lance Taylor <iant@google.com>
2024-02-13 14:35:18 +00:00
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
qmuntal
914b96c1bd windows: support ill-formed UTF-16 in UTF16PtrToString
UTF16PtrToString does not support ill-formed UTF-16 because it uses
utf16.Decode, which expects well-formed UTF-16.

This CL updates the UTF16PtrToString implementation to use
UTF16ToString instead of utf16.Decode, which supports ill-formed
UTF-16 since go1.21 via syscall.UTF16ToString.

Change-Id: Ifb72b6d38a8c08ad90ec6a47eed05fc3739500a1
Reviewed-on: https://go-review.googlesource.com/c/sys/+/560355
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Bryan Mills <bcmills@google.com>
Reviewed-by: Michael Knyszek <mknyszek@google.com>
v0.17.0
2024-02-01 17:02:20 +00:00
Bryan Mills
511ec846b6 Revert "windows: support nil done parameter in ReadFile and WriteFile"
This reverts CL 559375.

Reason for revert: introduced a different regression (golang/go#65378).

Fixes golang/go#65378.
Updates golang/go#65365.

Change-Id: Ie2a602415913b04b9d9b65fee5c6a54c0267b35e
Cq-Include-Trybots: luci.golang.try:x_sys-gotip-windows-amd64-longtest
Reviewed-on: https://go-review.googlesource.com/c/sys/+/559502
Auto-Submit: Bryan Mills <bcmills@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Michael Knyszek <mknyszek@google.com>
2024-01-30 20:43:58 +00:00
qmuntal
628365db92 windows: support nil done parameter in ReadFile and WriteFile
Win32 defines the `done` param as optional for ReadFile and WriteFile
functions. We should support this case too.

Fixes golang/go#65365.

Change-Id: I961ff66a63d3a8ffa5560b6dab21fbd4ac9817ae
Reviewed-on: https://go-review.googlesource.com/c/sys/+/559375
Reviewed-by: Mauri de Souza Meneguzzo <mauri870@gmail.com>
Reviewed-by: Bryan Mills <bcmills@google.com>
Reviewed-by: Michael Knyszek <mknyszek@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
2024-01-30 17:14:39 +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
Bryan C. Mills
b3ce6a356e windows: build env_windows_test.go only go Go 1.21 and above
This test imports the "slices" package, which did not exist in Go 1.20.
The test passes on Go 1.21 and above, and the behavior of the function
under test is unlikely to vary by platform, so it doesn't seem worth
refactoring the test to work with older releases.

Updates golang/go#65055.
Fixes golang/go#65223.

Change-Id: I5f32106d6057b779579a87750633bc57f97fe152
Cq-Include-Trybots: luci.golang.try:x_sys-go1.20-windows-386,x_sys-go1.20-windows-amd64-longtest
Reviewed-on: https://go-review.googlesource.com/c/sys/+/557975
Auto-Submit: Bryan Mills <bcmills@google.com>
Reviewed-by: Cherry Mui <cherryyz@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
2024-01-23 20:45:08 +00:00
Kamyar Mirzavaziri
c3fa2b8b41 windows: fix parsing of non-ASCII entries in token.Environ
Fixes golang/go#65055, the unexpected behavior of token.Environ in parsing entries containing runes larger than 2 bytes in size

Change-Id: I753d2c605e3a2d7a1d90cd18601d6b918f0d3f7a
Reviewed-on: https://go-review.googlesource.com/c/sys/+/556895
Auto-Submit: Bryan Mills <bcmills@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Cherry Mui <cherryyz@google.com>
Reviewed-by: Bryan Mills <bcmills@google.com>
Reviewed-by: Quim Muntal <quimmuntal@gmail.com>
2024-01-23 00:04:46 +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
Kanak Agrawal
0829ab15b6 windows: add SetFileValidData
Fixes golang/go#61834

Change-Id: Iaff01f5662aa2309e8ac41b346e0d3a42d28af91
Reviewed-on: https://go-review.googlesource.com/c/sys/+/517575
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Alex Brainman <alex.brainman@gmail.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Run-TryBot: Quim Muntal <quimmuntal@gmail.com>
Reviewed-by: Quim Muntal <quimmuntal@gmail.com>
Reviewed-by: Keith Randall <khr@google.com>
v0.16.0
2024-01-03 06:57:32 +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>
v0.15.0
2023-11-18 01:08:36 +00:00
Roland Shoemaker
11eadc05e9 windows: add AddDllDirectory and RemoveDllDirectory
Per https://learn.microsoft.com/en-us/windows/win32/api/libloaderapi/nf-libloaderapi-adddlldirectory
and https://learn.microsoft.com/en-us/windows/win32/api/libloaderapi/nf-libloaderapi-removedlldirectory.

Change-Id: If44a3758720345d1bbd9af96ec2481fbe9398a08
Reviewed-on: https://go-review.googlesource.com/c/sys/+/537755
Reviewed-by: Tatiana Bradley <tatianabradley@google.com>
Auto-Submit: Roland Shoemaker <roland@golang.org>
Reviewed-by: Alex Brainman <alex.brainman@gmail.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
2023-11-13 16:23:13 +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>
v0.14.0
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
AN Long
8ccaaf02a4 windows: add GetFileTime
Add a simple Windows API GetFileTime.
The document is https://learn.microsoft.com/en-us/windows/win32/api/fileapi/nf-fileapi-getfiletime

Fixes golang/go#21541

Change-Id: Ia7b8385d27348b2abc0ee560c5bd7e66cb6d13f2
GitHub-Last-Rev: 6700dccbad
GitHub-Pull-Request: golang/sys#174
Reviewed-on: https://go-review.googlesource.com/c/sys/+/528015
Reviewed-by: Michael Pratt <mpratt@google.com>
Reviewed-by: Alex Brainman <alex.brainman@gmail.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Run-TryBot: Alex Brainman <alex.brainman@gmail.com>
Auto-Submit: Michael Pratt <mpratt@google.com>
Reviewed-by: Ian Lance Taylor <iant@google.com>
2023-10-06 20:50:44 +00:00
database64128
6ee6208a59 windows: add missing TCP and UDP socket options and control message types
Source: ws2ipdef.h

Change-Id: Ie9c6e2cec839a09b7e59239f1d5b50664a310f1d
GitHub-Last-Rev: 14b916938b
GitHub-Pull-Request: golang/sys#173
Reviewed-on: https://go-review.googlesource.com/c/sys/+/525256
Reviewed-by: Alex Brainman <alex.brainman@gmail.com>
Reviewed-by: Ian Lance Taylor <iant@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Run-TryBot: Alex Brainman <alex.brainman@gmail.com>
Reviewed-by: Michael Pratt <mpratt@google.com>
2023-10-06 20:48:55 +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>
v0.13.0
2023-09-28 17:55:56 +00:00
Bryan C. Mills
3186bae2c3 windows: remove the 8192-codepoint arg limit in FuzzComposeCommandLine
It just occurred to me that the observed limit was almost certainly a
side effect of the Go wrapper for CommandLineToArgv (golang/go#63236)
rather than a behavior of the system call itself.

Updates golang/go#63236.
Updates golang/go#58817.

Change-Id: Icc9db01f201f54a78044d1c48e0883e098cfb5e5
Cq-Include-Trybots: luci.golang.try:x_sys-gotip-windows-amd64-longtest
Reviewed-on: https://go-review.googlesource.com/c/sys/+/531176
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Auto-Submit: Bryan Mills <bcmills@google.com>
Reviewed-by: Quim Muntal <quimmuntal@gmail.com>
Reviewed-by: Than McIntosh <thanm@google.com>
2023-09-27 14:34:16 +00:00