Kir Kolyshkin
0a5406a544
unix: add mount_setattr support for linux
...
This brings in mount_setattr(2) support, added to Linux 5.12 kernel and
documented at https://man7.org/linux/man-pages/man2/mount_setattr.2.html
Change-Id: I5609980c18aef80f9429a8c8cec8c1e129f74ab7
Reviewed-on: https://go-review.googlesource.com/c/sys/+/363444
Reviewed-by: Ian Lance Taylor <iant@golang.org >
Reviewed-by: Tobias Klauser <tobias.klauser@gmail.com >
Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com >
2021-11-16 06:13:58 +00:00
Ian Lance Taylor
0c823b97ae
unix: avoid depending on consistent Revents type in TestPoll
...
For golang/go#49380
Change-Id: Ie1d370681962d9f69ef54b33ddf38e4c74a2e298
Reviewed-on: https://go-review.googlesource.com/c/sys/+/363660
Trust: Ian Lance Taylor <iant@golang.org >
Run-TryBot: Ian Lance Taylor <iant@golang.org >
TryBot-Result: Go Bot <gobot@golang.org >
Reviewed-by: Michael Knyszek <mknyszek@google.com >
2021-11-13 00:15:01 +00:00
Michael Anthony Knyszek
faf0a1b62c
unix: identify unexpected events that fired in TestPoll
...
Currently if TestPoll fails because an unexpected event fired, we just
print that it happened, not which one fired. #49380 has been difficult
to reproduce, so printing more information for this case would be
helpful.
Updates #49380 .
Change-Id: I820c4b634536565487ee1474f8afe092a8a4443b
Reviewed-on: https://go-review.googlesource.com/c/sys/+/363714
Trust: Michael Knyszek <mknyszek@google.com >
Run-TryBot: Michael Knyszek <mknyszek@google.com >
TryBot-Result: Go Bot <gobot@golang.org >
Reviewed-by: Bryan C. Mills <bcmills@google.com >
2021-11-12 19:34:37 +00:00
Johan Jansson
7580c6e521
unix: factor out mkmerge into a proper package
...
Factor mkmerge.go and mkmerge_test.go into package internal/mkmerge.
Due to ignore constraints, mkmerge_test.go wasn't run by the Go
builders and failing tests were unnoticed.
Factoring mkmerge into its own package and removing ignore constraints
makes the tests run automatically by the Go builders.
Fixes golang/go#49484
Change-Id: I56a0b7220e40d1d7e5193490cb547cad4202f9ac
Reviewed-on: https://go-review.googlesource.com/c/sys/+/363334
Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com >
Reviewed-by: Bryan C. Mills <bcmills@google.com >
Reviewed-by: Tobias Klauser <tobias.klauser@gmail.com >
Trust: Bryan C. Mills <bcmills@google.com >
TryBot-Result: Go Bot <gobot@golang.org >
2021-11-12 16:43:55 +00:00
Johan Jansson
7c45f0c2c7
unix: mount Docker-based builder at x/sys
...
Mount the data volume for the Docker-based builder at x/sys instead of
x/sys/unix.
The x/sys/go.mod file was not included in the data volume when mounting
x/sys/unix. This breaks module-aware go commands that run within the
Docker container.
Fix this problem by mounting the volume at x/sys and updating the
working directory of the builder accordingly.
Updates golang/go#49484
Change-Id: I2346b5320413b48de4984c9d9e31203941336357
Reviewed-on: https://go-review.googlesource.com/c/sys/+/363594
Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com >
TryBot-Result: Go Bot <gobot@golang.org >
Reviewed-by: Bryan C. Mills <bcmills@google.com >
Reviewed-by: Tobias Klauser <tobias.klauser@gmail.com >
Trust: Bryan C. Mills <bcmills@google.com >
2021-11-12 16:43:26 +00:00
Bryan C. Mills
c6105e7cf7
unix: in TestClockNanosleep, compare wall times when sleeping until wall times
...
Previously, we were sleeping until a wall time but then comparing the
duration slept using monotonic time. If the wall time happens to jump
during the sleep, the monotonic time can legitimately be shorter than
the wall time.
Fixes golang/go#42513
Change-Id: Iaef8d9ba46082e821f5cb18c96b9869238d7af05
Reviewed-on: https://go-review.googlesource.com/c/sys/+/363456
Trust: Bryan C. Mills <bcmills@google.com >
Run-TryBot: Bryan C. Mills <bcmills@google.com >
TryBot-Result: Go Bot <gobot@golang.org >
Reviewed-by: Ian Lance Taylor <iant@golang.org >
Reviewed-by: Tobias Klauser <tobias.klauser@gmail.com >
2021-11-12 14:30:42 +00:00
Bryan C. Mills
f221eed1c0
unix: in TestSelect, only error for an early wakeup on Linux
...
On Linux, 'man 2 select' explicitly lists the conditions under which
select may return before the timeout interval. Most other platforms
make no such guarantee, so do not test for it on those platforms.
Fixes golang/go#36409
Change-Id: I194a34af3132a7db7fc186dec9de67fa6dd0bfae
Reviewed-on: https://go-review.googlesource.com/c/sys/+/363455
Trust: Bryan C. Mills <bcmills@google.com >
Run-TryBot: Bryan C. Mills <bcmills@google.com >
TryBot-Result: Go Bot <gobot@golang.org >
Reviewed-by: Ian Lance Taylor <iant@golang.org >
2021-11-11 21:35:25 +00:00
Bryan C. Mills
99a53858aa
all: add missing //go:build comments
...
These were apparently overlooked in CL 357329, CL 294490, CL 296889,
and other various updates to this module. (I noticed them via gopls
while investigating golang/go#49466.)
Updates golang/go#41184
Change-Id: Id042bb6fe5282e6d528e9315acf2ad29d0df58ba
Reviewed-on: https://go-review.googlesource.com/c/sys/+/362577
Trust: Bryan C. Mills <bcmills@google.com >
Run-TryBot: Bryan C. Mills <bcmills@google.com >
Reviewed-by: Ian Lance Taylor <iant@golang.org >
Reviewed-by: Tobias Klauser <tobias.klauser@gmail.com >
TryBot-Result: Go Bot <gobot@golang.org >
2021-11-10 15:43:04 +00:00
Tobias Klauser
02f5c0300f
unix: fix fsync for read-only files on aix
...
On aix, the fsync syscall doesn't work on read-only files. Use
fsync_range instead to allow Fsync to work on any file.
Follow CL 254657 which did the same in package syscall.
For golang/go#41372
Change-Id: Ibc55ecf5c43e27a04281af1a204f847eeafeea63
Reviewed-on: https://go-review.googlesource.com/c/sys/+/362274
Trust: Tobias Klauser <tobias.klauser@gmail.com >
Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com >
TryBot-Result: Go Bot <gobot@golang.org >
Reviewed-by: Ian Lance Taylor <iant@golang.org >
2021-11-09 06:54:45 +00:00
Koichi Shiraishi
cbcd623f20
unix: generate darwinTests per GOARCH and enabled darwin/arm64 test
...
Change-Id: I1c5bb166f6971f83890a08413aa8b35fe23a0c04
Reviewed-on: https://go-review.googlesource.com/c/sys/+/357069
Trust: Tobias Klauser <tobias.klauser@gmail.com >
Reviewed-by: Tobias Klauser <tobias.klauser@gmail.com >
Reviewed-by: Ian Lance Taylor <iant@golang.org >
Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com >
TryBot-Result: Go Bot <gobot@golang.org >
2021-11-08 22:43:32 +00:00
Tobias Klauser
e0b2ad06fe
unix: fix finalizer fd close bug in TestOpenByHandleAt
...
The raw fd is successively wrapped using os.NewFile, so dont defer close
the raw fd, but instead use (*os.File).Close.
Fixes golang/go#49403
Change-Id: I1f4b12536ff0abea6b1680a4ff932b7eefa57162
Reviewed-on: https://go-review.googlesource.com/c/sys/+/361995
Trust: Tobias Klauser <tobias.klauser@gmail.com >
Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com >
TryBot-Result: Go Bot <gobot@golang.org >
Reviewed-by: Ian Lance Taylor <iant@golang.org >
2021-11-07 10:43:06 +00:00
Tobias Klauser
ebca88c72f
unix/linux: update Dockerfile to Go 1.17.3
...
Change-Id: I14bced7165e0d3307950e922048cd38b1197f5fe
Reviewed-on: https://go-review.googlesource.com/c/sys/+/361994
Trust: Tobias Klauser <tobias.klauser@gmail.com >
Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com >
TryBot-Result: Go Bot <gobot@golang.org >
Reviewed-by: Matt Layher <mdlayher@gmail.com >
2021-11-06 13:20:15 +00:00
Tobias Klauser
c75c47738b
unix, windows: copy arrays by assignment instead of looping
...
Follow CL 360602 which did the same in package syscall.
Change-Id: Ibf6d86dea1cb118e869618c66da72da281adb2d7
Reviewed-on: https://go-review.googlesource.com/c/sys/+/361574
Trust: Tobias Klauser <tobias.klauser@gmail.com >
Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com >
TryBot-Result: Go Bot <gobot@golang.org >
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org >
2021-11-05 18:34:46 +00:00
Tobias Klauser
ae416a5f93
unix: regenerate type Clockinfo on OpenBSD 6.9
...
OpenBSD 6.9 changed the definition of Clockinfo, leading
TestSysctlClockinfo to fail on OpenBSD 6.9 onwards. Since OpenBSD 6.8 is
no longer supported upstream, regenerate Clockinfo on that release and
test that SysctlClockInfo fails gracefully on OpenBSD 6.8 and earlier.
Fixes golang/go#47629
For golang/go#48977
Change-Id: Ia511b8601af11f70ffcce0f96764c69a67d626b8
Reviewed-on: https://go-review.googlesource.com/c/sys/+/360694
Trust: Tobias Klauser <tobias.klauser@gmail.com >
Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com >
TryBot-Result: Go Bot <gobot@golang.org >
Reviewed-by: Bryan C. Mills <bcmills@google.com >
Reviewed-by: Joel Sing <joel@sing.id.au >
2021-11-03 18:47:34 +00:00
Koichi Shiraishi
4dd72447c2
unix: add stdint.h for mkall.sh on darwin/arm64
...
currently occured below error:
In file included from /Users/zchee/go/src/golang.org/x/sys/unix/types_darwin.go:24:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/signal.h:63:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/sys/signal.h:146:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/machine/_mcontext.h:34:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/arm/_mcontext.h:36:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/mach/machine/_structs.h:35:
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/mach/arm/_structs.h:482:2: error: unknown type name 'uint32_t'
uint32_t fpsr;
^
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/mach/arm/_structs.h:483:2: error: unknown type name 'uint32_t'
uint32_t fpcr;
^
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/mach/arm/_structs.h:489:2: error: unknown type name 'uint32_t'
uint32_t fpsr;
^
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/mach/arm/_structs.h:490:2: error: unknown type name 'uint32_t'
uint32_t fpcr;
^
4 errors generated.
Change-Id: Iba2520fbf600914d3e8ed54b073039a6470846f7
Reviewed-on: https://go-review.googlesource.com/c/sys/+/357070
Reviewed-by: Tobias Klauser <tobias.klauser@gmail.com >
Reviewed-by: Ian Lance Taylor <iant@golang.org >
2021-11-02 19:28:58 +00:00
Tobias Klauser
a2f17f7b99
unix: allow passing optional args to SysctlKinfoProcSlice
...
This allows using SysctlKinfoProcSlice to e.g. query processes by user
id using the kern.proc.uid sysctl and is still backwards compatible to
original implementation, i.e. still allows the kern.proc.all sysctl
without any additional arguments.
Change-Id: Ia2d76ce5b91a077221891e1f2dfd79a38d2be52b
Reviewed-on: https://go-review.googlesource.com/c/sys/+/359677
Trust: Tobias Klauser <tobias.klauser@gmail.com >
Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com >
TryBot-Result: Go Bot <gobot@golang.org >
Reviewed-by: Ian Lance Taylor <iant@golang.org >
2021-11-02 06:14:01 +00:00
Tobias Klauser
95da234e12
unix: add SysctlKinfoProc on darwin
...
This allows to get KinfoProc for a given process using
SysctlKinfoProcSlice("kern.proc.pid", pid) rather than having to query
all processes using SysctlKinfoProcSlice() and the extracting the
relevant KinfoProc.
Change-Id: I965ea5c77d6f3441592b4540c54ab56f6ac9e27d
Reviewed-on: https://go-review.googlesource.com/c/sys/+/359676
Trust: Tobias Klauser <tobias.klauser@gmail.com >
Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com >
TryBot-Result: Go Bot <gobot@golang.org >
Reviewed-by: Ian Lance Taylor <iant@golang.org >
2021-11-02 06:13:51 +00:00
Tobias Klauser
39c9dd3799
unix/linux: update Dockerfile to Kernel 5.15
...
Change-Id: I032465fbaecd49ffb6048577cd2f3fcb3d8e11d0
Reviewed-on: https://go-review.googlesource.com/c/sys/+/359678
Trust: Tobias Klauser <tobias.klauser@gmail.com >
Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com >
TryBot-Result: Go Bot <gobot@golang.org >
Reviewed-by: Ian Lance Taylor <iant@golang.org >
2021-11-01 20:44:03 +00:00
Koichi Shiraishi
b3129d9d10
unix: fix difference Stat_t type and Statfs_t type per GOARCH on darwin
...
In darwin/arm64, has the libc_fstat{fs} trampoline, not libc_fstat{fs}64.
But types_darwin.go defined same C types.
Change-Id: Ia33c60029eb59360e421f42ef79efe890eba3e3e
Reviewed-on: https://go-review.googlesource.com/c/sys/+/357071
Reviewed-by: Ian Lance Taylor <iant@golang.org >
Trust: Tobias Klauser <tobias.klauser@gmail.com >
2021-10-30 16:08:13 +00:00
Tobias Klauser
565ff80d9b
unix: change darwin Eproc/ExternProc members from int8 array to byte array
...
CL 328169 added Eproc and ExternProc types on darwin which have some
int8 array members containing human-readable strings. In order to make
it easier to convert these to Go strings, change them to byte arrays.
Change-Id: I200494fd90d8506bce0f52a039ea59703981c8d3
Reviewed-on: https://go-review.googlesource.com/c/sys/+/359674
Trust: Tobias Klauser <tobias.klauser@gmail.com >
Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com >
TryBot-Result: Go Bot <gobot@golang.org >
Reviewed-by: Ian Lance Taylor <iant@golang.org >
2021-10-30 16:03:51 +00:00
Tobias Klauser
69cdffdb93
unix: use default directories in TestGetwd on darwin/arm64
...
Go 1.16 renamed the iOS port from darwin/arm64 to ios/arm64 and
darwin/arm64 was repurposed for the macOS ARM64 port (see
https://golang.org/doc/go1.16#darwin ).
Now that Go 1.16 is the oldest supported release, the ios tag can be
used exclusively to detect iOS and TestGetwd can use the same list of
directories as other systems.
For golang/go#45696
Change-Id: Ic334df5ea88ac034a9d9271f6cd570617f208f05
Reviewed-on: https://go-review.googlesource.com/c/sys/+/358254
Trust: Tobias Klauser <tobias.klauser@gmail.com >
Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com >
TryBot-Result: Go Bot <gobot@golang.org >
Reviewed-by: Cherry Mui <cherryyz@google.com >
2021-10-25 20:12:05 +00:00
Lorenz Bauer
711f33c999
unix: add ParseOrigDstAddr
...
Add a function which turns a SocketControlMessage into a Sockaddr.
This can be used with IP(V6)_RECVORIGDSTADDR to retrieve the original
destination address of a packet.
Change-Id: Ib2d80cd01be6642e8b918cbc1584d4a49c3c6f1e
Reviewed-on: https://go-review.googlesource.com/c/sys/+/355609
Reviewed-by: Tobias Klauser <tobias.klauser@gmail.com >
Reviewed-by: Ian Lance Taylor <iant@golang.org >
Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com >
TryBot-Result: Go Bot <gobot@golang.org >
2021-10-25 11:29:17 +00:00
Lorenz Bauer
8e5104632a
unix: add functions to encode Inet4Pktinfo and Inet6Pktinfo
...
It's possible to control the source address of a UDP packet by
passing a socket control message of type IP_PKTINFO or IPV6_PKTINFO.
This is a somewhat esoteric feature of the network stack, but it's
extremely useful feature when you really need it.
Change-Id: I8300575f975679f6689d6f1282af253ba62e8f9d
Reviewed-on: https://go-review.googlesource.com/c/sys/+/355610
Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com >
TryBot-Result: Go Bot <gobot@golang.org >
Reviewed-by: Ian Lance Taylor <iant@golang.org >
Trust: Tobias Klauser <tobias.klauser@gmail.com >
2021-10-22 21:59:31 +00:00
Koichi Shiraishi
9d821ace86
unix: add all trampoline_addr to darwin_test.go and sorted
...
lacked:
libc_clock_gettime_trampoline_addr
libc_clonefile_trampoline_addr
libc_clonefileat_trampoline_addr
libc_fclonefileat_trampoline_addr
libc_getcwd_trampoline_addr
libc_sendfile_trampoline_addr
libc_setattrlist_trampoline_addr
libc_shmat_trampoline_addr
libc_shmctl_trampoline_addr
libc_shmdt_trampoline_addr
libc_shmget_trampoline_addr
Change-Id: I5722c61db415fd409a05c351959740d57891db04
Reviewed-on: https://go-review.googlesource.com/c/sys/+/354469
Run-TryBot: Ian Lance Taylor <iant@golang.org >
TryBot-Result: Go Bot <gobot@golang.org >
Reviewed-by: Ian Lance Taylor <iant@golang.org >
Reviewed-by: Cherry Mui <cherryyz@google.com >
2021-10-19 18:19:41 +00:00
Tobias Klauser
69063c4bb7
unix: test AF_VSOCK sockets on linux
...
Follow the implementation of the tests added in CL 354269 for darwin.
Change-Id: I00701227dfb26169a356d875ddb3737849d0bba0
Reviewed-on: https://go-review.googlesource.com/c/sys/+/356289
Trust: Tobias Klauser <tobias.klauser@gmail.com >
Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com >
TryBot-Result: Go Bot <gobot@golang.org >
Reviewed-by: Matt Layher <mdlayher@gmail.com >
2021-10-15 20:08:01 +00:00
Koichi Shiraishi
1a26e0398e
unix: add SockaddrVM type and AF_VSOCK to anyToSockaddrGOOS to darwin
...
Change-Id: I511be555d92ac87a797949fc4c99fd8ef9515ace
Reviewed-on: https://go-review.googlesource.com/c/sys/+/354269
Trust: Tobias Klauser <tobias.klauser@gmail.com >
Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com >
TryBot-Result: Go Bot <gobot@golang.org >
Reviewed-by: Tobias Klauser <tobias.klauser@gmail.com >
Reviewed-by: Ian Lance Taylor <iant@golang.org >
2021-10-06 22:55:09 +00:00
Koichi Shiraishi
c8a6f52230
unix: fix lack of Sysv shared trampoline on darwin/arm64
...
In CL 353509, doesn't generate Sysv shared trampoline for darwin/arm64.
Change-Id: Id4a87205000d2b4169204992ead3d042d1d5aef4
Reviewed-on: https://go-review.googlesource.com/c/sys/+/354270
Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com >
TryBot-Result: Go Bot <gobot@golang.org >
Reviewed-by: Tobias Klauser <tobias.klauser@gmail.com >
Reviewed-by: Ian Lance Taylor <iant@golang.org >
2021-10-06 19:47:10 +00:00
Koichi Shiraishi
2c5d950f24
unix: support vsock for darwin
...
Change-Id: Id53e2b0d0dc3b83762bb4ccc001d4e40f738de73
Reviewed-on: https://go-review.googlesource.com/c/sys/+/352209
Run-TryBot: Ian Lance Taylor <iant@golang.org >
TryBot-Result: Go Bot <gobot@golang.org >
Reviewed-by: Ian Lance Taylor <iant@golang.org >
Reviewed-by: Tobias Klauser <tobias.klauser@gmail.com >
2021-10-04 09:30:28 +00:00
Tobias Klauser
b1ebd4e100
unix: enable Sysv shared memory support on darwin/arm64
...
Keep it disabled on ios though.
For golang/go#45696
For golang/go#46084
Change-Id: I3d551227a4ebc0eebabdd16b175aa6a75ea9de19
Reviewed-on: https://go-review.googlesource.com/c/sys/+/353509
Trust: Tobias Klauser <tobias.klauser@gmail.com >
Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com >
Reviewed-by: Ian Lance Taylor <iant@golang.org >
2021-10-03 12:29:50 +00:00
Tobias Klauser
b1447f3f25
unix: enable TestPassFD and TestPoll on darwin/arm64
...
Go 1.16 renamed the iOS port from darwin/arm64 to ios/arm64 and
darwin/arm64 was repurposed for the macOS ARM64 port (see
https://golang.org/doc/go1.16#darwin ).
Now that Go 1.16 is the oldest supported release, the ios tag can be
used exclusively to detect iOS. Thus, TestPassFD and TestPoll which
ought to run on darwin/arm64 can now be enabled on that platform.
For golang/go#45696
Change-Id: I0b542af7a1b5ab194bf249d499c49e45bb55a2e1
Reviewed-on: https://go-review.googlesource.com/c/sys/+/353529
Trust: Tobias Klauser <tobias.klauser@gmail.com >
Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com >
TryBot-Result: Go Bot <gobot@golang.org >
Reviewed-by: Ian Lance Taylor <iant@golang.org >
2021-10-02 10:42:28 +00:00
Dustin Spicuzza
39dca1131b
unix: SysvShmCtl should use ipc_64 on mips64(le)
...
For golang/go#48708
Change-Id: Ieb5fdb5eb571af836268b69d3f1066ef8497a7b7
GitHub-Last-Rev: 59e24d8fdb
GitHub-Pull-Request: golang/sys#118
Reviewed-on: https://go-review.googlesource.com/c/sys/+/353398
Trust: Tobias Klauser <tobias.klauser@gmail.com >
Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com >
TryBot-Result: Go Bot <gobot@golang.org >
Reviewed-by: Tobias Klauser <tobias.klauser@gmail.com >
Reviewed-by: Ian Lance Taylor <iant@golang.org >
2021-10-01 09:24:34 +00:00
Ian Lance Taylor
f542c8878d
unix: skip TestSysvSharedMemory on ENOSYS
...
Whether System V IPC is supported is a kernel configuration.
For golang/go#48708
Change-Id: Id0d23a5ede5f75f70ca6bb0b8abaec773b6adc74
Reviewed-on: https://go-review.googlesource.com/c/sys/+/353392
Trust: Ian Lance Taylor <iant@golang.org >
Run-TryBot: Ian Lance Taylor <iant@golang.org >
Reviewed-by: Tobias Klauser <tobias.klauser@gmail.com >
2021-09-30 21:29:24 +00:00
Dustin Spicuzza
969570ce7c
unix: add Sysv shared memory support
...
Implements proposed API from https://golang.org/issue/46084 . I chose
`SysvShmDesc` since it's a clearer name than `SysvShm`. Initially supports Darwin and Linux.
Solaris support has a blocker (https://golang.org/issue/46084#issuecomment-836980018 )
For golang/go#46084
Change-Id: Ied0f768a74c448254adc3315348417825a7ec63e
GitHub-Last-Rev: befbd7af6b
GitHub-Pull-Request: golang/sys#110
Reviewed-on: https://go-review.googlesource.com/c/sys/+/327830
Reviewed-by: Tobias Klauser <tobias.klauser@gmail.com >
Reviewed-by: Ian Lance Taylor <iant@golang.org >
Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com >
TryBot-Result: Go Bot <gobot@golang.org >
2021-09-30 14:19:18 +00:00
Paul E. Murphy
39ccf1dd6f
unix: skip TestIoctlGetRTCWkAlrm if unsupported
...
Some RTC devices do not support wakeup alarms and will return
EINVAL in such cases. The generic powerpc rtc driver is one such
case.
Fixes golang/go#48554
Change-Id: I46f6da7902586a7fcaa9a367801d9fead288e264
Reviewed-on: https://go-review.googlesource.com/c/sys/+/352090
Run-TryBot: Paul Murphy <murp@ibm.com >
TryBot-Result: Go Bot <gobot@golang.org >
Trust: David Chase <drchase@google.com >
Reviewed-by: Tobias Klauser <tobias.klauser@gmail.com >
Reviewed-by: Ian Lance Taylor <iant@golang.org >
2021-09-27 09:40:55 +00:00
Jason A. Donenfeld
1cf2251ac2
unix: implement ppoll in terms of poll on Linux
...
Android's Bionic libc installs a seccomp filter that allows ppoll but
not poll. This has been fine for arm64, where we already implement poll
in terms of ppoll, but not the other architectures, such as amd64, which
runs on Chromebooks, and currently leads to crashes.
This commit implements poll in terms of ppoll on the remaining
architectures and makes this common code, so that everyone uses the more
modern syscall.
Change-Id: Ic01a32b5abe48ab53a2549f592a41561f1684c30
Reviewed-on: https://go-review.googlesource.com/c/sys/+/352310
Trust: Jason A. Donenfeld <Jason@zx2c4.com >
Trust: Brad Fitzpatrick <bradfitz@golang.org >
Run-TryBot: Jason A. Donenfeld <Jason@zx2c4.com >
TryBot-Result: Go Bot <gobot@golang.org >
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org >
2021-09-27 05:27:49 +00:00
Tobias Klauser
b8560ed6a9
unix/linux: update Dockerfile to Go 1.17.1
...
Change-Id: Iba0c7ce39221a0b9d7eaddd569bc6ea8ccceebd5
Reviewed-on: https://go-review.googlesource.com/c/sys/+/351429
Trust: Tobias Klauser <tobias.klauser@gmail.com >
Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com >
TryBot-Result: Go Bot <gobot@golang.org >
Reviewed-by: Ian Lance Taylor <iant@golang.org >
2021-09-23 06:10:19 +00:00
Tobias Klauser
437939a702
unix: use dup3 in Dup2 on all Linux platforms
...
The minimum required Linux kernel version for Go 1.18 will be changed to
2.6.32, see golang/go#45964 . The dup3 syscall was added in 2.6.27, so it
can be used instead of the dup2 syscall which is not implemented on
arm64 and riscv64 or blocked on android.
For golang/go#45964
Change-Id: I9c677db4bae3ce441b258c49580fb9a2cd600436
Reviewed-on: https://go-review.googlesource.com/c/sys/+/350552
Trust: Tobias Klauser <tobias.klauser@gmail.com >
Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com >
TryBot-Result: Go Bot <gobot@golang.org >
Reviewed-by: Matt Layher <mdlayher@gmail.com >
Reviewed-by: Ian Lance Taylor <iant@golang.org >
2021-09-21 06:55:28 +00:00
Tobias Klauser
d61c044b16
unix: implement Pipe using pipe2 syscall on all linux platforms
...
Most architectures currently already implement Pipe using the pipe2
syscall. Only 386, amd64, mips{,le}, ppc and sparc64 still use the pipe
syscall. However, some systems (e.g. Android seccomp policies) block
that syscall, see golang/go#40828 for an example.
The pipe2 syscall was added in Linux kernel version 2.6.27. The minimum
required Linux kernel version for Go 1.18 will be changed to 2.6.32
per golang/go#45964 so it is possible to unify the implementation of
Pipe using the pipe2 syscall.
Same as CL 350530 did for package syscall.
For golang/go#45964
Fixes golang/go#40828
Change-Id: I07d84d3ea06a54e37d9ff6b72702fe5d96efef7b
Reviewed-on: https://go-review.googlesource.com/c/sys/+/350549
Trust: Tobias Klauser <tobias.klauser@gmail.com >
Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com >
TryBot-Result: Go Bot <gobot@golang.org >
Reviewed-by: Matt Layher <mdlayher@gmail.com >
Reviewed-by: Ian Lance Taylor <iant@golang.org >
2021-09-17 16:11:53 +00:00
Tobias Klauser
ed5796bab1
unix: implement EpollCreate using EpollCreate1 on all linux platforms
...
Most newer architectures (e.g. arm64 or riscv64) don't provide the
epoll_create syscall. Some systems (e.g. Android) block it even if it
were available. In the kernel, the epoll_create syscall is implemented
[1] the same way EpollCreate is implemented in this package for
platforms without the epoll_create syscall. Thus, avoid the separate
wrapper and consistently implement EpollCreate using EpollCreate1.
[1] https://elixir.bootlin.com/linux/v5.15-rc1/source/fs/eventpoll.c#L2006
Change-Id: I8ac11d0de939dafa4b1d189d97d350b9c324c3ab
Reviewed-on: https://go-review.googlesource.com/c/sys/+/349809
Trust: Tobias Klauser <tobias.klauser@gmail.com >
Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com >
TryBot-Result: Go Bot <gobot@golang.org >
Reviewed-by: Matt Layher <mdlayher@gmail.com >
Reviewed-by: Ian Lance Taylor <iant@golang.org >
2021-09-15 08:33:10 +00:00
Nahum Shalman
751e447fb3
unix: add additional illumos STREAMS ioctls
...
This work is in support of WireGuard/wireguard-go#39
Change-Id: I04f3fdb40c1a6c8fe42cab5253c9edd4a5a1845d
Reviewed-on: https://go-review.googlesource.com/c/sys/+/348950
Reviewed-by: Tobias Klauser <tobias.klauser@gmail.com >
Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com >
TryBot-Result: Go Bot <gobot@golang.org >
Trust: Than McIntosh <thanm@google.com >
2021-09-10 15:07:52 +00:00
Lorenz Bauer
528a39cd75
unix: add PidfdOpen and PidfdGetfd
...
Add wrappers for the pidfd_open and pidfd_getfd sycalls, available since 5.3.
PIDFD_NONBLOCK is defined manually since mkerrors.sh doesn't handle including
linux/pidfd.h well.
See https://man7.org/linux/man-pages/man2/pidfd_open.2.html
Change-Id: I68dfb52f6a7a44b7f3324a8379860a1bb765e71b
Reviewed-on: https://go-review.googlesource.com/c/sys/+/347332
Reviewed-by: Tobias Klauser <tobias.klauser@gmail.com >
Reviewed-by: Ian Lance Taylor <iant@golang.org >
Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com >
TryBot-Result: Go Bot <gobot@golang.org >
2021-09-09 19:32:31 +00:00
jharshman
aa78b53d33
unix: define Time_t for FreeBSD
...
Fixes golang/go#48148
Change-Id: I8c0a62b204689fc6ac9e29b1ba0b084e3d807323
Reviewed-on: https://go-review.googlesource.com/c/sys/+/348012
Reviewed-by: Ian Lance Taylor <iant@golang.org >
Reviewed-by: Tobias Klauser <tobias.klauser@gmail.com >
2021-09-08 23:34:32 +00:00
Matt Layher
a851e7ddee
unix: change Landlock type aliases to new types
...
Type aliases were introduced in CL 348349 and I did not notice it during
the review process. The typical convention is to create new types instead.
Change-Id: I4789cfc836b8612abfd791451edfd619c93d23df
Reviewed-on: https://go-review.googlesource.com/c/sys/+/348450
Trust: Matt Layher <mdlayher@gmail.com >
Run-TryBot: Matt Layher <mdlayher@gmail.com >
Reviewed-by: Tobias Klauser <tobias.klauser@gmail.com >
TryBot-Result: Go Bot <gobot@golang.org >
2021-09-08 16:03:47 +00:00
Tobias Klauser
c212e73226
unix: add Landlock consts and types
...
Change-Id: I5b8eee0594072e58951dd8b655058b96caeba497
Reviewed-on: https://go-review.googlesource.com/c/sys/+/348349
Trust: Tobias Klauser <tobias.klauser@gmail.com >
Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com >
TryBot-Result: Go Bot <gobot@golang.org >
Reviewed-by: Matt Layher <mdlayher@gmail.com >
2021-09-08 14:30:11 +00:00
Tobias Klauser
6f6e22806c
unix: implement InotifyInit using InotifyInit1 on all linux platforms
...
Most newer architectures (e.g. arm64 or riscv64) don't provide the
inotify_init syscall and some systems (e.g. Android) block it even if it
were available. Internally, the inotify_init syscall is implemented
exactly like inotify_init1 [1], so there is no point in having a
separate wrapper on some platforms.
[1] https://elixir.bootlin.com/linux/v5.14.1/source/fs/notify/inotify/inotify_user.c#L704
Change-Id: Iae69de8e6cad1c6207fc0f521e275d94cdad3ca5
Reviewed-on: https://go-review.googlesource.com/c/sys/+/347869
Trust: Tobias Klauser <tobias.klauser@gmail.com >
Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com >
TryBot-Result: Go Bot <gobot@golang.org >
Reviewed-by: Ian Lance Taylor <iant@golang.org >
2021-09-06 17:05:28 +00:00
Tobias Klauser
97244b9997
unix: drop fallback to accept in Accept on Linux
...
Same as CL 346849 does for package syscall.
The minimum required Linux kernel version for Go 1.18 will be changed to
2.6.32, see golang/go#45964 . The current minimum required version is
2.6.23 and accept4 was added in 2.6.28, so the fallback to accept in
Accept on Linux can be removed.
For golang/go#45964
Change-Id: Idf915d5a24cf570a2cfa0f0548c1841f3fc64d5a
Reviewed-on: https://go-review.googlesource.com/c/sys/+/347329
Trust: Tobias Klauser <tobias.klauser@gmail.com >
Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com >
TryBot-Result: Go Bot <gobot@golang.org >
Reviewed-by: Matt Layher <mdlayher@gmail.com >
2021-09-03 07:17:46 +00:00
Tobias Klauser
2934436797
unix: drop fallback to inotifyInit in InotifyInit on linux/amd64
...
The minimum required Linux kernel version for Go 1.18 will be changed to
2.6.32, see golang/go#45964 . The current minimum required version is
2.6.23 and the inotify_init1 syscall was added in 2.6.27, so the
fallback to inotifyInit and inotifyInit itself can be removed on
linux/amd64.
For golang/go#45964
Change-Id: I8dc83ef04d74cfc9ec80da503076b9acfa9c365a
Reviewed-on: https://go-review.googlesource.com/c/sys/+/347330
Trust: Tobias Klauser <tobias.klauser@gmail.com >
Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com >
TryBot-Result: Go Bot <gobot@golang.org >
Reviewed-by: Matt Layher <mdlayher@gmail.com >
2021-09-03 07:17:12 +00:00
Tobias Klauser
0a7ae4be8d
unix: drop fallback to pipe in Pipe on linux/arm
...
Same as CL 347349 does for package syscall.
The minimum required Linux kernel version for Go 1.18 will be changed to
2.6.32, see golang/go#45964 . The pipe2 syscall was added in 2.6.27, so
the fallback to use the pipe syscall in syscall.Pipe on linux/arm can
be removed.
For golang/go#45964
Change-Id: I8e222dc4b373b22f91bc1ddcc48f58a37dafcffa
Reviewed-on: https://go-review.googlesource.com/c/sys/+/347331
Trust: Tobias Klauser <tobias.klauser@gmail.com >
Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com >
TryBot-Result: Go Bot <gobot@golang.org >
Reviewed-by: Matt Layher <mdlayher@gmail.com >
2021-09-03 07:16:34 +00:00
Nahum Shalman
f475640dd0
unix: add more illumos Lifreq helpers
...
This work is in support of wireGuard/wireguard-go#39
Change-Id: Id205d28935b76b49ec6b29aba0a741659c5c01d7
Reviewed-on: https://go-review.googlesource.com/c/sys/+/345610
Run-TryBot: Ian Lance Taylor <iant@golang.org >
TryBot-Result: Go Bot <gobot@golang.org >
Reviewed-by: Tobias Klauser <tobias.klauser@gmail.com >
Trust: Cherry Mui <cherryyz@google.com >
2021-09-02 05:02:50 +00:00
Tobias Klauser
164ac21ac1
unix: drop fallback to utimes in UtimesNano on Linux
...
Same as CL 346790 does for package syscall.
The minimum required Linux kernel version for Go 1.18 will be changed to
2.6.32, see golang/go#45964 . The current minimum required version is
2.6.23 and utimensat was added in 2.6.22, so the fallback isn't even
necessary for the current minimum supported version. Remove the fallback
to utimes.
For golang/go#45964
Change-Id: Iaed782d182851c9ccff32f831e1704bae52662a6
Reviewed-on: https://go-review.googlesource.com/c/sys/+/346829
Trust: Tobias Klauser <tobias.klauser@gmail.com >
Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com >
TryBot-Result: Go Bot <gobot@golang.org >
Reviewed-by: Matt Layher <mdlayher@gmail.com >
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org >
2021-09-02 05:02:39 +00:00