Commit Graph

179 Commits

Author SHA1 Message Date
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
Tobias Klauser
0b90fd5c4c unix/linux: update Dockerfile to Go 1.16.2
Change-Id: I263e0ed034ded3ef8cf9bd9745d9095067cc3a25
Reviewed-on: https://go-review.googlesource.com/c/sys/+/301689
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-03-16 09:29:37 +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
Tobias Klauser
68d13333fa unix: add //go:build lines when generating files
The //+go:build lines were added by running Go 1.17 gofmt in CL 294490.
Make sure to retain them when re-generating files in this package.

For golang/go#41184.

Change-Id: Ia418b8c0eb4291a0db3f4bb97685bde78d0ff016
Reviewed-on: https://go-review.googlesource.com/c/sys/+/296889
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-03-09 07:47:19 +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
Tobias Klauser
b926d437f3 unix/linux: update Dockerfile to Kernel 5.11, glibc 2.33, Go 1.16
The FS_POLICY_FLAGS_VALID const is kernel-internal and was removed from
the UAPI headers in
3ceb6543e9

Change-Id: I21b1efe895fbd7f640a7604805cf7ce39c5a43f4
Reviewed-on: https://go-review.googlesource.com/c/sys/+/291637
Trust: Tobias Klauser <tobias.klauser@gmail.com>
Trust: Matt Layher <mdlayher@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-02-17 10:54:51 +00:00
Tobias Klauser
ed5674b6da unix/linux: adjust comment regarding riscv64 support
The riscv64 port is supported since Go 1.14, adjust the comment in
mkall.go accordingly.

Change-Id: I4b3f218abe9c864c855e89f132e67e9d86754a53
Reviewed-on: https://go-review.googlesource.com/c/sys/+/288333
Trust: Tobias Klauser <tobias.klauser@gmail.com>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
2021-02-17 09:06:53 +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
bc327ba9c2 unix/linux: update Dockerfile to Go 1.16beta1
Change-Id: Iee6d0bdbbb4f36adb8e963e482c0d62c7a3fb147
Reviewed-on: https://go-review.googlesource.com/c/sys/+/279113
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-21 09:36:33 +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
Tobias Klauser
215b40eba5 unix/linux: update Dockerfile to Go 1.15.4
No changes in generated files.

Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
Change-Id: Ibbb81f8ef48d43d7fb620fec57c3ac779ebf0e11
Reviewed-on: https://go-review.googlesource.com/c/sys/+/268357
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>
2020-11-09 16:54:25 +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
Ian Lance Taylor
e3ed0017c2 unix/linux: update to Go 1.15.3 release
Does not cause any changes to generated files.

Change-Id: I635230441d4c48d1f649ca5c7cca073974e36b60
Reviewed-on: https://go-review.googlesource.com/c/sys/+/262457
Run-TryBot: Ian Lance Taylor <iant@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Trust: Ian Lance Taylor <iant@golang.org>
2020-10-15 00:08:50 +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