Commit Graph

1418 Commits

Author SHA1 Message Date
Johan Jansson
3ca3b18c8b windows: add GetLargePageMinimum
https://learn.microsoft.com/en-us/windows/win32/api/memoryapi/nf-memoryapi-getlargepageminimum

Fixes golang/go#53900

Change-Id: If460e926af0cfa3fcf0d01422411abd01dae791c
Reviewed-on: https://go-review.googlesource.com/c/sys/+/444975
Run-TryBot: Alex Brainman <alex.brainman@gmail.com>
Reviewed-by: Jenny Rakoczy <jenny@golang.org>
Reviewed-by: Cherry Mui <cherryyz@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Alex Brainman <alex.brainman@gmail.com>
v0.3.0
2022-12-03 00:43:30 +00:00
Sebastiaan van Stijn
d684c6f886 execabs: isGo119ErrDot: use errors.Is instead of string-matching
Addresses the TODO added in CL 403256.

Change-Id: Iae44242e00b6a309cc0f1e336462bc2d4995a5e2
GitHub-Last-Rev: 1adfdb7994
GitHub-Pull-Request: golang/sys#142
Reviewed-on: https://go-review.googlesource.com/c/sys/+/448877
Auto-Submit: Ian Lance Taylor <iant@google.com>
Run-TryBot: Ian Lance Taylor <iant@google.com>
Reviewed-by: Michael Knyszek <mknyszek@google.com>
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@google.com>
2022-11-10 21:11:17 +00:00
Marten Seemann
fc697a31fa unix: add ParseOneSocketControlMessage to parse control messages without allocating
Fixes golang/go#54714.

Change-Id: If711272937078b6c696756823aa4dfcec358b719
Reviewed-on: https://go-review.googlesource.com/c/sys/+/425917
Reviewed-by: Matt Layher <mdlayher@gmail.com>
Reviewed-by: Michael Pratt <mpratt@google.com>
Reviewed-by: Ian Lance Taylor <iant@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Run-TryBot: Ian Lance Taylor <iant@google.com>
Auto-Submit: Ian Lance Taylor <iant@google.com>
Run-TryBot: Matt Layher <mdlayher@gmail.com>
v0.2.0
2022-11-02 19:48:38 +00:00
Ian Lance Taylor
5726498127 unix: in Linux sendmsgN actually send one normal byte
A bug in CL 412497 caused us to set up an iovec for a dummy byte
but fail to use it

Fixes golang/go#56384

Change-Id: If56fea5c47e5c6fac92f9707d4c3dd78f7999a65
Reviewed-on: https://go-review.googlesource.com/c/sys/+/445255
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@google.com>
Reviewed-by: Tobias Klauser <tobias.klauser@gmail.com>
Auto-Submit: Ian Lance Taylor <iant@google.com>
Run-TryBot: Ian Lance Taylor <iant@google.com>
Run-TryBot: Ian Lance Taylor <iant@golang.org>
Reviewed-by: Heschi Kreinick <heschi@google.com>
2022-10-25 17:44:04 +00:00
dustin-ward
95e765b1cc x/sys/unix: make ReadDirent available on zOS
Currently ReadDirent is not available on zOS. This implementation modifies the current darwin implementation to work on zOS.

Also make tests available on zOS.

Fixes golang/go#54528
Fixes golang/go#54587

Change-Id: I62a09d0068ec8c5fdc849a411ce43bdf14ca3926
Reviewed-on: https://go-review.googlesource.com/c/sys/+/424778
Reviewed-by: Ian Lance Taylor <iant@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Joedian Reid <joedian@golang.org>
Reviewed-by: Bill O'Farrell <billotosyr@gmail.com>
Run-TryBot: Ian Lance Taylor <iant@google.com>
Auto-Submit: Ian Lance Taylor <iant@google.com>
v0.1.0
2022-10-13 17:17:32 +00:00
Joel Sing
090e33056c unix: add support for openbsd/ppc64
Updates golang/go#56001

Change-Id: Ic2c7db7a0c2056d3bbc153066c187f27508cb96c
Reviewed-on: https://go-review.googlesource.com/c/sys/+/439978
Reviewed-by: Ian Lance Taylor <iant@google.com>
Run-TryBot: Joel Sing <joel@sing.id.au>
Reviewed-by: Bryan Mills <bcmills@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Tobias Klauser <tobias.klauser@gmail.com>
2022-10-10 17:02:43 +00:00
Joel Sing
3938a4f48c cpu: add support for ppc64 on platforms other than aix and linux
This allows the cpu package to function on openbsd/ppc64.

