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
Matt Layher
a01c418693
unix: add Linux MPLS tunnel constants for use with rtnetlink APIs
...
Change-Id: Ic990c616c416e7bfe98e68eb74bab2810a1126ef
Reviewed-on: https://go-review.googlesource.com/c/sys/+/271137
Trust: Matt Layher <mdlayher@gmail.com >
Run-TryBot: Matt Layher <mdlayher@gmail.com >
Reviewed-by: Tobias Klauser <tobias.klauser@gmail.com >
2020-11-18 18:29:58 +00:00
Matt Layher
ade898ef86
unix: add Linux lwtunnel constants for use with rtnetlink APIs
...
Change-Id: Ibe39b315321c18916870dcfc97b083a18b91be2b
Reviewed-on: https://go-review.googlesource.com/c/sys/+/271077
Run-TryBot: Matt Layher <mdlayher@gmail.com >
TryBot-Result: Go Bot <gobot@golang.org >
Trust: Matt Layher <mdlayher@gmail.com >
Reviewed-by: Tobias Klauser <tobias.klauser@gmail.com >
2020-11-18 18:01:33 +00:00
Lehner Florian
da207088b7
unix: update IFLA consts on linux
...
Update the IFLA_* consts from /usr/include/linux/if_link.h
Change-Id: I8a751f9237c78737691fb425dcbc4be6e52364d9
Reviewed-on: https://go-review.googlesource.com/c/sys/+/266977
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 >
Trust: Tobias Klauser <tobias.klauser@gmail.com >
2020-11-01 10:28:59 +00:00
Ben Cartwright-Cox
0fcbb8f492
unix: add linux constants and types for PPS devices ioctl's
...
After trying to implement Pulse Per Second devices
in go, I found that the ioctl values and structs
where not in the unix package yet:
~# strace ppstest /dev/pps0 |& grep ioctl
ioctl(3, PPS_GETPARAMS, 0xbee63b18) = 0
ioctl(3, PPS_GETCAP, 0xbee63b84) = 0
ioctl(3, PPS_GETPARAMS, 0xbee63b18) = 0
ioctl(3, PPS_SETPARAMS, 0xbee63b18) = 0
ioctl(3, PPS_FETCH, 0xbee63b00) = 0
ioctl(3, PPS_FETCH, 0xbee63b00) = 0
ioctl(3, PPS_FETCH, 0xbee63b00) = 0
ioctl(3, PPS_FETCH, 0xbee63b00) = 0
ioctl(3, PPS_FETCH, 0xbee63b00) = 0
This commit should add them.
Change-Id: If1225ab7c4c38aad5d8ae841d1fdebfa45055549
GitHub-Last-Rev: c1469112b8
GitHub-Pull-Request: golang/sys#90
Reviewed-on: https://go-review.googlesource.com/c/sys/+/265217
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: Matt Layher <mdlayher@gmail.com >
2020-10-27 14:07:54 +00:00
Tobias Klauser
56aa3af1a1
unix: update Dockerfile to Linux 5.9 and Go 1.15.2
...
Also add some newly added IFLA_* and PERF_* consts and adjust the
renamed NFTA_LIST_UNPEC const (see torvalds/linux@da9125df85 ).
Change-Id: Ic37f39e5b5bfe063ae6d7701de05ced07e62abfb
Reviewed-on: https://go-review.googlesource.com/c/sys/+/261457
Trust: Tobias Klauser <tobias.klauser@gmail.com >
Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com >
Reviewed-by: Matt Layher <mdlayher@gmail.com >
TryBot-Result: Go Bot <gobot@golang.org >
2020-10-13 06:48:17 +00:00
Matt Layher
ac719f4daa
unix: fix typo in PERF_TYPE_HARDWARE introduced in CL 259477
...
Change-Id: Iee2a067673309abc6b80d3cc96ac49d9d6b52865
Reviewed-on: https://go-review.googlesource.com/c/sys/+/259799
Trust: Matt Layher <mdlayher@gmail.com >
Run-TryBot: Matt Layher <mdlayher@gmail.com >
TryBot-Result: Go Bot <gobot@golang.org >
Reviewed-by: Bryan C. Mills <bcmills@google.com >
2020-10-06 15:56:30 +00:00
Lehner Florian
765f4ea38d
unix: update PERF consts on linux
...
Update the PERF_* consts from /usr/include/linux/perf_event.h.
Change-Id: I2dfa09445547682fa7ed99b385476319e8493c27
Reviewed-on: https://go-review.googlesource.com/c/sys/+/259477
Trust: Ian Lance Taylor <iant@golang.org >
Run-TryBot: Ian Lance Taylor <iant@golang.org >
TryBot-Result: Go Bot <gobot@golang.org >
Reviewed-by: Tobias Klauser <tobias.klauser@gmail.com >
Reviewed-by: Matt Layher <mdlayher@gmail.com >
2020-10-05 06:50:44 +00:00
Matt Layher
f6757f2700
unix: add Linux watchdog structures and missing constants
...
This CL also adds the type-safe wrappers IoctlGetWatchdogInfo
and IoctlWatchdogKeepalive around the raw ioctl interface.
Change-Id: I98e3970807b28832e49524700b17b6b6f75d91ed
Reviewed-on: https://go-review.googlesource.com/c/sys/+/259497
Run-TryBot: Matt Layher <mdlayher@gmail.com >
Run-TryBot: Ian Lance Taylor <iant@golang.org >
TryBot-Result: Go Bot <gobot@golang.org >
Reviewed-by: Terin Stock <terinjokes@gmail.com >
Reviewed-by: Florian Lehner <lehner.florian86@gmail.com >
Reviewed-by: Ian Lance Taylor <iant@golang.org >
Reviewed-by: Tobias Klauser <tobias.klauser@gmail.com >
Trust: Tobias Klauser <tobias.klauser@gmail.com >
2020-10-04 23:06:29 +00:00
Tobias Klauser
aee5d888a8
unix: add IoctlFile{Clone,CloneRange,DedupeRange} on linux
...
Add wrappers for the FICLONE, FICLONERANGE and FIDEDUPERANGE ioctl
operations on linux. See the ioctl_ficlone(2), ioctl_ficlonerange(2) and
ioctl_fideduperange(2) man pages for details.
Change-Id: If3bad98facc362d4f7524e8d7a128815e9e2f204
Reviewed-on: https://go-review.googlesource.com/c/sys/+/256000
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 >
2020-09-22 07:02:32 +00:00
Kir Kolyshkin
eff7692f90
unix: add openat2 for linux
...
openat2 is a new syscall added to Linux 5.6. It provides a superset of
openat(2) functionality, extending it with flags telling the kernel how
to resolve the paths.
For more info, see https://lwn.net/Articles/803237/
NOTE that this is a second attempt to add the call; the previous one
(https://golang.org/cl/227280 ) was reverted
(https://golang.org/cl/227846 ) due to the test case failure on ARM
(https://golang.org/issue/38357 ).
This CL has the test case reworked to be less assumptive to the testing
environment. In particular, it first tries if the most simplistic
openat2() call succeeds, and skips the test otherwise. It is done that
way because CI can be under under different kernels and in various
envrionments -- in particular, Docker+seccomp can result in EPERM from a
system call (which is not expected otherwise).
For previous discussions about the test case, see
https://golang.org/cl/227865 .
Change-Id: I4276cf13dc29ecbdbdc9c58da0f76270f585a67f
Reviewed-on: https://go-review.googlesource.com/c/sys/+/253057
Run-TryBot: Ian Lance Taylor <iant@golang.org >
TryBot-Result: Gobot Gobot <gobot@golang.org >
Reviewed-by: Tobias Klauser <tobias.klauser@gmail.com >
2020-09-09 08:10:42 +00:00
Stephan Klatt
8dfe04af21
unix: add constants for raw CAN sockets
...
Fixes golang/go#41091
Change-Id: Icae9ad639599474144b286510f744f4a283aba06
GitHub-Last-Rev: 541bdb97bb
GitHub-Pull-Request: golang/sys#83
Reviewed-on: https://go-review.googlesource.com/c/sys/+/251357
Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com >
Reviewed-by: Matt Layher <mdlayher@gmail.com >
TryBot-Result: Gobot Gobot <gobot@golang.org >
2020-08-28 15:00:25 +00:00
Ricardo Pchevuzinske Katz
7c7a221682
unix: add nftables_compat defines and types
...
Some types from nftables compatibility header are missing
in unix package and this change adds those missing types
Fixes golang/go#40898
Change-Id: I9a33aa4e4c6e1938fa40900ac74c1fc07ed00df2
GitHub-Last-Rev: 57a6fa7ca7
GitHub-Pull-Request: golang/sys#80
Reviewed-on: https://go-review.googlesource.com/c/sys/+/249237
Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com >
TryBot-Result: Gobot Gobot <gobot@golang.org >
Reviewed-by: Tobias Klauser <tobias.klauser@gmail.com >
2020-08-19 14:11:00 +00:00
Paweł Szulik
9a32b3aa38
unix: add missing PERF_SAMPLE values
...
This adds missing `sample_type` options from: https://man7.org/linux/man-pages/man2/perf_event_open.2.html
Change-Id: Icc17151f973d9a9f327bd6ca064e94ccc29e741c
GitHub-Last-Rev: 46e519b84c
GitHub-Pull-Request: golang/sys#79
Reviewed-on: https://go-review.googlesource.com/c/sys/+/249157
Reviewed-by: Ian Lance Taylor <iant@golang.org >
2020-08-19 03:55:08 +00:00
Christian Svensson
3ff754bf58
unix: add AF_IUCV and SockaddrIUCV
...
On z series machines the IUCV address family is used to communicate
between parts of the machine and other VMs that may be running.
This adds support for addressing these services using AF_IUCV.
Fixes golang/go#40826
Change-Id: I3aba3beb5cb98d9c548d7abc874ca86fb25c8a52
GitHub-Last-Rev: b964d186b4
GitHub-Pull-Request: golang/sys#76
Reviewed-on: https://go-review.googlesource.com/c/sys/+/248777
Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com >
TryBot-Result: Gobot Gobot <gobot@golang.org >
Reviewed-by: Tobias Klauser <tobias.klauser@gmail.com >
2020-08-17 08:59:35 +00:00
Anatol Pomozov
3d37ad5750
unix: add dm-ioctl constants and types
...
This interface is used by devicemapper framework to manage its block
devices.
Change-Id: If86a679461867dac18b56bdf005567ffc4b7f951
Reviewed-on: https://go-review.googlesource.com/c/sys/+/247437
Run-TryBot: Ian Lance Taylor <iant@golang.org >
TryBot-Result: Gobot Gobot <gobot@golang.org >
Reviewed-by: Ian Lance Taylor <iant@golang.org >
2020-08-14 20:00:57 +00:00
Tobias Klauser
1030fc2bf1
unix: update BPF consts to Linux kernel 5.8
...
Change-Id: I81fe749808d48bfafdaf55c266168f9d3a773294
Reviewed-on: https://go-review.googlesource.com/c/sys/+/247158
Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com >
TryBot-Result: Gobot Gobot <gobot@golang.org >
Reviewed-by: Matt Layher <mdlayher@gmail.com >
2020-08-08 12:01:58 +00:00
Tobias Klauser
fcf3340312
unix: add SI_LOAD_SHIFT on Linux
...
This is used to convert the loadavg values read using Sysinfo into
float.
Change-Id: I3866c17c908a463373db89690152acc720c73ef3
Reviewed-on: https://go-review.googlesource.com/c/sys/+/246897
Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com >
Reviewed-by: Matt Layher <mdlayher@gmail.com >
TryBot-Result: Gobot Gobot <gobot@golang.org >
2020-08-06 06:08:41 +00:00
Tobias Klauser
8d3cce7afc
unix: update Dockerfile to Linux 5.7 and Go 1.14.4
...
Some BPF related macros were converted to enum values, so add them to
linux/types.go
Change-Id: I6fa9cc17b6ff3be91f3aa0b7ef2cfe19faf069bd
Reviewed-on: https://go-review.googlesource.com/c/sys/+/236097
Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com >
TryBot-Result: Gobot Gobot <gobot@golang.org >
Reviewed-by: Matt Layher <mdlayher@gmail.com >
2020-06-02 10:08:48 +00:00
Maxim Pugachev
1f56873058
unix: add support for timerfd syscalls on Linux
...
timerfd_create, timerfd_gettime and timerfd_settime syscalls have been added.
Fixes golang/go#38733
Change-Id: I306d68103b6efb2515c74f384646210c4b68f66e
Reviewed-on: https://go-review.googlesource.com/c/sys/+/230798
Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com >
TryBot-Result: Gobot Gobot <gobot@golang.org >
Reviewed-by: Tobias Klauser <tobias.klauser@gmail.com >
2020-04-30 08:24:07 +00:00
Andrew Bonventre
669c56c373
Revert "unix: add openat2 for linux"
...
This reverts CL 227280.
Reason for revert: causes failures on ARM builders
Fixes golang/go#38357
Change-Id: Ie80ff37205ff12c3b74d00ff46b7222e34363d86
Reviewed-on: https://go-review.googlesource.com/c/sys/+/227846
Run-TryBot: Andrew Bonventre <andybons@golang.org >
TryBot-Result: Gobot Gobot <gobot@golang.org >
Reviewed-by: Bryan C. Mills <bcmills@google.com >
2020-04-13 16:56:38 +00:00
Tobias Klauser
e3b113bbe6
unix: add nexthop types and consts
...
Fixes golang/go#38249
Change-Id: Ie8149ac16d09e76d6c5aa4d47edd947a647c381f
Reviewed-on: https://go-review.googlesource.com/c/sys/+/227357
Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com >
Reviewed-by: Matt Layher <mdlayher@gmail.com >
Reviewed-by: Ian Lance Taylor <iant@golang.org >
TryBot-Result: Gobot Gobot <gobot@golang.org >
2020-04-06 15:51:08 +00:00
Kir Kolyshkin
c6e801f48b
unix: add openat2 for linux
...
openat2 is a new syscall added to Linux 5.6. It provides a superset
of openat(2) functionality, providing a way to extend it in the future,
and (for now) adding flags telling the kernel how to resolve the path.
For more info on openat2, see https://lwn.net/Articles/803237/
A primitive test case is added to check that Openat2 works as
it should. Tested to skip on kernel 5.5 and pass on 5.6.
Change-Id: Ib8bbd71791762f043200543cecdea16d2fd3c81d
Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com >
Reviewed-on: https://go-review.googlesource.com/c/sys/+/227280
Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com >
TryBot-Result: Gobot Gobot <gobot@golang.org >
Reviewed-by: Tobias Klauser <tobias.klauser@gmail.com >
2020-04-06 11:34:30 +00:00
Tobias Klauser
9dae0f8f57
unix: add fs-verity consts and types
...
See https://www.kernel.org/doc/html/latest/filesystems/fsverity.html for
details.
Change-Id: I5b02d0ef84f21d05ea3f1ac8e905232733ea3739
Reviewed-on: https://go-review.googlesource.com/c/sys/+/225698
Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com >
TryBot-Result: Gobot Gobot <gobot@golang.org >
Reviewed-by: Ian Lance Taylor <iant@golang.org >
2020-03-27 17:32:47 +00:00
Tom Parkin
9a0dfc3c55
unix: implement L2TPIP socket address on Linux
...
Add constants and types to support IP-encapsulated L2TP/RFC3931
tunnels on Linux systems.
The L2TP subsystem for IP encapsulated tunnels hooks into the inet
kernel code using a specific IP protocol value. In order to handle
this, anyToSockaddr now has to query the socket protocol type using
GetsockoptInt for the AF_INET and AF_INET6 address families.
Although this change is reasonably simple, unit tests have been added
to validate handling of the new types.
Fixes golang/go#37787
Change-Id: I16ae1e24dcced4ccc6ce6a79a90a5a2f6a560967
GitHub-Last-Rev: ca554ad1b6
GitHub-Pull-Request: golang/sys#60
Reviewed-on: https://go-review.googlesource.com/c/sys/+/223157
Reviewed-by: Ian Lance Taylor <iant@golang.org >
2020-03-16 20:21:46 +00:00
Tobias Klauser
5c8b2ff675
unix: update BPF consts on linux
...
Update the BPF_* consts from include/uapi/linux/bpf.h as of Linux 5.5.
Change-Id: I5098fc9e4fc1fb3e6cc2e2f85a8e65b369b6a81c
Reviewed-on: https://go-review.googlesource.com/c/sys/+/221797
Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com >
TryBot-Result: Gobot Gobot <gobot@golang.org >
Reviewed-by: Matt Layher <mdlayher@gmail.com >
2020-03-02 15:01:41 +00:00
Nikson Kanti Paul
d5e6a3e2c0
unix: add adjtimex return constants
...
Fixes golang/go#37234
Change-Id: I6deda79bc0b8f34c7bb210b64adabbfff5fe675e
Reviewed-on: https://go-review.googlesource.com/c/sys/+/219697
Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com >
TryBot-Result: Gobot Gobot <gobot@golang.org >
Reviewed-by: Tobias Klauser <tobias.klauser@gmail.com >
2020-02-23 17:06:10 +00:00
Eric Biggers
63cb32ae39
unix: add new fscrypt declarations from Linux v5.4
...
Create Go bindings for the updated fscrypt UAPI from Linux v5.4:
- Various new ioctls. We use the regex FS_IOC_.*ENCRYPTION to match
both the new and existing fscrypt ioctls.
- Various new structures for passing to the ioctls
- Various new constants named like FSCRYPT_*
- FscryptPolicy was renamed to FscryptPolicyV1. (But the old name is
still available for source compatibility.)
- The existing fscrypt-related constants named like FS_* (besides the
ioctls) were renamed to FSCRYPT_*. (But the old names are still
available for source compatibility.)
For reference, see fscrypt.h:
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/include/uapi/linux/fscrypt.h?h=v5.4
Fixes golang/go#35856
Change-Id: I48ddd37cfa7c1e0e7eb227baa6f220c848ddc880
Reviewed-on: https://go-review.googlesource.com/c/sys/+/208898
Run-TryBot: Ian Lance Taylor <iant@golang.org >
TryBot-Result: Gobot Gobot <gobot@golang.org >
Reviewed-by: Ian Lance Taylor <iant@golang.org >
2019-11-27 02:17:46 +00:00
Tobias Klauser
52ab431487
unix: fix EpollEvent padding on mips64{,le}
...
Like on other 64-bit GOARCHes, EpollEvent needs padding before Fd for
mips64 and mips64le.
Change-Id: I934368ba22ef7bf3a25949649613c2a03928bf83
Reviewed-on: https://go-review.googlesource.com/c/sys/+/207278
Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com >
TryBot-Result: Gobot Gobot <gobot@golang.org >
Reviewed-by: Ian Lance Taylor <iant@golang.org >
2019-11-15 15:19:21 +00:00
Matt Layher
195ce5e7f9
unix: add devlink Linux generic netlink API constants
...
For more information on devlink, see: https://lwn.net/Articles/674867/ .
Change-Id: I68815c94160864f4a3d2bb78b2e5d06949d27acf
Reviewed-on: https://go-review.googlesource.com/c/sys/+/203878
Run-TryBot: Matt Layher <mdlayher@gmail.com >
TryBot-Result: Gobot Gobot <gobot@golang.org >
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org >
2019-10-28 16:43:58 +00:00
Lehner Florian
06d7bd2c5f
unix: update rtnetlink constants
...
Change-Id: I21551672b5d8dd3e56c49da69f66dc19b07a5299
Reviewed-on: https://go-review.googlesource.com/c/sys/+/199757
Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com >
TryBot-Result: Gobot Gobot <gobot@golang.org >
Reviewed-by: Tobias Klauser <tobias.klauser@gmail.com >
2019-10-09 17:02:03 +00:00
Srinidhi Kaushik
aed5e4c7ec
unix: add Klogset and related SYSLOG_ACTION_ constants
...
Adds a new function: Klogset which wraps sys_syslog for
cases where the `bufp` argument is not required and the
argument that follows needs to be passed to the function.
Fixes golang/go#34672
Change-Id: Idf026791ea9265aaca33e78a34fcd490edb8d326
Reviewed-on: https://go-review.googlesource.com/c/sys/+/199278
Reviewed-by: Tobias Klauser <tobias.klauser@gmail.com >
Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com >
TryBot-Result: Gobot Gobot <gobot@golang.org >
2019-10-05 20:08:04 +00:00
Tobias Klauser
c3b328c6e5
unix: add IfaCacheinfo on linux
...
Change-Id: Ifda2eed10f75eeddff7720676fd0a5feee78a7a5
Reviewed-on: https://go-review.googlesource.com/c/sys/+/195257
Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com >
Reviewed-by: Matt Layher <mdlayher@gmail.com >
TryBot-Result: Gobot Gobot <gobot@golang.org >
2019-09-13 12:16:21 +00:00
Tobias Klauser
bc967efca4
unix: sort Linux-specific includes in linux/types.go and mkerrors.sh
...
Keep the list of includes sorted, so that it's clear where to add new
entries and to avoid duplicates being added.
Change-Id: I67bd8b5a4e4b40affcad636dccfceef2460158b1
Reviewed-on: https://go-review.googlesource.com/c/sys/+/195017
Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com >
TryBot-Result: Gobot Gobot <gobot@golang.org >
Reviewed-by: Matt Layher <mdlayher@gmail.com >
2019-09-12 14:19:32 +00:00
Matt Layher
43c01164e9
unix: implement AF_TIPC sockets on Linux
...
Adds initial constants and types to use with SockaddrTIPC. For more
information on TIPC, see: http://tipc.sourceforge.net/ .
Because the C struct sockaddr_tipc makes use of a union for its addr
field, I have created a wrapping layer in SockaddrTIPC that uses
an interface to determine which variant is in use.
Tests accompany this change due to the complexity of this code. There
is currently little test coverage in the Sockaddr-related code, but
perhaps this is something that could be picked up as a relatively
straightforward task for a new contributor.
Change-Id: I5033a0685cb7128d4b1a23d18aca71c202d0c0aa
Reviewed-on: https://go-review.googlesource.com/c/sys/+/187960
Run-TryBot: Matt Layher <mdlayher@gmail.com >
TryBot-Result: Gobot Gobot <gobot@golang.org >
Reviewed-by: Ian Lance Taylor <iant@golang.org >
2019-09-04 00:50:37 +00:00
Tonis Tiigi
9eafafc0a8
unix: fix epoll_event padding on riscv64
...
Change-Id: I88bccf0e671d350f8f57ac4d277adf4081054729
GitHub-Last-Rev: 3302142611
GitHub-Pull-Request: golang/sys#40
Reviewed-on: https://go-review.googlesource.com/c/sys/+/189877
Reviewed-by: Tobias Klauser <tobias.klauser@gmail.com >
Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com >
TryBot-Result: Gobot Gobot <gobot@golang.org >
2019-08-12 07:30:06 +00:00
Tobias Klauser
fae7ac547c
unix: add constants and types to work with Linux loop devices
...
Change-Id: I0996df39a561b50822a6e42e770d96421d6b4965
Reviewed-on: https://go-review.googlesource.com/c/sys/+/185498
Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com >
TryBot-Result: Gobot Gobot <gobot@golang.org >
Reviewed-by: Ian Lance Taylor <iant@golang.org >
2019-07-12 06:29:09 +00:00
Tobias Klauser
943d5127bd
unix: add support to get/set Linux capabilities
...
Add wrappers for Getcap/Setcap on Linux as well as some related types
and consts.
Change-Id: I07764c2e64717214850ea3cbdc238e313d1e38c4
Reviewed-on: https://go-review.googlesource.com/c/sys/+/183218
Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com >
TryBot-Result: Gobot Gobot <gobot@golang.org >
Reviewed-by: Ian Lance Taylor <iant@golang.org >
2019-06-21 15:33:39 +00:00
Yuval Pavel Zholkover
adf421d2ca
unix: fix Signalfd function signature on linux
...
The kernel raw syscall takes an additional parameter specifying
the size of the Sigset_t parameter, returns a file descriptor and sets errno.
Add a uintptr maxSize parameter, adjust the return to be (newfd int, err error).
Add the _NSIG #define and a wrapper to call with maxSize set to _C__NSIG/8 as done
in glibc/musl.
Change-Id: I277db0aab5c12364533c26ea800b7f394ec83ae4
Reviewed-on: https://go-review.googlesource.com/c/sys/+/178858
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org >
Reviewed-by: Ian Lance Taylor <iant@golang.org >
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org >
TryBot-Result: Gobot Gobot <gobot@golang.org >
2019-05-28 01:25:30 +00:00
Lehner Florian
12bbe5a7a5
unix: add BPF constants on Linux
...
Change-Id: Ie43daa8ba56ad1e57ddbb8ddd47f83b363fe75b4
Reviewed-on: https://go-review.googlesource.com/c/sys/+/174978
Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com >
TryBot-Result: Gobot Gobot <gobot@golang.org >
Reviewed-by: Tobias Klauser <tobias.klauser@gmail.com >
2019-05-08 10:04:23 +00:00
Gernot Vormayr
a43fa875dd
unix: add missing tpacket block (sub)header
...
This adds the missing tpacket_hdr_v1 struct, which is needed to read
tpacket_block_desc (hdr member, which is a union and therfore defined as
[40]byte). This doesn't modify block_desc so existing implementations
keep working.
Caveat: Although TpacketBDTS has a usec member, this will contain nsec
in case of tpacket v2 or v3.
Change-Id: I772939fe56cf56fc09cf4acf4013b23beb6e03c7
Reviewed-on: https://go-review.googlesource.com/c/sys/+/174861
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org >
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org >
TryBot-Result: Gobot Gobot <gobot@golang.org >
2019-05-02 17:53:42 +00:00
Matt Layher
18eb32c0e2
unix: add Linux crypto configuration API constants and types
...
Change-Id: I447150cb60b5580cee77d23c0dae2244803e92ef
Reviewed-on: https://go-review.googlesource.com/c/sys/+/173660
Run-TryBot: Matt Layher <mdlayher@gmail.com >
TryBot-Result: Gobot Gobot <gobot@golang.org >
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org >
2019-04-24 17:57:32 +00:00
Matt Layher
b44545bcd3
unix: add missing rtnetlink IFLA_* constants on Linux
...
A number of IFLA_* constants have been added since the last time this
list was generated. In addition, IFLA_INFO_* is a different enum, so
we'll add the missing values for there as well.
Change-Id: Ie20b1f49a95cbc10daf0be2e5b5d719782eda68f
Reviewed-on: https://go-review.googlesource.com/c/sys/+/171698
Run-TryBot: Matt Layher <mdlayher@gmail.com >
TryBot-Result: Gobot Gobot <gobot@golang.org >
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org >
2019-04-11 18:56:58 +00:00
Jeroen Simonetti
0ad05ae300
unix: add missing rtnetlink neighbor constants on Linux
...
Change-Id: Ie261a6f149b7bc531f80726c016bf8f63c9210a7
Reviewed-on: https://go-review.googlesource.com/c/sys/+/171537
Reviewed-by: Ian Lance Taylor <iant@golang.org >
2019-04-10 23:58:45 +00:00
Matt Layher
cc4d4f5062
unix: add missing rtnetlink IFA_* constants on Linux
...
A few additional constants are now available since the last time
this list was updated.
Change-Id: I81cd07f8c6e7acb03ef67764ab783cea89ba3868
Reviewed-on: https://go-review.googlesource.com/c/sys/+/171318
Run-TryBot: Matt Layher <mdlayher@gmail.com >
TryBot-Result: Gobot Gobot <gobot@golang.org >
Reviewed-by: Ian Lance Taylor <iant@golang.org >
2019-04-10 17:00:21 +00:00
Andrei Tudor Călin
980fc434d2
unix, unix/linux: add additional Linux perf API bits
...
Add sample_max_stack field to struct perf_event_attr.
Add the missing PERF_FLAG_FD_CLOEXEC flag, the missing
PERF_COUNT_SW_BPF_OUTPUT constant, missing PERF_RECORD_*
constants, and missing PERF_SAMPLE_BRANCH_* constants.
Change-Id: I44c5e37ff36420b35e56c97e7fc190cd0af95e21
Reviewed-on: https://go-review.googlesource.com/c/sys/+/166457
Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com >
TryBot-Result: Gobot Gobot <gobot@golang.org >
Reviewed-by: Tobias Klauser <tobias.klauser@gmail.com >
2019-03-09 12:25:39 +00:00
Tobias Klauser
3e9a981b8d
unix: add functions to get/set tpacket socket options
...
Add GetsockoptTpacketStats and GetsockoptTpacketStatsV3 to get tpacket
statistics (for TPACKET_V2 and TPACKET_V3).
Add SetsockoptTpacketReq and SetsockoptTpacketReq3 to set up tpacket
v2/v3 ring buffers.
Change-Id: Ic2870be22be7d74141f682e515a682df28e1c814
Reviewed-on: https://go-review.googlesource.com/c/sys/+/165558
Reviewed-by: Ian Lance Taylor <iant@golang.org >
2019-03-06 15:53:19 +00:00
Dominik Honnef
c2f5717e61
unix: add fanotify API on Linux
...
This teaches unix/mksyscall.go about mapping uint64 to syscall
arguments, similar to existing handling of int64.
Change-Id: I536b4b09bbf6a8e3016565a4a04d2b9d32cbc624
Reviewed-on: https://go-review.googlesource.com/c/164664
Reviewed-by: Tobias Klauser <tobias.klauser@gmail.com >
2019-03-03 19:25:50 +00:00