Florian Lehner
b5c7a0975d
unix: update BPF constants with Linux kernel 6.2
...
Change-Id: Iaa92ec9e8ff6e337457ea4f57b4c046221128d43
Reviewed-on: https://go-review.googlesource.com/c/sys/+/496675
Run-TryBot: Ian Lance Taylor <iant@google.com >
Run-TryBot: Ian Lance Taylor <iant@golang.org >
Reviewed-by: Tobias Klauser <tobias.klauser@gmail.com >
Reviewed-by: Ian Lance Taylor <iant@google.com >
Reviewed-by: Matthew Dempsky <mdempsky@google.com >
TryBot-Result: Gopher Robot <gobot@golang.org >
Auto-Submit: Ian Lance Taylor <iant@google.com >
2023-05-23 19:43:07 +00:00
Francis Laniel
c7a1bf9a0b
unix: define PerfBitWriteBackward
...
Change-Id: I0b95006039b4efcd0094ba96281100abeafc993e
GitHub-Last-Rev: 43383aac90
GitHub-Pull-Request: golang/sys#149
Reviewed-on: https://go-review.googlesource.com/c/sys/+/473135
Reviewed-by: Ian Lance Taylor <iant@google.com >
TryBot-Result: Gopher Robot <gobot@golang.org >
Reviewed-by: Tobias Klauser <tobias.klauser@gmail.com >
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com >
Auto-Submit: Ian Lance Taylor <iant@google.com >
Run-TryBot: Ian Lance Taylor <iant@google.com >
2023-03-04 03:20:52 +00:00
Will Hawkins
6f250766ac
unix: define extended TCPInfo on Linux
...
On Linux platforms, the kernel can fill out an extended version of
the tcp_info struct. Allow users of the sys package to have access to
that information.
Change-Id: Ib42ad572dd56c774c6d9e8b17fe3bdd8126147bb
Reviewed-on: https://go-review.googlesource.com/c/sys/+/471275
Run-TryBot: Matt Layher <mdlayher@gmail.com >
Reviewed-by: Tobias Klauser <tobias.klauser@gmail.com >
Reviewed-by: Matt Layher <mdlayher@gmail.com >
TryBot-Result: Gopher Robot <gobot@golang.org >
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 >
2023-02-28 17:07:46 +00:00
Tobias Klauser
972870e3e1
unix/linux: update to Linux kernel 6.2, glibc 2.37 and Go 1.20.1
...
Also remove some manually defined AT_* contstants which are now defined
in the libc headers.
Change-Id: I342976a22948e9b05e38dc7503d9dd356cee6c7b
Reviewed-on: https://go-review.googlesource.com/c/sys/+/470176
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 >
Reviewed-by: Than McIntosh <thanm@google.com >
2023-02-23 15:22:10 +00:00
Jordan Whited
71a906ea0c
unix/linux: add TUN flags and virtio_net_hdr constants
...
Change-Id: I10c86c100f4db77740eff6f07d91d6489b21b6f8
GitHub-Last-Rev: 3e8d7343cd
GitHub-Pull-Request: golang/sys#148
Reviewed-on: https://go-review.googlesource.com/c/sys/+/468656
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org >
Run-TryBot: Ian Lance Taylor <iant@google.com >
Reviewed-by: Bryan Mills <bcmills@google.com >
Reviewed-by: Ian Lance Taylor <iant@google.com >
Auto-Submit: Ian Lance Taylor <iant@google.com >
Reviewed-by: Tobias Klauser <tobias.klauser@gmail.com >
TryBot-Result: Gopher Robot <gobot@golang.org >
2023-02-22 15:47:51 +00:00
James Clark
6938dae65e
unix: add missing constants used with struct Timex on Linux
...
This provides definitions for Linux of two groups of constants,
which are used with struct Timex (used with the adjtimex and
clock_adjtime system calls): the ADJ_* constants are used
for the modes field; the STA_* constants are used for the status
field. The constants are documented in the adjtimex(2) man page.
Fixes golang/go#58012
Change-Id: I054f0c40f9cfd9360a0bb10716a08e19584c0fff
Reviewed-on: https://go-review.googlesource.com/c/sys/+/464241
Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com >
Reviewed-by: Tobias Klauser <tobias.klauser@gmail.com >
Reviewed-by: Michael Knyszek <mknyszek@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 >
Auto-Submit: Tobias Klauser <tobias.klauser@gmail.com >
2023-02-02 22:29:28 +00:00
chenguoqi
7a75290698
unix/linux: update to glibc 2.36
...
Support for LoongArch has been merged upstream. This allows to
drop the loong64 specific glibc patches.
Because the header file sys/mount.h of glibc 2.36 includes fcntl.h
(commit 78a408ee7ba041fc8d5dbd5f67065b4a982c11e5), this will leads to
duplicate definition of structure stat on MIPS64. In order to solve
this error, use the custom type my_stat to generate the Go Stat_t.
Change-Id: I888280d777d1c7089548acf1b3821762011d79b0
Reviewed-on: https://go-review.googlesource.com/c/sys/+/453555
Reviewed-by: xiaodong liu <teaofmoli@gmail.com >
TryBot-Result: Gopher Robot <gobot@golang.org >
Reviewed-by: Ian Lance Taylor <iant@google.com >
Reviewed-by: Cherry Mui <cherryyz@google.com >
Run-TryBot: Ian Lance Taylor <iant@google.com >
Auto-Submit: Ian Lance Taylor <iant@google.com >
2023-01-31 14:54:23 +00:00
Tobias Klauser
6e4d1c53cf
unix/linux: update to Linux kernel 6.1 and Go 1.20-rc2
...
Change-Id: Iaff9781793b2896aba6d4788faf0d5dde18c1395
Reviewed-on: https://go-review.googlesource.com/c/sys/+/461297
Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com >
Reviewed-by: Ian Lance Taylor <iant@google.com >
Reviewed-by: Benny Siegert <bsiegert@gmail.com >
TryBot-Result: Gopher Robot <gobot@golang.org >
Auto-Submit: Tobias Klauser <tobias.klauser@gmail.com >
2023-01-16 08:36:32 +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
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
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
Florian Lehner
c0bba94af5
unix: add constants for netlink/audit
...
Change-Id: Idaa02498b43360fa647d52423bc2f4c0cd5a9523
Reviewed-on: https://go-review.googlesource.com/c/sys/+/416754
Reviewed-by: Ian Lance Taylor <iant@google.com >
Reviewed-by: Bryan Mills <bcmills@google.com >
Reviewed-by: Tobias Klauser <tobias.klauser@gmail.com >
2022-07-15 15:14:00 +00:00
Tobias Klauser
af78867b19
unix/linux: update to Linux kernel 5.19-rc2
...
Update to 5.19-rc2 instead of 5.18 for the following reasons:
- Support for LoongArch has been merged upstream. This allows to drop
the loong64 specific kernel patches.
- Fixes [1] an issue encountered with when generating the
SOCK_TXREHASH_DEFAULT constant from linux/socket.h on 5.18
- Contains a fix [2] to provide SYS_MEMFD_SECRET on linux/riscv64 as
well, The underlying syscall was already available in earlier kernel
versions. Also see golang/go#51547 .
[1] https://lore.kernel.org/r/20220531094345.13801-1-tklauser@distanz.ch
[2] https://lore.kernel.org/r/20220505081815.22808-1-tklauser@distanz.ch
Change-Id: I6c3ec30a067eae339c443ee55962d94c84feffd9
Reviewed-on: https://go-review.googlesource.com/c/sys/+/411375
Auto-Submit: Tobias Klauser <tobias.klauser@gmail.com >
Reviewed-by: Ian Lance Taylor <iant@google.com >
TryBot-Result: Gopher Robot <gobot@golang.org >
Auto-Submit: Ian Lance Taylor <iant@google.com >
Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com >
Run-TryBot: Ian Lance Taylor <iant@google.com >
Reviewed-by: Cherry Mui <cherryyz@google.com >
2022-06-15 21:21:18 +00:00
limeidan
88d2bb9c0c
unix: add generate component files support for linux/loong64
...
Updates golang/go#46229
Change-Id: If0ee99997360608d7ba218880a1ef180ca6db551
Reviewed-on: https://go-review.googlesource.com/c/sys/+/399336
Reviewed-by: Matt Layher <mdlayher@gmail.com >
Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com >
TryBot-Result: Gopher Robot <gobot@golang.org >
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 >
Reviewed-by: Than McIntosh <thanm@google.com >
2022-04-22 01:37:25 +00:00
Alexey Perevalov
889880a91f
unix: fsmount fspick fsopen linux syscall
...
Patches were submitted to Linux manpages:
https://lwn.net/Articles/802096/ , but not yet applied.
Generated on linux kernel v5.16.
Fsconfig couldn't implemented by generator, it requires
special cases handling.
Change-Id: I7f9560f4bc5b4bbe1e00c63ce1bc25c781aa1293
Reviewed-on: https://go-review.googlesource.com/c/sys/+/398434
Run-TryBot: Ian Lance Taylor <iant@golang.org >
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: Tobias Klauser <tobias.klauser@gmail.com >
Auto-Submit: Tobias Klauser <tobias.klauser@gmail.com >
Reviewed-by: Benny Siegert <bsiegert@gmail.com >
2022-04-12 07:17:39 +00:00
Florian Lehner
a24fb2fb8a
unix: add constants for netlink/routing rules
...
Change-Id: Ic68b65e71125b755418f9d8d01a9500aa1e9ffc1
Reviewed-on: https://go-review.googlesource.com/c/sys/+/399194
Reviewed-by: Matt Layher <mdlayher@gmail.com >
Trust: Matt Layher <mdlayher@gmail.com >
Run-TryBot: Matt Layher <mdlayher@gmail.com >
Auto-Submit: Matt Layher <mdlayher@gmail.com >
TryBot-Result: Gopher Robot <gobot@golang.org >
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org >
2022-04-08 20:14:24 +00:00
Alexey Perevalov
289d7a0edf
unix: add MoveMount syscall on linux
...
This syscall is not yet described in linux man pages
(https://github.com/mkerrisk/man-pages.git ),
but it was submitted to lkml https://lwn.net/Articles/802095/
This syscall appeared in linux v5.2.
Change-Id: I0708bfceda8d7a7608d0d0e75e36c3d81302dedb
Reviewed-on: https://go-review.googlesource.com/c/sys/+/397095
Reviewed-by: Ian Lance Taylor <iant@golang.org >
Run-TryBot: Ian Lance Taylor <iant@golang.org >
TryBot-Result: Gopher Robot <gobot@golang.org >
Auto-Submit: Ian Lance Taylor <iant@golang.org >
Reviewed-by: Tobias Klauser <tobias.klauser@gmail.com >
2022-04-06 15:52:45 +00:00
Alexey Perevalov
483a9cbc67
unix: add OpenTree on linux
...
This syscall is not yet described in linux man pages
(https://github.com/mkerrisk/man-pages.git )
but it was attempts to do it (https://lwn.net/Articles/829496/ )
This syscall appeared in linux kernel v5.2
Change-Id: If44aa74c4ddd200831011c6c4bf4bd4fee440785
Reviewed-on: https://go-review.googlesource.com/c/sys/+/397094
Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com >
TryBot-Result: Gopher Robot <gobot@golang.org >
Reviewed-by: Tobias Klauser <tobias.klauser@gmail.com >
Reviewed-by: Ian Lance Taylor <iant@golang.org >
2022-04-03 02:05:50 +00:00
Matt Layher
a9b59b0215
unix: add PidfdSendSignal on Linux
...
This completes the pidfd_* family of syscalls and adds a test to verify that a
child process can be terminated using the new PidfdSendSignal function.
Change-Id: I71f6a1e26518f513731e20afef02030462e9a2c0
Reviewed-on: https://go-review.googlesource.com/c/sys/+/393794
Trust: Matt Layher <mdlayher@gmail.com >
Run-TryBot: Matt Layher <mdlayher@gmail.com >
TryBot-Result: Gopher Robot <gobot@golang.org >
Reviewed-by: Ian Lance Taylor <iant@golang.org >
2022-03-19 13:42:39 +00:00
Matt Layher
22a9840ba4
unix: add nl80211 generic netlink constants for Linux
...
Change-Id: Ic39f350bd0b4e3942ba576ee12b44b182178527c
Reviewed-on: https://go-review.googlesource.com/c/sys/+/388935
Trust: Matt Layher <mdlayher@gmail.com >
Run-TryBot: Matt Layher <mdlayher@gmail.com >
TryBot-Result: Gopher Robot <gobot@golang.org >
Reviewed-by: Tobias Klauser <tobias.klauser@gmail.com >
2022-03-07 20:37:07 +00:00
Dmytro Shynkevych
4e6760a101
unix: add SPEED_UNKNOWN
...
The rest of the SPEED_* constants are redundant: SPEED_x is defined to simply x for x in 10, 100, ...
Change-Id: I8b29a90ea1b914a65fa165a6801fcf77c667ebb0
GitHub-Last-Rev: 1428dcc517
GitHub-Pull-Request: golang/sys#119
Reviewed-on: https://go-review.googlesource.com/c/sys/+/388214
Trust: Brad Fitzpatrick <bradfitz@golang.org >
Reviewed-by: Matt Layher <mdlayher@gmail.com >
Trust: Matt Layher <mdlayher@gmail.com >
Run-TryBot: Matt Layher <mdlayher@gmail.com >
TryBot-Result: Gopher Robot <gobot@golang.org >
2022-02-27 23:45:10 +00:00
Matt Layher
dbe011f71a
unix: add Linux Kernel Connection Multiplexor types and constants
...
For details on KCM, see:
https://www.kernel.org/doc/Documentation/networking/kcm.txt .
Change-Id: I14ebf0aaad17f5a9078f027bd50e050c69b08981
Reviewed-on: https://go-review.googlesource.com/c/sys/+/348449
Trust: Matt Layher <mdlayher@gmail.com >
Run-TryBot: Matt Layher <mdlayher@gmail.com >
TryBot-Result: Gopher Robot <gobot@golang.org >
Reviewed-by: Ian Lance Taylor <iant@golang.org >
2022-02-24 00:32:55 +00:00
Oscar Söderlund
96fed51e14
unix: add can netlink types and constants
...
Change-Id: Ie234f26c38a9ced6407f2970fa97b49d18119f06
Reviewed-on: https://go-review.googlesource.com/c/sys/+/387474
Reviewed-by: Matt Layher <mdlayher@gmail.com >
Trust: Matt Layher <mdlayher@gmail.com >
Run-TryBot: Matt Layher <mdlayher@gmail.com >
TryBot-Result: Gopher Robot <gobot@golang.org >
Trust: Johan Brandhorst-Satzkorn <johan.brandhorst@gmail.com >
2022-02-23 15:53:57 +00:00
Matt Layher
3681064d51
unix: implement getitimer(2) and setitimer(2) on Linux
...
Wrap the low-level system calls with a more idiomatic Go API and a set of
constants to indicate which timer should be queried or modified.
man 2 getitimer indicates that these system calls are obsolete as of
POSIX.1-2008, but the code I am working on has not been ported to the modern
timer_gettime(2) and timer_settime(2) APIs as of yet.
Change-Id: I91482e141047846cadf47aa2417b8770955986bf
Reviewed-on: https://go-review.googlesource.com/c/sys/+/384054
Run-TryBot: Matt Layher <mdlayher@gmail.com >
TryBot-Result: Gopher Robot <gobot@golang.org >
Reviewed-by: Dominik Honnef <dominik@honnef.co >
Reviewed-by: Ian Lance Taylor <iant@golang.org >
Trust: Matt Layher <mdlayher@gmail.com >
2022-02-09 21:45:40 +00:00
Tobias Klauser
a018aaa089
unix/linux: update to Linux Kernel 5.16
...
Change-Id: I83f84e8aa6f75fc2a6fd1744546e8dc3d5bc3a55
Reviewed-on: https://go-review.googlesource.com/c/sys/+/377134
Trust: Tobias Klauser <tobias.klauser@gmail.com >
Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com >
TryBot-Result: Gopher Robot <gobot@golang.org >
Reviewed-by: Matt Layher <mdlayher@gmail.com >
2022-01-10 18:14:12 +00:00
Matt Layher
4abf325e02
unix: add netlink attribute type and policy type constants
...
Change-Id: I343785b938461c94c32d52fb632514293564311a
Reviewed-on: https://go-review.googlesource.com/c/sys/+/372295
Trust: Matt Layher <mdlayher@gmail.com >
Run-TryBot: Matt Layher <mdlayher@gmail.com >
Reviewed-by: Ian Lance Taylor <iant@golang.org >
Reviewed-by: Tobias Klauser <tobias.klauser@gmail.com >
2021-12-15 21:12:19 +00:00
Matt Layher
4825e8c387
unix: add WireGuard generic netlink interface constants on Linux
...
Change-Id: I619c49f745da8cfd17bc2aae28d97aff73daf4d5
Reviewed-on: https://go-review.googlesource.com/c/sys/+/371674
Trust: Matt Layher <mdlayher@gmail.com >
Run-TryBot: Matt Layher <mdlayher@gmail.com >
TryBot-Result: Gopher Robot <gobot@golang.org >
Reviewed-by: Ian Lance Taylor <iant@golang.org >
2021-12-14 23:44:02 +00:00
Matt Layher
024a26f5d6
unix: regenerate generic netlink controller constants
...
This adds support for generic netlink policy commands, and also regenerates the
constants using a shell one-liner for reproducibility in the future.
Change-Id: I868965c2a5abe2ff384e81223e03373465462f52
Reviewed-on: https://go-review.googlesource.com/c/sys/+/371654
Trust: Matt Layher <mdlayher@gmail.com >
Run-TryBot: Matt Layher <mdlayher@gmail.com >
TryBot-Result: Gopher Robot <gobot@golang.org >
Reviewed-by: Tobias Klauser <tobias.klauser@gmail.com >
2021-12-14 15:06:14 +00:00
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
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
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
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
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
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
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
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
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
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
lhl2617
0cec03c779
unix: add consts and structs for <mtd/mtd-user.h>
...
It would be convenient to have MTD user space consts and structs
in the package.
Checked that the regexes in unix/mkerrors.sh are not too general,
and that all the defined constants in <mtd/mtd-user.h> are included
in the generated code.
Checked that all structs and enums added in unix/linux/types.go
are complete.
Fixes golang/go#46063
Change-Id: I190ac290f3f32a4f817cc7506df0dddb24d881b8
Reviewed-on: https://go-review.googlesource.com/c/sys/+/318211
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-05-21 20:33:32 +00:00
Tobias Klauser
413ae7eecf
unix/linux: update Dockerfile to Kernel 5.12, Go 1.16.3
...
Change-Id: I4e98e902508ad8bf0dede6c571bffed92611e02e
Reviewed-on: https://go-review.googlesource.com/c/sys/+/313391
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-04-26 23:06:21 +00:00
Ben Hutchings
33663a62ff
unix/linux: add ppc system call definitions, for use with gccgo
...
Add system call definitions for 32-bit PowerPC (ppc). These are
expected to be used with gccgo, as gc does not have a suitable code
generator.
These definitions are largely copied from ppc64x, with some 32-bit
specific wrappers copied from arm.
The glibc definitions of epoll_event and sockaddr_un structures need
to be overridden on ppc, similarly to some other architectures.
For golang/go#18031
Fixes golang/go#37443
Change-Id: I061ac2b8fa452dd37c2239a0b09dff2f3e9d50da
GitHub-Last-Rev: aada37a10b
GitHub-Pull-Request: golang/sys#106
Reviewed-on: https://go-review.googlesource.com/c/sys/+/312349
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-04-21 22:16:51 +00:00
Tobias Klauser
f1c623a9e7
unix: add EthtoolDrvinfo and IoctlGetEthtoolDrvinfo on linux
...
Add type EthtoolDrvinfo and the type-safe IoctlGetEthtoolDrvinfo ioctl
wrapper func to retrieve it.
Change-Id: Ia514df89175939d9b0c2c4ddace621882e86b21a
Reviewed-on: https://go-review.googlesource.com/c/sys/+/308989
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-04-12 22:04:55 +00:00
Matt Layher
bd2e13477e
unix: add NLMSGERR constants for netlink extended acknowledgement
...
Change-Id: I8d23fc227d1f61b823abcf610479005356c52088
Reviewed-on: https://go-review.googlesource.com/c/sys/+/286072
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-03-13 20:20:42 +00:00
Kir Kolyshkin
8e9fff1a3a
unix: add CloseRange
...
The close_range(2) syscall is available since Linux kernel v5.9,
with additional functionality of CLOSE_RANGE_CLOEXEC since v5.11.
No tests are required since this is a bare syscall.
Change-Id: I410470e3713e2005cc7acf24d1347938fe05ef63
Reviewed-on: https://go-review.googlesource.com/c/sys/+/301409
Run-TryBot: Ian Lance Taylor <iant@golang.org >
TryBot-Result: Go Bot <gobot@golang.org >
Reviewed-by: Ian Lance Taylor <iant@golang.org >
Trust: Emmanuel Odeke <emmanuel@orijtech.com >
2021-03-13 11:07:37 +00:00
Lluís Batlle i Rossell
8e9945a547
unix: fix and test the FIDEDUPERANGE Linux ioctl
...
The previous implementation didn't match the ioctl spec.
Fixes golang/go#43678
Change-Id: Ia1c292c2dbd4913fb1d7e8331d9f18e23169d64a
GitHub-Last-Rev: 5331c424ef
GitHub-Pull-Request: golang/sys#97
Reviewed-on: https://go-review.googlesource.com/c/sys/+/284352
Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com >
TryBot-Result: Go Bot <gobot@golang.org >
Reviewed-by: Tobias Klauser <tobias.klauser@gmail.com >
Trust: Tobias Klauser <tobias.klauser@gmail.com >
Trust: Ian Lance Taylor <iant@golang.org >
2021-02-25 08:00:10 +00:00
Tom Thorogood
b80eb88b80
unix: add HIDRAW ioctls
...
This change adds (most) of the ioctl API for the Linux HIDRAW interface.
Reading and writing non-numbered HID reports is done using the read and
write system calls respectively.
Some of the HIDIOC* request numbers are exported directly while others
are kept unexported. This is because some of the #defines require a len
attribute that doesn't have a specific well defined value.
Wrapper types are added for most of the request numbers as is standard.
No wrapper is added for HIDIOCGRDESCSIZE as it would just be
IoctlGetUint32.
The HIDIOC[GS]FEATURE, HIDIOC[GS]INPUT and HIDIOC[GS]OUTPUT request
numbers, which are required for numbered HID reports, are entirely
ommitted as the len attribute has to be a runtime variable. These could
be added later by doing something like
`HIDIOCGFEATURE(0) | (len << _IOC_SIZESHIFT)`,
with care taken that len doesn't overflow _IOC_XSIZEMASK.
Outdated documentation for the HIDRAW interface is available at:
https://www.kernel.org/doc/Documentation/hid/hidraw.txt .
Change-Id: I2ae5060f0f46150f6fb52959c2e55f50927c1f69
Reviewed-on: https://go-review.googlesource.com/c/sys/+/289169
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-02-23 08:53:22 +00:00
Matt Layher
eaf3bda374
unix: add ethtool constants for Linux
...
The ethtool generic netlink interface also uses these constants
in addition to the ones I previously added.
For more information about this interface, see:
https://www.kernel.org/doc/html/latest/networking/ethtool-netlink.html .
Change-Id: I8861e5faa23bfc0179725314fc5a528486e328b2
Reviewed-on: https://go-review.googlesource.com/c/sys/+/283413
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-01-13 00:00:19 +00:00
Matt Layher
789bb1bd40
unix: add ethtool generic netlink constants for Linux
...
For more information about this interface, see:
https://www.kernel.org/doc/html/latest/networking/ethtool-netlink.html .
Change-Id: I4fe37e7dce3c52d72286bee047de2b49fe559b13
Reviewed-on: https://go-review.googlesource.com/c/sys/+/282812
Run-TryBot: Matt Layher <mdlayher@gmail.com >
TryBot-Result: Go Bot <gobot@golang.org >
Reviewed-by: Tobias Klauser <tobias.klauser@gmail.com >
Trust: Tobias Klauser <tobias.klauser@gmail.com >
Trust: Matt Layher <mdlayher@gmail.com >
2021-01-10 05:19:26 +00:00
Tobias Klauser
f9fddec55a
unix/linux: update Dockerfile to kernel 5.10 and Go 1.15.6
...
Also include some newly added consts.
Change-Id: Iaf9fad92a4cbbf9f1e97ed544116bd93525dddde
Reviewed-on: https://go-review.googlesource.com/c/sys/+/277254
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 >
2020-12-14 21:06:02 +00:00