Weilu Jia
f6f5f146cd
windows: add EnumProcessModules, EnumProcessModulesEx, GetModuleInformation, GetModuleFileNameEx and GetModuleBaseName
...
Add process module related syscalls
2021-09-19 00:06:57 -07: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
Tobias Klauser
f4d43177bf
unix/linux: update Dockerfile to Kernel 5.14
...
Change-Id: Ie6b9521c70c0e91a507a923811f44f797b64e064
Reviewed-on: https://go-review.googlesource.com/c/sys/+/346029
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-08-31 04:25:30 +00:00
zhangyunhao
63515b42dc
cpu: add support for detecting cmpxchg16b
...
Change-Id: I892de938e85205c0506aa82e31297b7a99e48e44
Reviewed-on: https://go-review.googlesource.com/c/sys/+/329450
Trust: Martin Möhrmann <martin@golang.org >
Trust: Tobias Klauser <tobias.klauser@gmail.com >
Run-TryBot: Martin Möhrmann <martin@golang.org >
TryBot-Result: Go Bot <gobot@golang.org >
Reviewed-by: Martin Möhrmann <martin@golang.org >
2021-08-23 07:06:55 +00:00
Matt Layher
41cdb8703e
unix: add Ifreq.Inet4Addr methods for manipulating IPv4 addresses
...
ioctls such as SIOCGIFADDR deal with AF_INET sockaddr addresses, but none of
the fields aside from the embedded IPv4 address are used. To keep the interface
more simple, we directly expose Inet4Addr get and set methods which enable use
of these ioctls with the Ifreq wrapper.
Change-Id: Ia8b6ab9730f852cb99f4152e334a59d395476d2f
Reviewed-on: https://go-review.googlesource.com/c/sys/+/343250
Trust: Matt Layher <mdlayher@gmail.com >
Run-TryBot: Matt Layher <mdlayher@gmail.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-08-20 12:10:16 +00:00
Tobias Klauser
f52c844e1c
unix: add RTF_GLOBAL on darwin
...
Fixes golang/go#45848
Change-Id: Iadd8499a66d5c5b7940df1477d88926f4b30cdb0
Reviewed-on: https://go-review.googlesource.com/c/sys/+/343509
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-08-19 13:52:13 +00:00
Mark Jeffery
bce67f0961
unix: add SetsockoptTCPRepairOpt on Linux
...
There is currently no function to allow for setting repair options for sockets in repair mode.
There are 4 options catered for in the linux implementation.
TCPOPT_WINDOW
TCPOPT_MAXSEG
TCPOPT_SACK_PERMITTED
TCPOPT_TIMESTAMP
Details of the patch to the kernel and the thinking behind it is here https://lwn.net/Articles/495304
Work done in this commit
Included the tcp options type and length for inclusion in the Docker build
Added TCPOPT to the regular expression in mkerrors.sh. There was only TCP_ previously
Add the new function to syscall_unix.go
I have tested locally and verified each option with ss -i
I am not sure whether to commit tests because I don't know if socket creation is possible on the test runs in the offical pipeline.
I did check for existing tests but didn't see any that created sockets, only one that validated a string option.
Fixes golang/go#46984
Change-Id: Iade0434c05cebf2fbdfb5f04b2a7b51c8b358423
Reviewed-on: https://go-review.googlesource.com/c/sys/+/332709
Reviewed-by: Ian Lance Taylor <iant@golang.org >
Reviewed-by: Tobias Klauser <tobias.klauser@gmail.com >
Run-TryBot: Ian Lance Taylor <iant@golang.org >
TryBot-Result: Go Bot <gobot@golang.org >
2021-08-19 07:21:35 +00:00
David Crawshaw
44f02d92fd
windows: add WTSGetActiveConsoleSessionId
...
https://docs.microsoft.com/en-us/windows/win32/api/winbase/nf-winbase-wtsgetactiveconsolesessionid
Change-Id: I3c180bbb3a768beac6633e78514fac4e3837b69d
Reviewed-on: https://go-review.googlesource.com/c/sys/+/331909
Reviewed-by: Jason A. Donenfeld <Jason@zx2c4.com >
Reviewed-by: Alex Brainman <alex.brainman@gmail.com >
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org >
Trust: Jason A. Donenfeld <Jason@zx2c4.com >
Trust: Brad Fitzpatrick <bradfitz@golang.org >
Trust: Dmitri Shuralyov <dmitshur@golang.org >
Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com >
TryBot-Result: Go Bot <gobot@golang.org >
2021-08-19 07:20:04 +00:00
Matt Layher
00dd8d7831
unix: gofmt with Go 1.17
...
Change-Id: I867e6e01c803fec1b5db464db0e88dfe5799cd43
Reviewed-on: https://go-review.googlesource.com/c/sys/+/343249
Trust: Matt Layher <mdlayher@gmail.com >
Run-TryBot: Matt Layher <mdlayher@gmail.com >
TryBot-Result: Go Bot <gobot@golang.org >
Reviewed-by: Tobias Klauser <tobias.klauser@gmail.com >
2021-08-18 15:36:20 +00:00
Matt Layher
bfb29a6856
unix: export Ifreq and add IoctlIfreq function
...
This CL expands upon CL 340369 by exporting the Ifreq type along with methods
for setting and getting data to/from the ifreq union in a type-safe way.
ifreqData remains unexported as we can keep adding helpers similar to the
IoctlGetEthtoolDrvinfo to expose those operations in a less error-prone way.
A test is also added to verify interface index data using IoctlIfreq against
the modern rtnetlink API used by the standard library.
Change-Id: Ic6980cbcd3792cc341cd614061cce32fa1f851e7
Reviewed-on: https://go-review.googlesource.com/c/sys/+/340370
Trust: Matt Layher <mdlayher@gmail.com >
Run-TryBot: Matt Layher <mdlayher@gmail.com >
TryBot-Result: Go Bot <gobot@golang.org >
Reviewed-by: Ian Lance Taylor <iant@golang.org >
2021-08-17 19:03:40 +00:00
Tobias Klauser
7d9622a276
unix/linux: update Dockerfile to Go 1.17
...
Change-Id: Ic711a44c7ecf5d0ab5237a910c920f4b76873c57
Reviewed-on: https://go-review.googlesource.com/c/sys/+/342829
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-08-17 14:26:37 +00:00
Nahum Shalman
fefb4affbe
unix: expose solaris types needed for Event Ports
...
This work is in support of a cleanup of fsnotify/fsnotify#263
Change-Id: I2bc50036087a038c2aa8b6178687d1a870b9d1fd
Reviewed-on: https://go-review.googlesource.com/c/sys/+/324629
Reviewed-by: Ian Lance Taylor <iant@golang.org >
Reviewed-by: Tobias Klauser <tobias.klauser@gmail.com >
Run-TryBot: Ian Lance Taylor <iant@golang.org >
TryBot-Result: Go Bot <gobot@golang.org >
2021-08-17 13:44:02 +00:00
Nahum Shalman
13f9c583af
unix: create wrappers for solaris/illumos Event Ports
...
This work is in support of a cleanup of fsnotify/fsnotify#263
Change-Id: Ibd7500d20322765bfd50aa18333eb43ee7b659d7
Reviewed-on: https://go-review.googlesource.com/c/sys/+/324630
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-08-17 13:33:20 +00:00
Matt Layher
1e6c022a89
unix/linux: use HTTPS to git clone glibc in Dockerfile
...
This resolves a TODO to replace the insecure git protocol clone. There are no
changes to the generated code.
Change-Id: I66c83bcec572bf35a1206f8c82606cc122abb703
Reviewed-on: https://go-review.googlesource.com/c/sys/+/342553
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-08-16 18:31:51 +00:00
Tobias Klauser
fcbd12d029
unix/linux: update Dockerfile to glibc 2.34
...
No changes in generated files.
Change-Id: I83ffd002e070e350c2ec4026c9044a66a847e474
Reviewed-on: https://go-review.googlesource.com/c/sys/+/342569
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-08-16 17:40:21 +00:00
Mark Jeffery
15123e1e1f
unix: add Send on Linux
...
Added Send function which in turn calls existing Sendto.
Fixes golang/go#47288
Change-Id: I5c928a19cc4f10961a9e6d2802e197cc3b799438
Reviewed-on: https://go-review.googlesource.com/c/sys/+/336569
Reviewed-by: Tobias Klauser <tobias.klauser@gmail.com >
Reviewed-by: Ian Lance Taylor <iant@golang.org >
Reviewed-by: Matt Layher <mdlayher@gmail.com >
Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com >
TryBot-Result: Go Bot <gobot@golang.org >
Trust: Matt Layher <mdlayher@gmail.com >
2021-08-16 07:42:44 +00:00
Tobias Klauser
b9628f2c71
unix: add missing RLIMIT_* consts on openbsd/{386,arm}
...
Change-Id: I7e978beec3d63d407ffb97fb526ad0bc4ae4a03b
Reviewed-on: https://go-review.googlesource.com/c/sys/+/341069
Trust: Tobias Klauser <tobias.klauser@gmail.com >
Reviewed-by: Matt Layher <mdlayher@gmail.com >
Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com >
TryBot-Result: Go Bot <gobot@golang.org >
2021-08-16 07:39:13 +00:00
Tobias Klauser
649d0fc2fc
unix/linux: update Dockerfile to Go 1.17rc2
...
Change-Id: Idc623480fd6a4a2c733fa2eec05091112421af2b
Reviewed-on: https://go-review.googlesource.com/c/sys/+/334530
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-08-16 07:10:09 +00:00
Tobias Klauser
27a6752fd0
unix/linux: update Dockerfile to Kernel 5.13
...
Fixes golang/go#47057
Change-Id: I47bc7491ed46afd76d4955c2843f2bb1295c672b
Reviewed-on: https://go-review.googlesource.com/c/sys/+/332969
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-08-16 07:10:01 +00:00
Tobias Klauser
b1c119fd70
unix: move ICMP{,V6}_FILTER* const definitions
...
The C headers defining these constants pull in <netinet/in.h> which
leads to definition conflicts between kernel and glibc headers when
running mkerrors.sh for Linux kernel 5.13. Avoid these by moving this
const definitions to linux/types.go.
For golang/go#47057
Change-Id: I09a2391dfe4c6bb38b7069e952748070c10824e6
Reviewed-on: https://go-review.googlesource.com/c/sys/+/332929
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-08-16 07:09:50 +00:00
Kir Kolyshkin
30e4713e60
unix: make Prlimit public
...
glibc has a wrapper for it, so why shouldn't we?
Change-Id: I5c6e24c8e567e0198ea679f0be33e2eff056d5ed
Reviewed-on: https://go-review.googlesource.com/c/sys/+/332029
Reviewed-by: Tobias Klauser <tobias.klauser@gmail.com >
Reviewed-by: Ian Lance Taylor <iant@golang.org >
Trust: Michael Knyszek <mknyszek@google.com >
2021-08-16 03:25:35 +00:00
Matt Layher
d867a43fc9
unix: remove runtime.KeepAlive calls for Linux ioctl wrappers
...
As of CL 340915 these should no longer be necessary.
Change-Id: I644595aa0594d3bdc9b8f2c349990e0311060fd6
Reviewed-on: https://go-review.googlesource.com/c/sys/+/340951
Trust: Matt Layher <mdlayher@gmail.com >
Run-TryBot: Matt Layher <mdlayher@gmail.com >
TryBot-Result: Go Bot <gobot@golang.org >
Reviewed-by: Matthew Dempsky <mdempsky@google.com >
2021-08-09 22:24:54 +00:00
Matt Layher
b4502255bf
unix: generate ioctlPtr on Linux with unsafe.Pointer arg
...
The existing ioctl stubs for all UNIX-like platforms take a value of type
uintptr for the arg parameter. However, arguments which are cast from
unsafe.Pointer to uintptr technically violate the rules for package unsafe.
unsafe only allows a conversion from unsafe.Pointer to uintptr directly
within a call to Syscall.
ioctl is used on all UNIX-like operating systems and each one will have
to be updated accordingly where pointer arguments are passed to system
calls. To remedy this on Linux, we generate a new function called
ioctlPtr which takes a value of type unsafe.Pointer for arg. More
operating systems can be updated in future CLs by folks who have access
to those systems and can run the appropriate code generator.
Updates golang/go#44834
Change-Id: Ia9424be424b3dba91bb44d3a7a12bfb2179f0d86
Reviewed-on: https://go-review.googlesource.com/c/sys/+/340915
Trust: Matt Layher <mdlayher@gmail.com >
Trust: Bryan C. Mills <bcmills@google.com >
Run-TryBot: Matt Layher <mdlayher@gmail.com >
TryBot-Result: Go Bot <gobot@golang.org >
Reviewed-by: Ian Lance Taylor <iant@golang.org >
Reviewed-by: Matthew Dempsky <mdempsky@google.com >
2021-08-09 22:13:28 +00:00
Matt Layher
894668206c
unix: run Linux code generator to tidy ifreq code
...
I moved the ifreq type declaration and forgot to re-run the generator before
submitting CL 340369.
Change-Id: I0486001b005a4adbc729a6bd18a4d436074f5a2d
Reviewed-on: https://go-review.googlesource.com/c/sys/+/340917
Trust: Matt Layher <mdlayher@gmail.com >
Run-TryBot: Matt Layher <mdlayher@gmail.com >
TryBot-Result: Go Bot <gobot@golang.org >
Reviewed-by: Matthew Dempsky <mdempsky@google.com >
2021-08-09 20:39:39 +00:00
Matt Layher
e5e7981a10
unix: add ifreq and ifreqData helpers for Linux
...
ifreq is difficult to use in Go due to the union field in particular. This
situation is made worse due to the need to comply with Go's unsafe.Pointer
rules. This CL generates the raw ifreq type and also adds an ifreqData type
of the same size which is specialized for use with unsafe.Pointer.
We also replace the existing ifreqEthtool (which was not padded to the correct
size) with the new APIs and add a test to verify that IoctlGetEthtoolDrvinfo
functions properly by checking the name of the driver for each network interface.
Future uses of ifreq in package unix can expand upon this type with additional
getter and setter methods to deal with the unsafe casts to and from the union
byte array. We may also consider exporting ifreq and ifreqData if necessary.
Change-Id: Ibf73a10e774b4336815c674bb867bbb7ec1b9c71
Reviewed-on: https://go-review.googlesource.com/c/sys/+/340369
Run-TryBot: Matt Layher <mdlayher@gmail.com >
Trust: Matt Layher <mdlayher@gmail.com >
Reviewed-by: Ian Lance Taylor <iant@golang.org >
TryBot-Result: Go Bot <gobot@golang.org >
2021-08-06 18:45:41 +00:00
Jason A. Donenfeld
0f9fa26af8
windows: fix constant value of WTD_STATEACTION_VERIFY
...
A 0x01 was mistakenly changed to 0x10. This commit rectifies the issue,
while also adding a test to ensure this functionality is behaving as
expected.
Fixes golang/go#46906
Change-Id: I833fe03e69a71283b4f7abb6cf640574d03f5d24
Reviewed-on: https://go-review.googlesource.com/c/sys/+/331010
Trust: Jason A. Donenfeld <Jason@zx2c4.com >
Run-TryBot: Jason A. Donenfeld <Jason@zx2c4.com >
TryBot-Result: Go Bot <gobot@golang.org >
Reviewed-by: Ian Lance Taylor <iant@golang.org >
2021-06-30 00:52:30 +00:00
Tobias Klauser
7dc0b73dc9
unix: add SO_ORIGINAL_DST on linux
...
Change-Id: I243a05696e061f0f0e558518c8af596364aa3668
Reviewed-on: https://go-review.googlesource.com/c/sys/+/331609
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-06-29 17:03:31 +00:00
Ed Schouten
59db8d763f
unix: add bindings for kinfo_proc on Darwin
...
On Linux, we can extract a list of all the processes on the system by
calling readdir() against /proc. On BSD-like systems, this information
needs to be extracted from sysctl in the form of kinfo_proc structures.
This change adds bindings for this structure and adds a method for
reading an array of these structures from sysctl.
Change-Id: Iaaed27cdbbf13d7c2cc6a6787667ac04d65bf41c
GitHub-Last-Rev: 34926f8474
GitHub-Pull-Request: golang/sys#111
Reviewed-on: https://go-review.googlesource.com/c/sys/+/328169
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-06-16 09:43:52 +00:00
Ed Schouten
e2b7044e8c
unix: add SEEK_* constants on Darwin, FreeBSD, Linux
...
The Go "os" package already provides bindings for SEEK_CUR, SEEK_SET and
SEEK_END. Most operating systems also support SEEK_HOLE and SEEK_DATA,
which you can use to skip sparse regions in a file. Let's add bindings,
so we can also do this from within Go.
Change-Id: If9243b05a8f563b4bce2452aa4bff145d9442cc2
GitHub-Last-Rev: ac8aed2d4a
GitHub-Pull-Request: golang/sys#112
Reviewed-on: https://go-review.googlesource.com/c/sys/+/328170
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-06-16 04:58:30 +00:00
Tobias Klauser
665e8c7367
unix/linux: update Dockerfile to Go 1.17beta1
...
Running `GOOS=linux GOARCH=amd64 ./mkall.sh` produces no changes, as
expected.
Change-Id: I09ec5243376fe76792d2b5e4984d8e2409dc7ce3
Reviewed-on: https://go-review.googlesource.com/c/sys/+/327729
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-06-15 03:50:16 +00:00
Tobias Klauser
a4fc739902
unix: add AT_EACCESS and AT_REMOVEDIR on netbsd
...
Change-Id: I1ef10228c858df6c3efe6c7543ce27f1c7984f8e
Reviewed-on: https://go-review.googlesource.com/c/sys/+/326429
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-06-11 08:36:46 +00:00
Tobias Klauser
1a9c977f74
unix: add AT_EACCESS on freebsd
...
Change-Id: Ic6ac2335d5f831682ea61fc3b1276abd0a72a6af
Reviewed-on: https://go-review.googlesource.com/c/sys/+/326431
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-06-11 08:36:32 +00:00
Tobias Klauser
9f1793e2e2
unix: add AT_REMOVEDIR, AT_EACCESS and AT_SYMLINK_FOLLOW on dragonfly
...
Change-Id: I2a3f4fb12ed3af1789af6115aecae62e61792549
Reviewed-on: https://go-review.googlesource.com/c/sys/+/326430
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-06-11 08:36:19 +00:00
Tobias Klauser
aa57babbf1
unix: add AT_REMOVEDIR and AT_EACCESS on openbsd
...
Fixes golang/go#46342
Change-Id: Ia7d516b9024fed276e51f9b6f0d27025b89f59db
Reviewed-on: https://go-review.googlesource.com/c/sys/+/325431
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-06-08 05:33:32 +00:00
Tom Thorogood
9665404d36
unix: support Linux NFC Subsystem
...
This adds the constants and types needed for the Linux NFC Subsystem.
It also adds support for sockaddr_nfc and sockaddr_nfc_llcp to Connect.
The Linux NFC Subsystem is documented in:
https://www.kernel.org/doc/html/latest/networking/nfc.html .
Change-Id: Ic6a79afdba85e9b154ec46f191f27714b4b38a57
Reviewed-on: https://go-review.googlesource.com/c/sys/+/323551
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-06-03 12:58:02 +00:00
Tom Thorogood
ebe580a85c
unix: fix minor typos in README.md
...
Change-Id: Ibf1ce4330e196578c933784b51fff7f6670e2fa5
Reviewed-on: https://go-review.googlesource.com/c/sys/+/324449
Reviewed-by: Ian Lance Taylor <iant@golang.org >
Reviewed-by: Tobias Klauser <tobias.klauser@gmail.com >
2021-06-03 08:11:09 +00:00
Jason A. Donenfeld
7ecdf8ef09
windows: change CreateProcessAsUser from kernel32 to advapi32
...
While kernel32.dll works as a target, the documentation says advapi32,
so go with that to be safe:
https://docs.microsoft.com/en-us/windows/win32/api/processthreadsapi/nf-processthreadsapi-createprocessasuserw
Change-Id: I8e4a3693dad3759c3a094fa2476b89fb3d38b6bd
Reviewed-on: https://go-review.googlesource.com/c/sys/+/323789
Trust: Jason A. Donenfeld <Jason@zx2c4.com >
Trust: Alex Brainman <alex.brainman@gmail.com >
Run-TryBot: Jason A. Donenfeld <Jason@zx2c4.com >
TryBot-Result: Go Bot <gobot@golang.org >
Reviewed-by: Alex Brainman <alex.brainman@gmail.com >
2021-06-01 08:02:50 +00:00
lhl2617
47163c9f4e
unix: add missing const (MTDFILEMODE) from <mtd/mtd-user.h>
...
CL 318211 added constants from <mtd/mtd-user.h>. The regex was
too strict and as a result MTDFILEMODE was not included.
This CL relaxes the regex so that MTDFILEMODE is included.
Fixes golang/go#46448
Change-Id: I2667d1690782cf8ce98b26cb6305e7386cbd0d46
Reviewed-on: https://go-review.googlesource.com/c/sys/+/323391
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-05-31 22:56:29 +00:00