Ayman Bagabas
8e9e04625d
windows: add virtual key codes and console input consts
...
This adds console input related key codes and consts
Change-Id: I8ebd76995a2c9ddd150cf04890a9e5053841fcab
GitHub-Last-Rev: 8e534f4589
GitHub-Pull-Request: golang/sys#226
Reviewed-on: https://go-review.googlesource.com/c/sys/+/621495
Reviewed-by: Junyang Shao <shaojunyang@google.com >
Auto-Submit: Michael Pratt <mpratt@google.com >
Reviewed-by: Michael Pratt <mpratt@google.com >
Reviewed-by: Alex Brainman <alex.brainman@gmail.com >
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com >
2025-04-22 10:17:31 -07:00
Keith Randall
7138967c19
windows: fix slicing of NTUnicodeString values
...
We were slicing using a count of bytes, not a count of uint16s.
Fixes golang/go#73460
Change-Id: If0fd19e795078c01fda5b976e3c34af115b25dcc
Reviewed-on: https://go-review.googlesource.com/c/sys/+/667235
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com >
Reviewed-by: Junyang Shao <shaojunyang@google.com >
Reviewed-by: Quim Muntal <quimmuntal@gmail.com >
Auto-Submit: Keith Randall <khr@google.com >
Reviewed-by: Keith Randall <khr@google.com >
2025-04-22 08:26:09 -07:00
thepudds
6a85559a3f
windows: fix dangling pointers in (*SECURITY_DESCRIPTOR).ToAbsolute
...
Prior to this CL, a byte slice was allocated via make to use as the
absoluteSD argument passed to the Windows API MakeAbsoluteSD.
MakeAbsoluteSD then sets pointers outside the view of the GC, including
pointers within absoluteSD that point to other chunks of memory
we pass into MakeAbsoluteSD.
CL 653856 recently allowed more make results to be stack allocated,
which worsened the problems here and made it easier for those
pointers in absoluteSD to become dangling pointers, though the
core problems here existed before.
This CL instead allocates absoluteSD as a proper SECURITY_DESCRIPTOR
struct so that the GC can be aware of its pointers. We also verify the
pointers are as we expect, and then set them explicitly
in view of the GC.
Updates golang/go#73199
Change-Id: Id8038d38a887bb8ff3ffc6eae603589b97e92cdc
Reviewed-on: https://go-review.googlesource.com/c/sys/+/663355
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com >
Reviewed-by: Keith Randall <khr@google.com >
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com >
Auto-Submit: Dmitri Shuralyov <dmitshur@golang.org >
Reviewed-by: Keith Randall <khr@golang.org >
2025-04-09 11:19:55 -07:00
Tobias Klauser
01aaa8342f
all: simplify code by using modern Go constructs
...
Generated using modernize by running:
go run golang.org/x/tools/gopls/internal/analysis/modernize/cmd/modernize@latest -fix -test ./...
Change-Id: Ifc7d61cf6735cc53f2bdf890a338961f55075af5
Reviewed-on: https://go-review.googlesource.com/c/sys/+/661975
Auto-Submit: Tobias Klauser <tobias.klauser@gmail.com >
Reviewed-by: Carlos Amedee <carlos@golang.org >
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com >
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com >
v0.32.0
2025-04-03 13:04:48 -07:00
Douglas Danger Manley
1b2bd6bb49
windows: replace all StringToUTF16 calls with UTF16FromString
...
`StringToUTF16` is deprecated and will panic if given an "invalid"
string (in particular, one that has a null byte in it). The replacement
function is `UTF16FromString`, and it returns an error if there was
a problem.
This change replaces all uses of `StringToUTF16` with `UTF16FromString`.
The `service` struct now no longer stores a `string` name but rather
a `*uint16` pointer to the name.
It should not be possible to panic due to UTF16 string conversion
at this point.
Fixes golang/go#73006
Change-Id: Idce9cdbb4651fef8481f0cad19b5df0314fd4277
Reviewed-on: https://go-review.googlesource.com/c/sys/+/659936
Reviewed-by: Carlos Amedee <carlos@golang.org >
Auto-Submit: Carlos Amedee <carlos@golang.org >
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 >
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com >
2025-04-02 11:32:38 -07:00
Mauri de Souza Meneguzzo
1c3b72f1c1
unix: update Linux kernel to 6.14
...
No new syscalls or constants in this release, just bumping the version number.
Change-Id: I97f7e1092bb78d99342552ba18e1ea3cd40681f4
GitHub-Last-Rev: df5cca1a90
GitHub-Pull-Request: golang/sys#247
Reviewed-on: https://go-review.googlesource.com/c/sys/+/660375
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 >
2025-03-26 05:30:21 -07:00
database64128
c175b6ba67
windows: add cmsghdr and pktinfo structures
...
- CMSGHDR from ws2def.h, corresponds to Cmsghdr in unix
- IN_PKTINFO from ws2ipdef.h, corresponds to InetPktinfo in unix
- IN6_PKTINFO from ws2ipdef.h, corresponds to Inet6Pktinfo in unix
Change-Id: I74f6812588859c3a6080e6675df28998fc435965
GitHub-Last-Rev: 7377c793c6
GitHub-Pull-Request: golang/sys#246
Reviewed-on: https://go-review.googlesource.com/c/sys/+/658175
Reviewed-by: Cherry Mui <cherryyz@google.com >
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com >
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com >
Reviewed-by: Alex Brainman <alex.brainman@gmail.com >
2025-03-26 01:10:13 -07:00
Manuel Schönlaub
3330b5e756
unix: support Readv, Preadv, Writev and Pwritev for darwin
...
Darwin, starting with Big Sur, supports vectorized IO.
Fixes golang/go#64710
Change-Id: Ic3a3c51009eab24f70665d8d3a145b328a7713c6
Reviewed-on: https://go-review.googlesource.com/c/sys/+/548795
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 >
Reviewed-by: Cherry Mui <cherryyz@google.com >
2025-03-20 08:06:05 -07:00
Guoqi Chen
7401cce313
cpu: replace specific instructions with WORD in the function get_cpucfg on loong64
...
The CPUCFG instruction on loong64 was introduced in Go1.24, which caused
compilation errors when using this feature in Go1.23 and earlier versions.
Change-Id: I68891bbfc527194ecdafebac3398e700bfb53c2f
Reviewed-on: https://go-review.googlesource.com/c/sys/+/656915
Reviewed-by: Meidan Li <limeidan@loongson.cn >
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com >
Reviewed-by: David Chase <drchase@google.com >
Reviewed-by: Junyang Shao <shaojunyang@google.com >
2025-03-12 17:52:00 -07:00
Guoqi Chen
b8f7da6c5a
cpu: add support for detecting cpu features on loong64
...
Except for lasx, all other features have been implemented
in the Go mainline.
Change-Id: I61a09396ed23d17991b641a1265e952585cb5636
Reviewed-on: https://go-review.googlesource.com/c/sys/+/655355
Reviewed-by: David Chase <drchase@google.com >
Reviewed-by: sophie zhao <zhaoxiaolin@loongson.cn >
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com >
Reviewed-by: Junyang Shao <shaojunyang@google.com >
Reviewed-by: Meidan Li <limeidan@loongson.cn >
2025-03-11 18:36:47 -07:00
database64128
f2ce62c21a
windows: add constants for PMTUD socket options
...
Related documentation:
- https://learn.microsoft.com/en-us/windows/win32/winsock/ipproto-ip-socket-options
- https://learn.microsoft.com/en-us/windows/win32/winsock/ipproto-ipv6-socket-options
Change-Id: I21b23ca815d1d8135ce5724115b9ca23819ea10a
GitHub-Last-Rev: 9054c5c790
GitHub-Pull-Request: golang/sys#245
Reviewed-on: https://go-review.googlesource.com/c/sys/+/654495
Reviewed-by: Quim Muntal <quimmuntal@gmail.com >
Reviewed-by: Ian Lance Taylor <iant@google.com >
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com >
Reviewed-by: Junyang Shao <shaojunyang@google.com >
Auto-Submit: Ian Lance Taylor <iant@google.com >
2025-03-05 07:56:48 -08:00
Gopher Robot
74cfc93a99
all: upgrade go directive to at least 1.23.0 [generated]
...
By now Go 1.24.0 has been released, and Go 1.22 is no longer supported
per the Go Release Policy (https://go.dev/doc/devel/release#policy ).
For golang/go#69095 .
[git-generate]
(cd . && go get go@1.23 .0 && go mod tidy && go fix ./... && go mod edit -toolchain=none)
Change-Id: Ibb66e9edd9b097ab8ff838138f8116664bb50158
Reviewed-on: https://go-review.googlesource.com/c/sys/+/649697
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com >
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com >
Auto-Submit: Gopher Robot <gobot@golang.org >
Reviewed-by: Cherry Mui <cherryyz@google.com >
v0.31.0
2025-02-14 13:48:03 -08:00
Mauri de Souza Meneguzzo
863b3c4ac4
unix: update glibc to 2.41
...
Change-Id: I1796b552f854a15e8ef5e019e247c4d7e0644086
GitHub-Last-Rev: 3518c62005
GitHub-Pull-Request: golang/sys#244
Reviewed-on: https://go-review.googlesource.com/c/sys/+/645436
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: Carlos Amedee <carlos@golang.org >
v0.30.0
2025-01-31 07:57:49 -08:00
Florian Lehner
4d4692e1b0
unix: add Auxv
...
Fixes golang/go#67839
Change-Id: I3af38d21159f7cac3786b49ac17657d314fbc178
Reviewed-on: https://go-review.googlesource.com/c/sys/+/644295
Reviewed-by: Tobias Klauser <tobias.klauser@gmail.com >
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com >
Reviewed-by: Carlos Amedee <carlos@golang.org >
Reviewed-by: Ian Lance Taylor <iant@google.com >
Auto-Submit: Ian Lance Taylor <iant@google.com >
2025-01-31 07:53:42 -08:00
Mauri de Souza Meneguzzo
b215a1c6fc
unix: update to Linux kernel 6.13
...
Change-Id: I4c49a78bd2abf2ac9e4d461680c92ae65be14544
GitHub-Last-Rev: 888e68d533
GitHub-Pull-Request: golang/sys#243
Reviewed-on: https://go-review.googlesource.com/c/sys/+/642199
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com >
Reviewed-by: David Chase <drchase@google.com >
Auto-Submit: Ian Lance Taylor <iant@google.com >
Reviewed-by: Ian Lance Taylor <iant@google.com >
2025-01-21 14:32:54 -08:00
Grigorii Khvatskii
c75621413d
cpu: add support for AVX-VNNI and IFMA detection
...
Added detection for x86 AVX-VNNI (VEX-coded Vector Neural Network
Instructions) and AVX-IFMA (VEX-coded Integer Fused Multiply Add),
including both the base VNNI set and the Int8 extention.
Fixes golang/go#71142
Change-Id: I9e8d18b2e8bf81d5d4313a4a47fdf731fb3d44dd
GitHub-Last-Rev: 32ea443fc2
GitHub-Pull-Request: golang/sys#242
Reviewed-on: https://go-review.googlesource.com/c/sys/+/641155
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com >
Reviewed-by: Michael Pratt <mpratt@google.com >
Auto-Submit: Ian Lance Taylor <iant@google.com >
Reviewed-by: Ian Lance Taylor <iant@google.com >
2025-01-10 12:06:19 -08:00
Nahum Shalman
1c14dcadc3
unix: add GetPeerUcred and UcredGet for solaris
...
Change-Id: I74ba119fb729ef46899de04c686115f960975bb3
Reviewed-on: https://go-review.googlesource.com/c/sys/+/639755
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com >
Auto-Submit: Ian Lance Taylor <iant@google.com >
Reviewed-by: Michael Pratt <mpratt@google.com >
Reviewed-by: Ian Lance Taylor <iant@google.com >
Reviewed-by: Matt Layher <mdlayher@gmail.com >
2025-01-07 00:03:00 -08:00
Sebastiaan van Stijn
d4ac05dc8c
windows: update NewLazyDLL, LoadDLL docs to point to NewLazySystemDLL
...
Point users to the NewLazySystemDLL utility that was added in CL 21592.
Change-Id: I5fddd927fe6628f06a6266b225949c4227fb79f1
GitHub-Last-Rev: 1fe36ed335
GitHub-Pull-Request: golang/sys#240
Reviewed-on: https://go-review.googlesource.com/c/sys/+/638715
Reviewed-by: Jorropo <jorropo.pgm@gmail.com >
Auto-Submit: Ian Lance Taylor <iant@google.com >
Auto-Submit: Jorropo <jorropo.pgm@gmail.com >
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com >
Reviewed-by: Cherry Mui <cherryyz@google.com >
Reviewed-by: Ian Lance Taylor <iant@google.com >
v0.29.0
2024-12-26 08:00:01 -08:00
Sebastiaan van Stijn
680bd24a5f
windows: remove unused errString type
...
It's no longer used since CL 165759.
Change-Id: Ie8c834a6dd1147889ec47bf92a5d4cce08bbf4fd
GitHub-Last-Rev: 3f0c460db1
GitHub-Pull-Request: golang/sys#241
Reviewed-on: https://go-review.googlesource.com/c/sys/+/638716
Reviewed-by: Ian Lance Taylor <iant@google.com >
Auto-Submit: Jorropo <jorropo.pgm@gmail.com >
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com >
Reviewed-by: Cherry Mui <cherryyz@google.com >
Reviewed-by: Jorropo <jorropo.pgm@gmail.com >
Auto-Submit: Ian Lance Taylor <iant@google.com >
2024-12-26 07:58:30 -08:00
Tobias Klauser
a7f19e9c20
unix: add Dup3 on dragonfly
...
Use the same implementation as on freebsd which is also what the
dragonfly libc uses.
Change-Id: I0ed513ae15fcb6dac77b2fc76f662723d66b75c6
Reviewed-on: https://go-review.googlesource.com/c/sys/+/636435
Auto-Submit: Tobias Klauser <tobias.klauser@gmail.com >
Reviewed-by: Ian Lance Taylor <iant@google.com >
Reviewed-by: Carlos Amedee <carlos@golang.org >
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 >
2024-12-17 08:13:49 -08:00
Ian Lance Taylor
fe16172d11
unix: define IfMsghdr2, IfData64, and RtMsghdr2 on darwin
...
Change-Id: I6943f6b5bd9f7d0ef5bad24ed638b8cf5dd0353d
Reviewed-on: https://go-review.googlesource.com/c/sys/+/633077
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com >
Auto-Submit: Ian Lance Taylor <iant@golang.org >
Reviewed-by: Damien Neil <dneil@google.com >
Reviewed-by: Michael Knyszek <mknyszek@google.com >
v0.28.0
2024-12-03 18:44:20 +00:00
Mauri de Souza Meneguzzo
0a57dbcf35
unix: update to kernel Linux 6.12
...
Change-Id: I7c8157d5f1b597b6ae249b20866bbad918b46fa4
GitHub-Last-Rev: 0bbc2efbab
GitHub-Pull-Request: golang/sys#238
Reviewed-on: https://go-review.googlesource.com/c/sys/+/629075
Auto-Submit: Ian Lance Taylor <iant@google.com >
Reviewed-by: Ian Lance Taylor <iant@google.com >
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com >
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com >
2024-11-18 19:38:36 +00:00
Tobias Klauser
3cf1e67d0c
unix: don't fail TestPpoll on EINTR
...
TestPpoll sometimes fails builders due to Ppoll getting interrupted and
returning EINTR:
--- FAIL: TestPpoll (0.00s)
syscall_linux_test.go:299: Ppoll: unexpected error: interrupted system call
Fix this by retrying Ppoll in case of EINTR, same as CL 298189 in
TestPoll.
Fixes golang/go#66324
Change-Id: I8ce4e2c00fe3b7a078cd75b4b15bb076d3a87fb2
Reviewed-on: https://go-review.googlesource.com/c/sys/+/627395
Reviewed-by: Cherry Mui <cherryyz@google.com >
Reviewed-by: Ian Lance Taylor <iant@google.com >
Auto-Submit: Tobias Klauser <tobias.klauser@gmail.com >
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com >
2024-11-13 21:52:06 +00:00
MOHAN KUMAR R
d2cea7095f
windows: add functions to get named pipe process IDs
...
Fixes https://github.com/golang/go/issues/70086
Change-Id: I0cd188f075490b1ea630b26b74aa201796d60d3a
GitHub-Last-Rev: 498fe730f2
GitHub-Pull-Request: golang/sys#235
Reviewed-on: https://go-review.googlesource.com/c/sys/+/626215
Reviewed-by: David Chase <drchase@google.com >
Reviewed-by: Carlos Amedee <carlos@golang.org >
Auto-Submit: Ian Lance Taylor <iant@google.com >
Reviewed-by: Quim Muntal <quimmuntal@gmail.com >
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com >
Reviewed-by: Ian Lance Taylor <iant@google.com >
2024-11-13 05:11:24 +00:00
MOHAN KUMAR R
a13946c675
windows: regenerate zsyscall_windows.go
...
Change-Id: I714d13f534520a444dd9601d280d32c4427a8e69
GitHub-Last-Rev: 861daf25d8
GitHub-Pull-Request: golang/sys#236
Reviewed-on: https://go-review.googlesource.com/c/sys/+/626379
Commit-Queue: Ian Lance Taylor <iant@google.com >
Reviewed-by: Alex Brainman <alex.brainman@gmail.com >
Reviewed-by: Ian Lance Taylor <iant@google.com >
Reviewed-by: Cherry Mui <cherryyz@google.com >
Auto-Submit: Ian Lance Taylor <iant@google.com >
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com >
2024-11-12 17:28:48 +00:00
Quim Muntal
e0753d4694
Revert "windows/mkwinsyscall: use syscall.SyscallN instead of syscall.Syscall{6,9,12,15}"
...
This reverts CL 614082.
Reason for revert: syscall.SyscallN allocates more than its syscall.SyscallX counterparts, producing perf-related test failures across the board.
Updates #70197
Change-Id: I51107d909fcdbef4e65ee3f84932b2a0e7804f1b
Reviewed-on: https://go-review.googlesource.com/c/sys/+/625375
Reviewed-by: Ian Lance Taylor <iant@google.com >
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com >
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com >
v0.27.0
2024-11-05 15:28:52 +00:00
database64128
c29efe38de
windows: add iphlpapi functions for change notifications
...
The NotifyIpInterfaceChange and NotifyUnicastIpAddressChange functions
register a user-defined callback function for receiving network
interface and IP address change notifications. The GetIfEntry2Ex and
GetUnicastIpAddressEntry functions can be called to retrieve complete
information about the changed interface or address.
The CancelMibChangeNotify2 function deregisters for change
notifications.
Change-Id: Iee29405ffa135c6aa0120f9aa046e3706e2bac47
GitHub-Last-Rev: a8309cd81a
GitHub-Pull-Request: golang/sys#211
Reviewed-on: https://go-review.googlesource.com/c/sys/+/603755
Reviewed-by: Alex Brainman <alex.brainman@gmail.com >
Reviewed-by: Carlos Amedee <carlos@golang.org >
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com >
Reviewed-by: David Chase <drchase@google.com >
2024-11-05 07:10:30 +00:00
Vaughn Iverson
8f2aa9fb48
cpu: conditionally re-enable AVX512 support on darwin/amd64
...
Darwin opmask clobbering bug was fixed in kernel version 21.3.0
as released in MacOS 12.2.0. This commit resolves issue by
checking for Darwin AVX512 support via a sysctl call with the
addition of a kernel minimum version check.
The kernel version check is completed without adding new
dependencies to x/sys/cpu. A sysctl call is accomplished by
copying a minimal amount of code from x/sys/unix, to retrieve
only the needed KERN_OSRELEASE value. This code is structured
in the same manner as an existing analogous AIX/PPC64 syscall.
The resulting dotted version string value is then parsed for
numeric comparison with a dependency free function.
All code in this contribution is structured to ease removal of
the special darwin/amd64 codepaths when that OS/arch combination
is eventually no longer supported by golang.
Resolves issue: golang/go#49233 , reinstates fix for issue: golang/go#43089
Change-Id: I4755fc8b3865eb6562b0959ecc910e2c46ac6cb4
Reviewed-on: https://go-review.googlesource.com/c/sys/+/620256
Reviewed-by: Keith Randall <khr@google.com >
Reviewed-by: Keith Randall <khr@golang.org >
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com >
Reviewed-by: Carlos Amedee <carlos@golang.org >
Reviewed-by: vsivsi@yahoo.com <vsivsi@yahoo.com >
2024-11-04 23:17:32 +00:00
Ian Lance Taylor
054f1fcdf7
README: don't recommend go get
...
These days people will just import the packages and the go tool will
do the right thing. We don't need to explain it.
Add a pointer to the git repo, though.
For golang/go#62645
Change-Id: I94cd9c588a68d92c61d00be05740248509a2ae6e
Reviewed-on: https://go-review.googlesource.com/c/sys/+/624078
Auto-Submit: Ian Lance Taylor <iant@google.com >
Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org >
Reviewed-by: Ian Lance Taylor <iant@google.com >
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com >
Commit-Queue: Ian Lance Taylor <iant@google.com >
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com >
2024-11-02 04:18:59 +00:00
Mac Malainey
ca0404159d
unix: extend z/OS support
...
extend support for z/OS target by adding the following syscalls:
- Sendfile (library implementation)
- Fcntl
- MmapPtr
- MunmapPtr
Change-Id: I098748802c2b275c15758e9d0132fca0490e9b70
GitHub-Last-Rev: 5aafd0b757
GitHub-Pull-Request: golang/sys#223
Reviewed-on: https://go-review.googlesource.com/c/sys/+/620375
Reviewed-by: Carlos Amedee <carlos@golang.org >
Reviewed-by: Ian Lance Taylor <iant@google.com >
Auto-Submit: Ian Lance Taylor <iant@google.com >
Reviewed-by: Bill O'Farrell <billotosyr@gmail.com >
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com >
2024-10-29 15:10:58 +00:00
Tobias Klauser
18e038c8ee
unix: move NETLINK_* consts to own section
...
This makes it easier to distinguish them from the IFLA_* and add new
entries. Also refresh the IFLA_* consts while at it.
Change-Id: I94aa56c9f99d0714668d8150cb6185d57e2d789c
Reviewed-on: https://go-review.googlesource.com/c/sys/+/622515
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 >
Reviewed-by: Carlos Amedee <carlos@golang.org >
2024-10-28 15:03:49 +00:00
qmuntal
d045236a8d
windows: implement Ftruncate using a single syscall on Windows
...
Ftruncate can be implemented on Windows using a single syscall. This
makes the implementation more efficient and less prone to races when
used in combination with other Seek calls.
Note that this is the x/sys counterpart for CL 618835.
Change-Id: Ie9be356bd953ccce85c0dd87a5dcc6ccf4fec464
Reviewed-on: https://go-review.googlesource.com/c/sys/+/621935
Reviewed-by: Alex Brainman <alex.brainman@gmail.com >
Auto-Submit: Quim Muntal <quimmuntal@gmail.com >
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com >
Reviewed-by: Michael Pratt <mpratt@google.com >
Reviewed-by: Damien Neil <dneil@google.com >
2024-10-28 14:49:53 +00:00
Dmitri Shuralyov
cff53d5a33
unix: gofmt after CL 610296
...
Also remove a few unhelpful blank lines.
Change-Id: I4001a25ec409406855b7800afd88738c43f60b90
Reviewed-on: https://go-review.googlesource.com/c/sys/+/621921
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com >
Reviewed-by: Ian Lance Taylor <iant@google.com >
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com >
Auto-Submit: Dmitri Shuralyov <dmitshur@golang.org >
2024-10-25 18:35:15 +00:00
Joon Lee
123459f096
unix: update z/OS implementation of fcntl and mmap
...
- Add a wrapper function around fcntl to handle different operation
types and new fcntl implementation that accepts uintptr as an arg.
- Add support for calling mmap/munmap with address pointers.
- Add accompanying tests for new functions.
Change-Id: If5e77aa4cf2cccfd431de4f3bd0c5014a761e167
GitHub-Last-Rev: 07e32a4ab7
GitHub-Pull-Request: golang/sys#216
Reviewed-on: https://go-review.googlesource.com/c/sys/+/610296
Reviewed-by: Ian Lance Taylor <iant@google.com >
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com >
Auto-Submit: Dmitri Shuralyov <dmitshur@golang.org >
TryBot-Bypass: Dmitri Shuralyov <dmitshur@golang.org >
2024-10-25 15:27:13 +00:00
Tobias Klauser
df4a4da00c
unix/linux: adjust Dockerfile ENV key value format
...
This fixes the following warnings emitted when running mkall.sh on
GOOS=linux with a recent Docker version:
6 warnings found (use --debug to expand):
- LegacyKeyValueFormat: "ENV key=value" should be used instead of legacy "ENV key value" format (line 4)
- LegacyKeyValueFormat: "ENV key=value" should be used instead of legacy "ENV key value" format (line 24)
- LegacyKeyValueFormat: "ENV key=value" should be used instead of legacy "ENV key value" format (line 25)
- LegacyKeyValueFormat: "ENV key=value" should be used instead of legacy "ENV key value" format (line 26)
- LegacyKeyValueFormat: "ENV key=value" should be used instead of legacy "ENV key value" format (line 33)
- LegacyKeyValueFormat: "ENV key=value" should be used instead of legacy "ENV key value" format (line 56)
Also see https://docs.docker.com/reference/build-checks/legacy-key-value-format/
Change-Id: Icdf05cbe7b8650fc2fec84e010c7401807f5f75f
Reviewed-on: https://go-review.googlesource.com/c/sys/+/621956
Reviewed-by: Ian Lance Taylor <iant@google.com >
Auto-Submit: Tobias Klauser <tobias.klauser@gmail.com >
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com >
Auto-Submit: Ian Lance Taylor <iant@google.com >
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com >
2024-10-24 15:42:44 +00:00
Tobias Klauser
696d3420cc
unix: gofmt after CL 621375
...
Change-Id: Ibcd776913317d3b38b418190fa93c6eae52ffc0d
Reviewed-on: https://go-review.googlesource.com/c/sys/+/621955
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 >
Auto-Submit: Ian Lance Taylor <iant@google.com >
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com >
2024-10-24 15:37:41 +00:00
Yaroslav Kolomiiets
60d787735c
unix: add PTP_PF_* constants on Linux
...
These represent valid values for PtpPinDesc.Func.
They are defined as enum, thus not emitted from mkerrors.sh.
Change-Id: Ibac22d56214fa0f64a4095dfc000692a5e5e994a
GitHub-Last-Rev: e7990b0882
GitHub-Pull-Request: golang/sys#229
Reviewed-on: https://go-review.googlesource.com/c/sys/+/621735
Reviewed-by: Michael Pratt <mpratt@google.com >
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 >
2024-10-23 15:19:30 +00:00
Yaroslav Kolomiiets
256d1dfe8f
unix: add PTP IOCTLs on Linux
...
The IOCTLs are used for interacting with PTP-specific functions of NIC and time card drivers.
Description:
https://netdevconf.info/0x18/docs/netdev-0x18-paper39-talk-slides/netdev-intro-ptp-api.pdf
Change-Id: If50d605958e5cee451146cf68cc95a3704917512
GitHub-Last-Rev: 44fac1cb1a
GitHub-Pull-Request: golang/sys#225
Reviewed-on: https://go-review.googlesource.com/c/sys/+/621375
Reviewed-by: Michael Pratt <mpratt@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 >
2024-10-21 18:42:12 +00:00
mertakman
adbb8bbcaf
windows/mkwinsyscall: use syscall.SyscallN instead of syscall.Syscall{6,9,12,15}
...
Replace syscall.Syscall6, Syscall9, Syscall12, and Syscall15 with syscall.SyscallN for Go 1.18+. This simplifies system calls by allowing the exact number of arguments needed, eliminating zero padding and reducing potential errors.
Updated TestSyscallXGeneration to TestSyscallNGeneration to verify correct SyscallN generation for different argument counts.
Change-Id: Icd6662b591d7548e367b88f34243f5529e177eab
GitHub-Last-Rev: c06fca1aa4
GitHub-Pull-Request: golang/sys#219
Reviewed-on: https://go-review.googlesource.com/c/sys/+/614082
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 >
Auto-Submit: Ian Lance Taylor <iant@google.com >
Reviewed-by: Alex Brainman <alex.brainman@gmail.com >
Reviewed-by: Quim Muntal <quimmuntal@gmail.com >
2024-10-21 13:42:39 +00:00
Yaroslav Kolomiiets
a57fdb8507
unix: add IoctlGetHwTstamp/IoctlGetHwTstamp on Linux
...
Add the ioctls to get/set the hardware timestamping configuration
(SIOCSHWTSTAMP and SIOCGHWTSTAMP) along with relevant symbols.
The usage is described in
https://www.kernel.org/doc/Documentation/networking/timestamping.txt
Change-Id: Ib7509feaf28218aeae497eff9ca6c0a532aa73c0
GitHub-Last-Rev: 47dc9dfec2
GitHub-Pull-Request: golang/sys#224
Reviewed-on: https://go-review.googlesource.com/c/sys/+/620376
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 >
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com >
2024-10-16 17:41:25 +00:00
Guoqi Chen
3932916d5c
unix: switch to Ubuntu 24.10 in Dockerfile
...
ubuntu 24.04 introduced support for qemu-loongarch64, and ubuntu 24.10
introduced support for the cross-compiler gcc-loongarch64-linux-gnu, so
we can temporarily switch to ubuntu 24.10 to discard the extra links
introduced by loong64 and switch to it when the next ubuntu LTS version
is released.
Change-Id: I96de123df0cf50d6ba0331eeb02fc1e8c48ce304
Reviewed-on: https://go-review.googlesource.com/c/sys/+/618075
Auto-Submit: Ian Lance Taylor <iant@google.com >
Reviewed-by: Meidan Li <limeidan@loongson.cn >
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com >
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com >
Reviewed-by: Tobias Klauser <tobias.klauser@gmail.com >
Reviewed-by: Ian Lance Taylor <iant@google.com >
2024-10-14 16:58:48 +00:00
cuishuang
2dfefb6832
all: execute gofmt
...
Change-Id: I55aef760145df773be30d567c9e989f46a3e79dc
Reviewed-on: https://go-review.googlesource.com/c/sys/+/618898
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: Michael Knyszek <mknyszek@google.com >
Reviewed-by: Tobias Klauser <tobias.klauser@gmail.com >
2024-10-11 18:38:43 +00:00
Yaroslav Kolomiiets
e5eee7e480
unix: add IoctlGetEthtoolTsInfo on Linux
...
The function fetches ethtool timestamping and PHC association for a
network interface. Its primary usage is to query the mapping between
the interface and its corresponding PTP clock number in /dev/ptp𝑛.
Change-Id: Id09466b3b43056c628593d4d2e05d77ec8d8082b
GitHub-Last-Rev: 3743a3a650
GitHub-Pull-Request: golang/sys#222
Reviewed-on: https://go-review.googlesource.com/c/sys/+/619335
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com >
Reviewed-by: Tobias Klauser <tobias.klauser@gmail.com >
Auto-Submit: Ian Lance Taylor <iant@golang.org >
Reviewed-by: Ian Lance Taylor <iant@google.com >
Reviewed-by: Cherry Mui <cherryyz@google.com >
2024-10-11 16:50:38 +00:00
Yaroslav Kolomiiets
fe162bad74
unix: add ClockSettime on Linux
...
The syscall clock_settime(3) is used to set the time on the specified
clock. It is a counterpart to clock_gettime(3) which is already
exposed as ClockGettime here.
Fixes golang/go#69830
Change-Id: I6145c915754f31e3c50f6a11568eb9d5ba12a778
GitHub-Last-Rev: 5b15f129cc
GitHub-Pull-Request: golang/sys#221
Reviewed-on: https://go-review.googlesource.com/c/sys/+/619255
Auto-Submit: Ian Lance Taylor <iant@google.com >
Reviewed-by: Cherry Mui <cherryyz@google.com >
Reviewed-by: Ian Lance Taylor <iant@google.com >
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com >
2024-10-10 19:53:43 +00:00
qmuntal
7143f4a4e1
windows: manually initialize NewNTUnicodeString
...
The `RtlInitUnicodeString` syscall can be avoided by manually
initializing the `NTUnicodeString`.
The process is described in [WdmlibRtlInitUnicodeStringEx](https://learn.microsoft.com/en-us/windows-hardware/drivers/ddi/wdmsec/nf-wdmsec-wdmlibrtlinitunicodestringex ).
The less syscalls, the better. It also makes the function faster:
```
goos: windows
goarch: amd64
pkg: golang.org/x/sys/windows
cpu: Intel(R) Core(TM) i7-10850H CPU @ 2.70GHz
│ old.txt │ new.txt │
│ sec/op │ sec/op vs base │
NewNTUnicodeString-12 181.05n ± 15% 96.32n ± 11% -46.80% (p=0.000 n=10)
```
Change-Id: Iaf079acdcc2024cdca6b6b649a711f6be99c5b87
Reviewed-on: https://go-review.googlesource.com/c/sys/+/618175
Reviewed-by: Damien Neil <dneil@google.com >
Reviewed-by: Cherry Mui <cherryyz@google.com >
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com >
2024-10-07 19:17:02 +00:00
Mateusz Poliwczak
23b0dabe63
unix: mark vgetrandom as non-escaping
...
For golang/go#69577
Change-Id: Id1942d252c813126aa2f110e3f426714db73b9c7
GitHub-Last-Rev: 10e6a30b78
GitHub-Pull-Request: golang/sys#220
Reviewed-on: https://go-review.googlesource.com/c/sys/+/616795
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: Michael Knyszek <mknyszek@google.com >
Reviewed-by: Jason Donenfeld <Jason@zx2c4.com >
v0.26.0
2024-10-01 18:16:15 +00:00
John Troy
cbf0eb65e7
unix: fix grep syntax to work on non-GNU greps
...
CL 432835 changed two grep commands in unix/mkerrors.sh in such a way
that is incompatible with AIX's grep, which, unlike GNU grep, does not
support extended regular expressions without the -E flag. The intent of
this PR is to restore the egrep behavior by invoking grep as grep -E.
My assumption is that GNU grep is not meant to be a requirement to run
mkerrors.sh, and given that, grep -E looks like the most cross-platform
approach.
Example of current (incorrect) behavior on AIX:
bash-5.2$ printf 'SIGHUP\nSIGMAX64\nSIGTERM' | grep -v 'SIGSTKSIZE\|SIGSTKSZ\|SIGRT\|SIGMAX64'
SIGHUP
SIGMAX64
SIGTERM
Behavior before CL 432835:
bash-5.2$ printf 'SIGHUP\nSIGMAX64\nSIGTERM' | egrep -v '(SIGSTKSIZE|SIGSTKSZ|SIGRT|SIGMAX64)'
SIGHUP
SIGTERM
Behavior of proposed change:
bash-5.2$ printf 'SIGHUP\nSIGMAX64\nSIGTERM' | grep -E -v '(SIGSTKSIZE|SIGSTKSZ|SIGRT|SIGMAX64)'
SIGHUP
SIGTERM
OpenBSD's grep behaves the same as AIX for the above commands, which is
why I cast this as GNU vs. non-GNU. I haven't tested any other
implementations.
Fixes golang/go#69365
Change-Id: I009353ee630463475a5c131d019f59c5e69efd34
GitHub-Last-Rev: e1166046e1
GitHub-Pull-Request: golang/sys#217
Reviewed-on: https://go-review.googlesource.com/c/sys/+/615755
Reviewed-by: Michael Knyszek <mknyszek@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-09-30 12:38:50 +00:00
Mauri de Souza Meneguzzo
e7397b9a65
unix: update to Linux 6.11
...
Change-Id: I1cc777822da1b557e69634faade8e24d06c00ce8
GitHub-Last-Rev: d09238ecd0
GitHub-Pull-Request: golang/sys#218
Reviewed-on: https://go-review.googlesource.com/c/sys/+/613855
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: Tobias Klauser <tobias.klauser@gmail.com >
Reviewed-by: Michael Knyszek <mknyszek@google.com >
2024-09-30 12:37:56 +00:00
Jason A. Donenfeld
981de40f5c
unix: use vDSO for getrandom() on linux
...
With CL 614835 adding support in the runtime for calling into the
getrandom() vDSO function, wire up x/sys/unix's Getrandom() function to
it, so that callers can benefit from the increased speed and shared
vDSO state with the runtime.
Updates golang/go#69577 .
Change-Id: I17734409982c51bb984a6337f4ffa8f60414ebee
Reviewed-on: https://go-review.googlesource.com/c/sys/+/615335
Reviewed-by: Michael Pratt <mpratt@google.com >
Reviewed-by: David Chase <drchase@google.com >
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com >
2024-09-28 01:26:00 +00:00
Leo Antunes
48aad76ed3
linux: add tcp_cc_info and its related types
...
Add the ability to retrieve congestion control information from a socket via TCP_CC_INFO.
Fixes golang/go#68232
Change-Id: I2ea15928ec0e3192b670759bab4b659e62be553b
GitHub-Last-Rev: b8b8c44f1f
GitHub-Pull-Request: golang/sys#200
Reviewed-on: https://go-review.googlesource.com/c/sys/+/595676
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com >
Reviewed-by: Carlos Amedee <carlos@golang.org >
Reviewed-by: Ian Lance Taylor <iant@google.com >
Auto-Submit: Ian Lance Taylor <iant@google.com >
2024-09-17 15:50:50 +00:00