Updates golang/go#56001

Change-Id: Iff306b6091da8f7dc28dd1bd2c9ba668b5318a67
Reviewed-on: https://go-review.googlesource.com/c/sys/+/439977
Run-TryBot: Joel Sing <joel@sing.id.au>
Reviewed-by: Ian Lance Taylor <iant@google.com>
Reviewed-by: Tobias Klauser <tobias.klauser@gmail.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Bryan Mills <bcmills@google.com>
2022-10-10 17:02:31 +00:00
Joel Sing
a970992b06 unix: add support for openbsd/riscv64
Updates golang/go#55999

Change-Id: I2ea76f72faaddc46da0c37650de702bc7e90eea2
Reviewed-on: https://go-review.googlesource.com/c/sys/+/439976
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@google.com>
Reviewed-by: Bryan Mills <bcmills@google.com>
Run-TryBot: Joel Sing <joel@sing.id.au>
Reviewed-by: Tobias Klauser <tobias.klauser@gmail.com>
2022-10-10 17:02:16 +00:00
Joel Sing
e2bdbfeefc unix: flip openbsd libc build tags
Rather than listing OpenBSD architectures that are using libc, list the one
that is still blocked on direct system calls. This will simplify the addition
of new OpenBSD ports.

Updates golang/go#36435

Change-Id: I8d1d16a033245af436d955b5fa6ceeaa1f2a9f6b
Reviewed-on: https://go-review.googlesource.com/c/sys/+/439975
Run-TryBot: Joel Sing <joel@sing.id.au>
Reviewed-by: Bryan Mills <bcmills@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@google.com>
Reviewed-by: Tobias Klauser <tobias.klauser@gmail.com>
2022-10-10 17:01:58 +00:00
Sebastiaan van Stijn
abe0a0adba windows: replace uses of Close() with CloseHandle()
Since https://golang.org/cl/4600042, Close is a straight wrapper of CloseHandle.

Change-Id: I45067e3cc649ea40deb88a8d9d223d7ca882ee7f
GitHub-Last-Rev: 076621a25c
GitHub-Pull-Request: golang/sys#139
Reviewed-on: https://go-review.googlesource.com/c/sys/+/441436
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>
Reviewed-by: Bryan Mills <bcmills@google.com>
2022-10-10 16:03:19 +00:00
Nahum Shalman
68d869b943 unix: migrate some illumos definitions to solaris
Fixes golang/go#56000

Change-Id: Ica6549385ddb466c4697cc45851e2b59fd6e0f24
Reviewed-on: https://go-review.googlesource.com/c/sys/+/437357
Run-TryBot: Ian Lance Taylor <iant@google.com>
Auto-Submit: Ian Lance Taylor <iant@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Tobias Klauser <tobias.klauser@gmail.com>
Reviewed-by: Ian Lance Taylor <iant@google.com>
Reviewed-by: Bryan Mills <bcmills@google.com>
2022-10-10 16:01:39 +00:00
kxxt
84dc82d7e8 all: use grep -E/-F instead of fgrep/egrep
egrep and fgrep are obsolescent now.

This PR updates all egrep and fgrep commands to grep -E and grep -F.
Running egrep/fgrep command with grep v3.8 will output the following warning to stderr:
egrep: warning: egrep is obsolescent; using grep -E

see also:
https://www.phoronix.com/news/GNU-Grep-3.8-Stop-egrep-fgrep
https://lists.gnu.org/archive/html/info-gnu/2022-09/msg00001.html

Change-Id: I0c6b6a039063d6aee94e8500971001996d4e498c
GitHub-Last-Rev: 1eee614766
GitHub-Pull-Request: golang/sys#137
Reviewed-on: https://go-review.googlesource.com/c/sys/+/432835
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>
Run-TryBot: Ian Lance Taylor <iant@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
2022-10-06 21:19:17 +00:00
Tobias Klauser
f11e5e49a4 unix: use unsafe.Slice in (*FileHandle).Bytes
Change-Id: Ic2b88577ec6fd975bbba0538790d2ff312d85d3f
Reviewed-on: https://go-review.googlesource.com/c/sys/+/435776
Reviewed-by: Benny Siegert <bsiegert@gmail.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Auto-Submit: Tobias Klauser <tobias.klauser@gmail.com>
Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com>
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
2022-09-28 14:01:12 +00:00
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