Commit Graph

1405 Commits

Author SHA1 Message Date
Tobias Klauser
6fa7a7ca2b windows: allow calling WSASendto with nil Sockaddr
Same as CL 434535 did for the syscall package.

For golang/go#55845

Change-Id: I17f30152ae973b64ac65e08cefd5442e9bf19e2c
Reviewed-on: https://go-review.googlesource.com/c/sys/+/435777
TryBot-Result: Gopher Robot <gobot@golang.org>
Run-TryBot: Benny Siegert <bsiegert@gmail.com>
Auto-Submit: Tobias Klauser <tobias.klauser@gmail.com>
Reviewed-by: Benny Siegert <bsiegert@gmail.com>
Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com>
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
2022-09-28 14:00:15 +00:00
Lorenz Bauer
c57c793909 unix: add SIG_BLOCK and friends for Linux
The recently added PthreadSigmask syscall expects a parameter
how that specifies which action to perform on the thread's signal
set. The value of this parameter differs between arches. Add the
SIG_* constants to have a portable source.

Updates golang/go#55349

Change-Id: I7cb42d7c2c42e9b3d22123e8de74960121d89313
Reviewed-on: https://go-review.googlesource.com/c/sys/+/435775
Reviewed-by: Benny Siegert <bsiegert@gmail.com>
Reviewed-by: Tobias Klauser <tobias.klauser@gmail.com>
Auto-Submit: Tobias Klauser <tobias.klauser@gmail.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com>
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
2022-09-28 13:57:37 +00:00
Lorenz Bauer
d9d178bc13 unix: add PthreadSigmask for Linux
Add a syscall wrapper for SYS_RT_SIGPROCMASK and export it as
PthreadSigmask. The latter is defined by POSIX and can therefore
be implemented by Darwin, etc. later on.

Follow the approach used by Signalfd of passing _C__NSIG/8 as
sigsetsize. This avoids exporting _C__NSIG and allows the syscall
to work with the current definition of Sigset_t, which doesn't
match the kernel definition of Sigset_t.

Updates golang/go#55349

Change-Id: I49dc93366a7d316d820b0c25ecdef2ebb584634b
Reviewed-on: https://go-review.googlesource.com/c/sys/+/435095
Reviewed-by: Tobias Klauser <tobias.klauser@gmail.com>
Reviewed-by: Ian Lance Taylor <iant@google.com>
Auto-Submit: Tobias Klauser <tobias.klauser@gmail.com>
Reviewed-by: Cherry Mui <cherryyz@google.com>
Auto-Submit: Ian Lance Taylor <iant@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com>
Run-TryBot: Ian Lance Taylor <iant@google.com>
2022-09-27 17:03:52 +00:00
Tobias Klauser
8cfa568d3c unix: allow calling Sendto with nil Sockaddr
Same as CL 433504 did for the syscall package.

For golang/go#55845

Change-Id: I3ca2d7fab9da77c304487b4c134a9675da99deca
Reviewed-on: https://go-review.googlesource.com/c/sys/+/434515
Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com>
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@google.com>
Run-TryBot: Ian Lance Taylor <iant@google.com>
Auto-Submit: Ian Lance Taylor <iant@google.com>
2022-09-26 16:39:33 +00:00
Michael Lelli
fb04ddd9f9 windows: add DWM window attribute related syscalls
https://docs.microsoft.com/en-us/windows/win32/api/dwmapi/nf-dwmapi-dwmgetwindowattribute
https://docs.microsoft.com/en-us/windows/win32/api/dwmapi/nf-dwmapi-dwmsetwindowattribute

Change-Id: I96a68f91f745601e93c0cc21cc4f1f4c5e7d8b9e
GitHub-Last-Rev: bdbe2ccb22
GitHub-Pull-Request: golang/sys#123
Reviewed-on: https://go-review.googlesource.com/c/sys/+/399135
Reviewed-by: Bryan Mills <bcmills@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Benny Siegert <bsiegert@gmail.com>
Run-TryBot: Benny Siegert <bsiegert@gmail.com>
Reviewed-by: Alex Brainman <alex.brainman@gmail.com>
2022-09-19 09:18:48 +00:00
Tobias Klauser
7b5979e65e unix: remove Go 1.12 compatibility on darwin
Go 1.12 was released more than 3 years ago. Dropping support for it will
simplify generating the wrappers needed for Getdirentries
implementation.

Change-Id: If24bf6ff9076fb4e281948c67bac87744df98d7a
Reviewed-on: https://go-review.googlesource.com/c/sys/+/430176
Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com>
Reviewed-by: Than McIntosh <thanm@google.com>
Reviewed-by: Keith Randall <khr@google.com>
Reviewed-by: Keith Randall <khr@golang.org>
TryBot-Result: Gopher Robot <gobot@golang.org>
Auto-Submit: Tobias Klauser <tobias.klauser@gmail.com>
2022-09-15 20:00:43 +00:00
Dmitri Goutnik
63ea559210 unix: add namespaced versions of Listxattr/Flistxattr/Llistxattr on *BSD
Current extended attributes API mixes together attributes from different
namespaces without a way to separate them. Add versions of *listxattr
functions that return attributes only from the specified namespace.

For golang/go#54357

Change-Id: I605d677dd2f2a17541bc02f3146a7509c69269c9
Reviewed-on: https://go-review.googlesource.com/c/sys/+/430215
Reviewed-by: Yuval Pavel Zholkover <paulzhol@gmail.com>
Reviewed-by: Ian Lance Taylor <iant@google.com>
Run-TryBot: Dmitri Goutnik <dgoutnik@gmail.com>
Reviewed-by: Tobias Klauser <tobias.klauser@gmail.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Auto-Submit: Jenny Rakoczy <jenny@golang.org>
Reviewed-by: Jenny Rakoczy <jenny@golang.org>
2022-09-13 17:52:20 +00:00
Tobias Klauser
76c7481b51 all: simplify unsafe.Slice usage in {Byte,UTF16}PtrToString
On windows, use unsafe.Slice instead of unsafeheader as already the case
for unix and plan9.

The pointers are already *byte/*uint16, so the type conversion can be
omitted as well.

Change-Id: Ida7264cc0c1948bf563ed91d51e637edcdafb77a
Reviewed-on: https://go-review.googlesource.com/c/sys/+/430515
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>
2022-09-13 15:31:01 +00:00
Michael Lelli
3275c407ce windows: add window handle related system calls
https://docs.microsoft.com/en-us/windows/win32/api/winuser/nf-winuser-enumwindows
https://docs.microsoft.com/en-us/windows/win32/api/winuser/nf-winuser-enumchildwindows
https://docs.microsoft.com/en-us/windows/win32/api/winuser/nf-winuser-getclassnamew
https://docs.microsoft.com/en-us/windows/win32/api/winuser/nf-winuser-getdesktopwindow
https://docs.microsoft.com/en-us/windows/win32/api/winuser/nf-winuser-getforegroundwindow
https://docs.microsoft.com/en-us/windows/win32/api/winuser/nf-winuser-iswindow
https://docs.microsoft.com/en-us/windows/win32/api/winuser/nf-winuser-iswindowunicode
https://docs.microsoft.com/en-us/windows/win32/api/winuser/nf-winuser-iswindowvisible
https://docs.microsoft.com/en-us/windows/win32/api/winuser/nf-winuser-getguithreadinfo

Change-Id: I21fbf47e1f459e86503e0e876b44cf47c98b2aa0
GitHub-Last-Rev: 242b79ffb8
GitHub-Pull-Request: golang/sys#122
Reviewed-on: https://go-review.googlesource.com/c/sys/+/399134
Auto-Submit: Alex Brainman <alex.brainman@gmail.com>
Reviewed-by: Benny Siegert <bsiegert@gmail.com>
Reviewed-by: Than McIntosh <thanm@google.com>
Reviewed-by: Alex Brainman <alex.brainman@gmail.com>
Run-TryBot: Alex Brainman <alex.brainman@gmail.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
2022-09-13 12:03:20 +00:00
Tobias Klauser
aba9fc2a8f unix: use unsafe.Slice instead of unsafeheader package
Go 1.18 is the minimum supported Go version and unsafe.Slice was
introduced in Go 1.17.

Change-Id: Ie5f1fad01f219e7b7a190de2c49676f366ad3bc7
Reviewed-on: https://go-review.googlesource.com/c/sys/+/428515
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Benny Siegert <bsiegert@gmail.com>
Reviewed-by: Ian Lance Taylor <iant@google.com>
Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com>
2022-09-09 16:24:55 +00:00
Nahum Shalman
27713097b9 unix: fix event port panic after close
Fixes golang/go#54363

Change-Id: I38813aefaf58ef91605e0a6e3e6622c8a39d6a8d
Reviewed-on: https://go-review.googlesource.com/c/sys/+/422338
Reviewed-by: Tobias Klauser <tobias.klauser@gmail.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com>
Reviewed-by: Michael Knyszek <mknyszek@google.com>
Auto-Submit: Tobias Klauser <tobias.klauser@gmail.com>
Reviewed-by: Ian Lance Taylor <iant@google.com>
2022-09-08 16:41:24 +00:00
Tobias Klauser
7ac13a9a92 unix: don't call t.Fatal from goroutine in TestSendmsgBuffers
Change-Id: Iddef23a1fb2fcde4560ec0bb9e9ae0301fef965f
Reviewed-on: https://go-review.googlesource.com/c/sys/+/429415
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@google.com>
Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com>
Reviewed-by: Michael Knyszek <mknyszek@google.com>
2022-09-08 15:00:16 +00:00
Tobias Klauser
87db552b00 plan9: use unsafe.Slice instead of unsafeheader package
Go 1.18 is the minimum supported Go version and unsafe.Slice was
introduced in Go 1.17.

Change-Id: I696dba9b932c522688ee55fdef43d8776f8afbe1
Reviewed-on: https://go-review.googlesource.com/c/sys/+/428516
Reviewed-by: Benny Siegert <bsiegert@gmail.com>
Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@google.com>
2022-09-07 06:24:15 +00:00
Mateusz Poliwczak
d0df966e69 unix: support all Setuid/Setgid and related syscalls on Linux
Fixes golang/go#53444

Change-Id: I284e85f954f1646f7026478987db74993ae06d4a
GitHub-Last-Rev: 490f814484
GitHub-Pull-Request: golang/sys#134
Reviewed-on: https://go-review.googlesource.com/c/sys/+/428174
Reviewed-by: Michael Knyszek <mknyszek@google.com>
Run-TryBot: Ian Lance Taylor <iant@golang.org>
Run-TryBot: Ian Lance Taylor <iant@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@google.com>
Auto-Submit: Ian Lance Taylor <iant@google.com>
2022-09-06 16:55:34 +00:00
aarzilli
9e1f76180b x/sys/unix: use uintptr for tracee addresses on FreeBSD
Change PtraceLwpInfoStruct, PtraceIoDesc and PtraceIO to not use *byte
to represent addresses that belong to the traced process.

Fixes golang/go#54113

Change-Id: I6efad26046b784d79b83fed4498cac93957274ca
Reviewed-on: https://go-review.googlesource.com/c/sys/+/419915
TryBot-Result: Gopher Robot <gobot@golang.org>
Run-TryBot: Michael Pratt <mpratt@google.com>
Reviewed-by: Russ Cox <rsc@golang.org>
Run-TryBot: Russ Cox <rsc@golang.org>
Auto-Submit: Russ Cox <rsc@golang.org>
2022-09-06 13:54:38 +00:00
Tobias Klauser
d48e67d002 unix: use strconv.Itoa instead of local implementation
This was originally copied over from package syscall where it was
replaced by internal/itoa in CL 301549.

For golang.org/x/sys/unix we may import strconv, so use strconv.Itoa
instead.

Change-Id: Iac125fbd0f64c385f9f0c02d4a7af762364b67aa
Reviewed-on: https://go-review.googlesource.com/c/sys/+/425304
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@google.com>
Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com>
Reviewed-by: Heschi Kreinick <heschi@google.com>
2022-08-29 20:07:55 +00:00
Tobias Klauser
2c41d75977 unix: add IoctlLoop{Get,Set}Status64 on linux
These ioctls are used to get/set the status of a loop device. See
https://man7.org/linux/man-pages/man4/loop.4.html for details.

Change-Id: Ia66db639e6d9326af79954eea5c8f7515aa171d1
Reviewed-on: https://go-review.googlesource.com/c/sys/+/425296
TryBot-Result: Gopher Robot <gobot@golang.org>
Run-TryBot: Ian Lance Taylor <iant@google.com>
Auto-Submit: Ian Lance Taylor <iant@google.com>
Reviewed-by: Ian Lance Taylor <iant@google.com>
Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com>
Reviewed-by: Heschi Kreinick <heschi@google.com>
2022-08-29 20:04:59 +00:00
Nahum Shalman
c680a09ffe unix: improve solaris event port panic message
For golang/go#54254

Change-Id: Id59bacfabc5c818478f6a9af8d585f56f74c2bde
Reviewed-on: https://go-review.googlesource.com/c/sys/+/422099
Reviewed-by: Nahum Shalman <nahamu@gmail.com>
Reviewed-by: Michael Pratt <mpratt@google.com>
Reviewed-by: Robert Griesemer <gri@google.com>
2022-08-25 20:40:02 +00:00
Pure White
20c2bfdbfe cpu: fix cpu cacheLineSize for arm64 darwin(a.k.a. M1)
The existing value for M1 is 64, which is the same as other arm64 cpus.
But the correct cacheLineSize for M1 should be 128, which can be
verified using the following command:

$ sysctl -a hw | grep cachelinesize
hw.cachelinesize: 128

Fixes golang/go#53075

Change-Id: I555716ed412cdc02941c8b1d9767952f7ad6678c
Reviewed-on: https://go-review.googlesource.com/c/sys/+/408614
Run-TryBot: Keith Randall <khr@golang.org>
Reviewed-by: Keith Randall <khr@golang.org>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Joedian Reid <joedian@golang.org>
Reviewed-by: Keith Randall <khr@google.com>
2022-08-23 22:43:34 +00:00
Abirdcfly
2296e01440 windows: remove duplicate words from comments
Change-Id: I94748559cc75c052ad3b70f7db4ec330b8a7226d
GitHub-Last-Rev: 43926d3c98
GitHub-Pull-Request: golang/sys#132
Reviewed-on: https://go-review.googlesource.com/c/sys/+/424474
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@google.com>
Reviewed-by: Bryan Mills <bcmills@google.com>
Run-TryBot: Ian Lance Taylor <iant@google.com>
Run-TryBot: hopehook <hopehook@qq.com>
Reviewed-by: hopehook <hopehook@qq.com>
Auto-Submit: Ian Lance Taylor <iant@google.com>
2022-08-18 16:13:05 +00:00
Joel Sing
5a390386f1 unix: convert openbsd/arm to direct libc calls
The current code has continued to work on OpenBSD, since it has been using
syscall(2) via libc. However, the system call numbers are still hardcoded in
golang.org/x/sys/unix. Various system call changes have been made in OpenBSD,
resulting in changes to the system call numbers and arguments, which now
fail when this package is used.

Switch to calling various system calls directly via libc, rather than calling
via libc using syscall(2).

Updates golang/go#36435

Change-Id: If8e403f0fda7a8b68da71c1f4efba7785b14edf5
Reviewed-on: https://go-review.googlesource.com/c/sys/+/421800
Run-TryBot: Ian Lance Taylor <iant@google.com>
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Run-TryBot: Joel Sing <joel@sing.id.au>
Reviewed-by: Tobias Klauser <tobias.klauser@gmail.com>
Reviewed-by: Ian Lance Taylor <iant@google.com>
2022-08-17 07:08:43 +00:00
Joel Sing
fbc7d0a398 unix: convert openbsd/386 to direct libc calls
The current code has continued to work on OpenBSD, since it has been using
syscall(2) via libc. However, the system call numbers are still hardcoded in
golang.org/sys/unix. Various system call changes have been made in OpenBSD,
resulting in changes to the system call numbers and arguments, which now
fail when this package is used.

Switch to calling various system calls directly via libc, rather than calling
via libc using syscall(2).

Updates golang/go#36435

Change-Id: Ib42d5415ef35c7f7b9cbc55adaf7ca15973ab287
Reviewed-on: https://go-review.googlesource.com/c/sys/+/421798
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Than McIntosh <thanm@google.com>
Reviewed-by: Tobias Klauser <tobias.klauser@gmail.com>
Reviewed-by: Ian Lance Taylor <iant@google.com>
Run-TryBot: Ian Lance Taylor <iant@google.com>
Auto-Submit: Ian Lance Taylor <iant@google.com>
2022-08-11 17:12:46 +00:00
Joel Sing
5f8f0205e4 unix: convert openbsd/amd64 to direct libc calls
The current code has continued to work on OpenBSD, since it has been using
syscall(2) via libc. However, the system call numbers are still hardcoded in
golang.org/sys/unix. Various system call changes have been made in OpenBSD,
resulting in changes to the system call numbers and arguments, which now
fail when this package is used.

Switch to calling various system calls directly via libc, rather than calling
via libc using syscall(2).

Updates golang/go#36435

Change-Id: Iadd5734fd4a2421d758883293bd8a6759fc52ca7
Reviewed-on: https://go-review.googlesource.com/c/sys/+/421797
Reviewed-by: Ian Lance Taylor <iant@google.com>
Auto-Submit: Ian Lance Taylor <iant@google.com>
Run-TryBot: Joel Sing <joel@sing.id.au>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Than McIntosh <thanm@google.com>
Reviewed-by: Tobias Klauser <tobias.klauser@gmail.com>
Run-TryBot: Ian Lance Taylor <iant@google.com>
2022-08-11 17:12:45 +00:00
Joel Sing
74508daebc unix: convert openbsd/arm64 to direct libc calls
The current code has continued to work on OpenBSD, since it has been using
syscall(2) via libc. However, the system call numbers are still hardcoded in
golang.org/sys/unix. Various system call changes have been made in OpenBSD,
resulting in changes to the system call numbers and arguments, which now
fail when this package is used.

Switch to calling various system calls directly via libc, rather than calling
via libc using syscall(2).

Updates golang/go#36435

Change-Id: I836a484b14e0a427ac565315e27f0de1e9a5d021
Reviewed-on: https://go-review.googlesource.com/c/sys/+/421796
Reviewed-by: Ian Lance Taylor <iant@google.com>
Reviewed-by: Tobias Klauser <tobias.klauser@gmail.com>
Auto-Submit: Ian Lance Taylor <iant@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Run-TryBot: Ian Lance Taylor <iant@google.com>
Reviewed-by: Than McIntosh <thanm@google.com>
2022-08-11 17:12:43 +00:00
Joel Sing
1c4a2a72c6 unix: make mkasm_darwin.go usable with other operating systems
Rename mkasm_darwin.go to mkasm.go and pass the operating system as an
argument. This will allow mkasm to be used to generate assembly for
OpenBSD.

Updates golang/go#36435

Change-Id: I42f54f5c6edc3a18a156e0e8e3c38d07ecf26d0b
Reviewed-on: https://go-review.googlesource.com/c/sys/+/421795
Run-TryBot: Joel Sing <joel@sing.id.au>
Run-TryBot: Ian Lance Taylor <iant@google.com>
Reviewed-by: Than McIntosh <thanm@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Tobias Klauser <tobias.klauser@gmail.com>
Reviewed-by: Ian Lance Taylor <iant@google.com>
Auto-Submit: Ian Lance Taylor <iant@google.com>
2022-08-08 15:51:32 +00:00
Joel Sing
3d627bb497 cpu: implement CPU feature detection for openbsd/arm64
OpenBSD 7.1 onwards expose the aarch64 ISAR0 and ISAR1 registers via sysctl:

  $ sysctl machdep
  machdep.compatible=apple,j274
  machdep.id_aa64isar0=153421459058925856
  machdep.id_aa64isar1=1172796674562

Implement CPU feature detection for openbsd/arm64 based on this information.

Updates golang/go#31746

Change-Id: I6dc473d93ccff720582c05b75456de51269bc3e5
Reviewed-on: https://go-review.googlesource.com/c/sys/+/421799
Run-TryBot: Joel Sing <joel@sing.id.au>
Reviewed-by: Tobias Klauser <tobias.klauser@gmail.com>
Reviewed-by: Ian Lance Taylor <iant@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Auto-Submit: Ian Lance Taylor <iant@google.com>
Reviewed-by: Than McIntosh <thanm@google.com>
Run-TryBot: Ian Lance Taylor <iant@google.com>
2022-08-08 15:39:00 +00:00
Joel Sing
e9af53b607 unix: improve and simplify mkasm_darwin.go
Rather than reading in multiple files and concatenating into a string,
pass the list of file names to the function, which in turn can read and
process the list before generating output.

Use sort.Strings rather than handrolling a sort function. Nest errors
where applicable and add usage when run without sufficient arguments
(rather than panicing).

Change-Id: I179fd5a3b98ddbdb7b39fe7df87bc767a82598fa
Reviewed-on: https://go-review.googlesource.com/c/sys/+/421794
Reviewed-by: Than McIntosh <thanm@google.com>
Auto-Submit: Ian Lance Taylor <iant@google.com>
Run-TryBot: Ian Lance Taylor <iant@google.com>
Run-TryBot: Joel Sing <joel@sing.id.au>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@google.com>
Reviewed-by: Tobias Klauser <tobias.klauser@gmail.com>
2022-08-08 15:37:49 +00:00
Tobias Klauser
8e32c043e4 unix: add missing IFLA_* consts on linux
Add these based on uapi/linux/if_link.h as of Linux kernel 5.19.

Change-Id: I56be6e6178aad3d10194a45f774ccf307ed461b5
Reviewed-on: https://go-review.googlesource.com/c/sys/+/420694
Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com>
Reviewed-by: Ian Lance Taylor <iant@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
2022-08-04 21:44:06 +00:00
Clayton Townsend II
e052cef7d3 unix/linux: run each mkall.go target in a seperate goroutine
Each target within mkall.go is now within a seperate goroutine,
except for making headers which have artifacts in their respective
folders that overlap and conflict during their make target.

Fixes golang/go#54009

Change-Id: I04dad7ffdb772029e62a34a1197577c718b533e1
Reviewed-on: https://go-review.googlesource.com/c/sys/+/419517
Reviewed-by: Dmitri Shuralyov <dmitshur@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: Dmitri Shuralyov <dmitshur@golang.org>
2022-08-04 18:27:31 +00:00
Florian Lehner
6e608f9ce7 unix: update perf_event_attr_go
Fix issues when using PerfEventOpen() with PERF_ATTR_SIZE_VER6 or PERF_ATTR_SIZE_VER7
by updating struct perf_event_attr_go to include aux_sample_size and
sig_data.

Change-Id: I0192d59006ed6c67b19a448b797bf49894a24f72
Reviewed-on: https://go-review.googlesource.com/c/sys/+/420294
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@google.com>
Auto-Submit: Ian Lance Taylor <iant@google.com>
Reviewed-by: Than McIntosh <thanm@google.com>
Run-TryBot: Ian Lance Taylor <iant@google.com>
Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com>
Reviewed-by: Tobias Klauser <tobias.klauser@gmail.com>
2022-08-03 19:50:53 +00:00
Tobias Klauser
a90be44021 unix: fix sendmsgN return value for empty iovecs and non-empty oob
Don't shadow the empty var when determining whether to send a single
byte when iovecs are empty but oob is non-empty. This will lead to the
n value correctly being reset to 0 before return.

No test because it's not possible to trigger this case on all platforms,
e.g. darwin where sendmsg with empty buf and non-empty oob returns
EINVAL.

This was introduced by CL 412497 and CL 419396.

Updates golang/go#52885

Change-Id: Iafc5a4b22e10b396ba5f7d4f2ac1c50df195a125
Reviewed-on: https://go-review.googlesource.com/c/sys/+/419914
Auto-Submit: Tobias Klauser <tobias.klauser@gmail.com>
Reviewed-by: Ian Lance Taylor <iant@google.com>
Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com>
Reviewed-by: Florian Lehner <lehner.florian86@gmail.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Cherry Mui <cherryyz@google.com>
2022-07-31 17:44:39 +00:00
PumpkinSeed
66a0560e4e windows: support Windows SOCKADDR_BTH structure
Implements the Windows SOCKADDR_BTH structure so
it can be used as a parameter in windows.Connect.

Fixes: golang/go#53929
Change-Id: Ibe54071897b60ecd91f44c7c0c894d831e56fe56
Reviewed-on: https://go-review.googlesource.com/c/sys/+/419394
Reviewed-by: Than McIntosh <thanm@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Run-TryBot: Alex Brainman <alex.brainman@gmail.com>
Reviewed-by: Ian Lance Taylor <iant@google.com>
Auto-Submit: Ian Lance Taylor <iant@google.com>
Run-TryBot: Ian Lance Taylor <iant@google.com>
Reviewed-by: Alex Brainman <alex.brainman@gmail.com>
2022-07-31 17:38:59 +00:00
awaw fumin
1609e554cd windows: add QueryWorkingSetEx
This change adds the QueryWorkingSetEx function for inspecting
the virtual memory details of pointers.

https://docs.microsoft.com/en-us/windows/win32/api/psapi/nf-psapi-queryworkingsetex

Change-Id: I2bc92bb0b65d34ed1caf88e4d368d64946dfcc5c
GitHub-Last-Rev: c5ac004352
GitHub-Pull-Request: golang/sys#124
Reviewed-on: https://go-review.googlesource.com/c/sys/+/402494
Run-TryBot: Alex Brainman <alex.brainman@gmail.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Than McIntosh <thanm@google.com>
Reviewed-by: Alex Brainman <alex.brainman@gmail.com>
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
2022-07-30 10:01:32 +00:00
Tobias Klauser
3c1f35247d unix: implement recvmsgRaw and sendmsgN on aix
This allows using RecvmsgBuffers and SendmsgBuffers on aix in x/net.

For golang/go#54099

Change-Id: Ib21c59244c9d74b826f4fc8ba3314e3602fd9a8a
Reviewed-on: https://go-review.googlesource.com/c/sys/+/419396
Reviewed-by: Cherry Mui <cherryyz@google.com>
Reviewed-by: Ian Lance Taylor <iant@google.com>
Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com>
Auto-Submit: Tobias Klauser <tobias.klauser@gmail.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
2022-07-28 00:49:56 +00:00
Tobias Klauser
e65921a090 unix/linux: use Go 1.19rc2 instead of building gotip
CL 399336 added support for generating linux/loong64 types and constants
and CL 406794 switched it to use gotip after support for linux/loong64
was merged. The upcoming Go 1.19 release will support that platform, so
switch to use 1.19rc2.

Change-Id: Id3be69eb8f04bdf215f248df09bb5da9456494e7
Reviewed-on: https://go-review.googlesource.com/c/sys/+/419395
Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Cherry Mui <cherryyz@google.com>
Reviewed-by: Ian Lance Taylor <iant@google.com>
2022-07-27 05:50:44 +00:00
Russ Cox
8c9f86f7a5 A+C: delete AUTHORS and CONTRIBUTORS
In 2009, Google's open-source lawyers asked us to create the AUTHORS
file to define "The Go Authors", and the CONTRIBUTORS file was in
keeping with open source best practices of the time.

Re-reviewing our repos now in 2022, the open-source lawyers are
comfortable with source control history taking the place of the
AUTHORS file, and most open source projects no longer maintain
CONTRIBUTORS files.

To ease maintenance, remove AUTHORS and CONTRIBUTORS from all repos.

For golang/go#53961.

Change-Id: Idc0002448db29c764256656d9ae3948ad7f1e6a0
Reviewed-on: https://go-review.googlesource.com/c/sys/+/418903
TryBot-Result: Gopher Robot <gobot@golang.org>
Run-TryBot: Russ Cox <rsc@golang.org>
Reviewed-by: David Chase <drchase@google.com>
2022-07-22 15:52:57 +00:00
ianwoolf
c6bc011c0c unix: add socket constants
Fixes golang/go#53557

Change-Id: Ic3d57d9431d7c89f6650ff742888481bcabb23c6
Reviewed-on: https://go-review.googlesource.com/c/sys/+/417994
Reviewed-by: Ian Lance Taylor <iant@google.com>
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
Run-TryBot: Ian Lance Taylor <iant@google.com>
Auto-Submit: Ian Lance Taylor <iant@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
2022-07-21 23:06:56 +00:00
Florian Lehner
c0bba94af5 unix: add constants for netlink/audit
Change-Id: Idaa02498b43360fa647d52423bc2f4c0cd5a9523
Reviewed-on: https://go-review.googlesource.com/c/sys/+/416754
Reviewed-by: Ian Lance Taylor <iant@google.com>
Reviewed-by: Bryan Mills <bcmills@google.com>
Reviewed-by: Tobias Klauser <tobias.klauser@gmail.com>
2022-07-15 15:14:00 +00:00
Meng Zhuo
0a85c31ab5 unix: add freebsd/riscv64 support
For golang/go#53466

Change-Id: If5a4dc674cb1856ac580fb87d8030d50fa7c95dd
Reviewed-on: https://go-review.googlesource.com/c/sys/+/416834
Reviewed-by: Benny Siegert <bsiegert@gmail.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Bryan Mills <bcmills@google.com>
Run-TryBot: Meng Zhuo <mzh@golangcn.org>
Reviewed-by: Yuval Pavel Zholkover <paulzhol@gmail.com>
Reviewed-by: Dmitri Goutnik <dgoutnik@gmail.com>
2022-07-12 01:45:10 +00:00
Meng Zhuo
5a0f0661e0 cpu: support non-linux OS for riscv64
Fixes golang/go#53698

Change-Id: Ia954aed4445a47fb8f8a2c0b9869aa8c50f2de15
Reviewed-on: https://go-review.googlesource.com/c/sys/+/416394
Auto-Submit: Meng Zhuo <mzh@golangcn.org>
Reviewed-by: Heschi Kreinick <heschi@google.com>
Run-TryBot: Meng Zhuo <mzh@golangcn.org>
Reviewed-by: Benny Siegert <bsiegert@gmail.com>
Reviewed-by: Tobias Klauser <tobias.klauser@gmail.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Joel Sing <joel@sing.id.au>
2022-07-08 08:52:39 +00:00
Yuval Pavel Zholkover
05e143d24a unix: regenerate on FreeBSD 12.3
Switch mksysnum to use https://cgit.freebsd.org/src/plain/sys/kern/syscalls.master?h=stable/12.
Also remove the SAL 2.0 annotations.

remove FreeBSD 11 and below 64bit inode compatibility shims

Drop the errors_freebsd_GOARCH.go files.

Drop PTRACE_* and additional (arch specific) consts added as part of golang.org/cl/179099 to types_freebsd.
Add <sys/ptrace.h> to mkerror.sh for FreeBSD instead.

Run mkall.sh on FreeBSD 12.3 on amd64 and arm64 hosts with i386 and armv7 jails
for all supported arches.

Updates golang/go#53280

Change-Id: Idd29056829013a1f6eb26376978632645e4018ef
Reviewed-on: https://go-review.googlesource.com/c/sys/+/415714
Reviewed-by: Ian Lance Taylor <iant@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: David Chase <drchase@google.com>
Reviewed-by: Tobias Klauser <tobias.klauser@gmail.com>
Run-TryBot: Ian Lance Taylor <iant@golang.org>
2022-07-04 08:42:25 +00:00
Dan Kortschak
31831981b6 windows: add remaining IpAdapterAddresses fields
Change-Id: I373baee2c82c376f4718d9296ae19ba8a28a2693
Reviewed-on: https://go-review.googlesource.com/c/sys/+/415814
Reviewed-by: Alex Brainman <alex.brainman@gmail.com>
Reviewed-by: Than McIntosh <thanm@google.com>
Reviewed-by: David Chase <drchase@google.com>
Run-TryBot: Dan Kortschak <dan@kortschak.io>
TryBot-Result: Gopher Robot <gobot@golang.org>
2022-07-02 02:00:25 +00:00
Dan Kortschak
179beb0bd1 windows: add GetBestInterfaceEx
Change-Id: I56f9212420f96a0f275e79b4a9766b09b175254d
Reviewed-on: https://go-review.googlesource.com/c/sys/+/413495
Reviewed-by: Ian Lance Taylor <iant@google.com>
Reviewed-by: Damien Neil <dneil@google.com>
Run-TryBot: Dan Kortschak <dan@kortschak.io>
Run-TryBot: Alex Brainman <alex.brainman@gmail.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Alex Brainman <alex.brainman@gmail.com>
2022-07-01 22:57:01 +00:00
Joel Sing
f75cf1eec3 unix: provide Msghdr.SetIovlen on openbsd/mips64
Fixes golang/go#53575

Change-Id: Ie9bbe074f9adaf9c194e4458bbf2efb3acd8f110
Reviewed-on: https://go-review.googlesource.com/c/sys/+/414554
Reviewed-by: David Chase <drchase@google.com>
Run-TryBot: Joel Sing <joel@sing.id.au>
Reviewed-by: Bryan Mills <bcmills@google.com>
Reviewed-by: Tobias Klauser <tobias.klauser@gmail.com>
2022-06-27 19:12:45 +00:00
Ian Lance Taylor
87e55d7148 unix: add RecvmsgBuffers and SendmsgBuffers
Fixes golang/go#52885

Change-Id: I04b5be1ac9543a3791ebc4cd59b9e35e958e0ba2
Reviewed-on: https://go-review.googlesource.com/c/sys/+/412497
Auto-Submit: Tobias Klauser <tobias.klauser@gmail.com>
Reviewed-by: Tobias Klauser <tobias.klauser@gmail.com>
Reviewed-by: Ian Lance Taylor <iant@google.com>
Reviewed-by: Carlos Amedee <carlos@golang.org>
Auto-Submit: Ian Lance Taylor <iant@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Run-TryBot: Ian Lance Taylor <iant@google.com>
2022-06-24 22:08:33 +00:00
Ian Lance Taylor
175b2fd9d6 unix: change Solaris Iovec.Base to *byte
Every other Iovec.Base field is *byte, and that is the only reasonable
value for Go. This is not backward compatible but we've made changes
like this before.

For golang/go#52885

Change-Id: I9a313a7931966a2483a322edd5c06c8cdca2557a
Reviewed-on: https://go-review.googlesource.com/c/sys/+/412496
TryBot-Result: Gopher Robot <gobot@golang.org>
Auto-Submit: Ian Lance Taylor <iant@google.com>
Reviewed-by: Tobias Klauser <tobias.klauser@gmail.com>
Run-TryBot: Ian Lance Taylor <iant@google.com>
Reviewed-by: Alex Rakoczy <alex@golang.org>
Reviewed-by: Ian Lance Taylor <iant@google.com>
Auto-Submit: Tobias Klauser <tobias.klauser@gmail.com>
Run-TryBot: Ian Lance Taylor <iant@golang.org>
2022-06-22 16:19:53 +00:00
Tobias Klauser
4f61da869c unix: use ByteSliceToString in TestMountUnmount on zos
Use the existing ByteSliceToString implementation instead of duplicating
it in TestMountUnmount.

Change-Id: Ia47510ac1ac8094a7e9265edf8a452bcacf06032
Reviewed-on: https://go-review.googlesource.com/c/sys/+/411379
TryBot-Result: Gopher Robot <gobot@golang.org>
Auto-Submit: Ian Lance Taylor <iant@golang.org>
Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com>
Reviewed-by: Ian Lance Taylor <iant@google.com>
Reviewed-by: Cherry Mui <cherryyz@google.com>
Run-TryBot: Ian Lance Taylor <iant@golang.org>
2022-06-15 21:35:10 +00:00
Will Hawkins
ff8c426e75 unix: add support for TCP_CONNECTION_INFO on macOS
x/sys provides support for accessing TCP_INFO on Linux but does
not provide support for accessing the equivalent (TCP_CONNECTION_INFO)
on macOS. This patch adds that functionality.

Fixes golang/go#53330

Change-Id: Ia1c1bf79a8bbb76f3ccfe58c61e1a82e08735152
Reviewed-on: https://go-review.googlesource.com/c/sys/+/411734
Run-TryBot: Ian Lance Taylor <iant@google.com>
Auto-Submit: Ian Lance Taylor <iant@google.com>
Reviewed-by: Ian Lance Taylor <iant@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Cherry Mui <cherryyz@google.com>
Reviewed-by: Tobias Klauser <tobias.klauser@gmail.com>
Run-TryBot: Ian Lance Taylor <iant@golang.org>
2022-06-15 21:25:26 +00:00
Tobias Klauser
bf31f56cad unix: add MemfdSecret on linux/riscv64
Now that SYS_MEMFD_SECRET is defined on linux/riscv64, CL 398514 can be
reverted to provide MemfdSecret on that platform as well.

Fixes golang/go#51547

Change-Id: I48e3e029fd2a3aeb860d69faf387bc10753759c7
Reviewed-on: https://go-review.googlesource.com/c/sys/+/411376
TryBot-Result: Gopher Robot <gobot@golang.org>
Run-TryBot: Ian Lance Taylor <iant@google.com>
Reviewed-by: Ian Lance Taylor <iant@google.com>
Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com>
Reviewed-by: Cherry Mui <cherryyz@google.com>
Auto-Submit: Ian Lance Taylor <iant@google.com>
2022-06-15 21:21:20 +00:00
Tobias Klauser
af78867b19 unix/linux: update to Linux kernel 5.19-rc2
Update to 5.19-rc2 instead of 5.18 for the following reasons:

- Support for LoongArch has been merged upstream. This allows to drop
  the loong64 specific kernel patches.
- Fixes [1] an issue encountered with when generating the
  SOCK_TXREHASH_DEFAULT constant from linux/socket.h on 5.18
- Contains a fix [2] to provide SYS_MEMFD_SECRET on linux/riscv64 as
  well, The underlying syscall was already available in earlier kernel
  versions. Also see golang/go#51547.

[1] https://lore.kernel.org/r/20220531094345.13801-1-tklauser@distanz.ch
[2] https://lore.kernel.org/r/20220505081815.22808-1-tklauser@distanz.ch

Change-Id: I6c3ec30a067eae339c443ee55962d94c84feffd9
Reviewed-on: https://go-review.googlesource.com/c/sys/+/411375
Auto-Submit: Tobias Klauser <tobias.klauser@gmail.com>
Reviewed-by: Ian Lance Taylor <iant@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Auto-Submit: Ian Lance Taylor <iant@google.com>
Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com>
Run-TryBot: Ian Lance Taylor <iant@google.com>
Reviewed-by: Cherry Mui <cherryyz@google.com>
2022-06-15 21:21:18 +00:00