Граф коммитов

99 Коммитов

Автор SHA1 Сообщение Дата
Tobias Klauser 5e4e11fc64 unix/linux: use gotip instead of patched Go 1.18
CL 399336 added support for generating linux/loong64 types and constants
by using a patched version of Go 1.18. The necessary changes have since
been submitted to gotip, so use Go build from the master branch to
generate types and consts.

The changes in the cgo -godefs generated comments are due to CL 396936,
also see go.dev/issue/52063

Change-Id: I314156675e79ba77b9eb1fa1845b20ca974ec77a
Reviewed-on: https://go-review.googlesource.com/c/sys/+/406794
Reviewed-by: Ian Lance Taylor <iant@google.com>
Reviewed-by: Michael Knyszek <mknyszek@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Auto-Submit: Tobias Klauser <tobias.klauser@gmail.com>
Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com>
2022-05-17 19:59:34 +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
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
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
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
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
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
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
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
Russ Cox 9a76102bfb all: go fmt ./...
Make all our package sources use Go 1.17 gofmt format
(adding //go:build lines).

Not strictly necessary but will avoid spurious changes
as files are edited.

Part of //go:build change (#41184).
See https://golang.org/design/draft-gobuild

Change-Id: I01667f826428426a39c84717d02efa25fa44553c
Reviewed-on: https://go-review.googlesource.com/c/sys/+/294490
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Keith Randall <khr@golang.org>
Reviewed-by: Josh Bleecher Snyder <josharian@gmail.com>
Reviewed-by: Matt Layher <mdlayher@gmail.com>
Trust: Josh Bleecher Snyder <josharian@gmail.com>
Trust: Russ Cox <rsc@golang.org>
Run-TryBot: Josh Bleecher Snyder <josharian@gmail.com>
Run-TryBot: Russ Cox <rsc@golang.org>
2021-02-20 05:07:31 +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 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
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
Tobias Klauser 5acd03effb unix: update Dockerfile to glibc 2.32
Change-Id: Ia5ebb34a743c6e676d3cb2febaefc55afa9fc7ac
Reviewed-on: https://go-review.googlesource.com/c/sys/+/247157
Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Matt Layher <mdlayher@gmail.com>
2020-08-06 12:55:47 +00:00
Tobias Klauser ddb9806d33 unix: add FS_IOC_SETFLAGS on linux
Change-Id: I455c008a114a017a6ecedb134f9af17d14dd249b
Reviewed-on: https://go-review.googlesource.com/c/sys/+/240037
Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Matt Layher <mdlayher@gmail.com>
2020-06-25 21:21:54 +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
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
Johan Jansson c5d0d7b4ec unix: merge duplicate code in zerrors_linux_*.go
Run mkmerge.go on zerrors_linux_*.go to merge duplicate consts, funcs,
and types into zerrors_linux.go

Please see https://gist.github.com/jupj/639b5cda305d251161fec2304c27c9b9
for a script to validate these changes.

Updates golang/go#33059

Change-Id: I168b5efc7fd6d2fcf7fc8dfe1ef5eea07f07f9c2
Reviewed-on: https://go-review.googlesource.com/c/sys/+/221318
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
2020-03-01 04:06:27 +00:00
Tobias Klauser 2d4d9931dc unix: add RTMGRP_* consts from rtnetlink.h
Change-Id: I50fe62020e539df0ada577b71e87fb67b7e43973
Reviewed-on: https://go-review.googlesource.com/c/sys/+/219797
Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Matt Layher <mdlayher@gmail.com>
2020-02-17 22:08:02 +00:00
Tobias Klauser d101bd2416 unix: update Dockerfile to Linux 5.5, glibc 2.31, Go 1.13.7
Change-Id: I6bcbf93132861fb2896c6884e2c7e1c42672ece4
Reviewed-on: https://go-review.googlesource.com/c/sys/+/217477
Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Matt Layher <mdlayher@gmail.com>
2020-02-02 16:47:22 +00:00
Axel Wagner d4481acd18 unix: add Readv/Writev family of syscalls for linux
Fixes golang/go#36201

Change-Id: Ie3b197e18bc5d59fd222f3fa0100e1e0a3d11866
Reviewed-on: https://go-review.googlesource.com/c/sys/+/212157
Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Tobias Klauser <tobias.klauser@gmail.com>
2019-12-20 14:29:24 +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
Matt Layher 8a8471f7e5 unix/linux: bump Linux and Go versions to latest stable releases
Attempting to upgrade to the Ubuntu 19.10 Docker image results in
failures due to Ubuntu/Debian removing the mips{,64}{,le} cross
compilers, so we stick with 19.04 for now.

Change-Id: Ie75057447889ea1648d638a410e1c35c047b579a
Reviewed-on: https://go-review.googlesource.com/c/sys/+/208737
Run-TryBot: Matt Layher <mdlayher@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Tobias Klauser <tobias.klauser@gmail.com>
2019-11-26 13:16:56 +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
Tobias Klauser 2837fb4f24 unix: add NFDBITS const on Linux, update TestSelect
Adjust TestSelect on Linux to match the Darwin/*BSD changes in CL
196802.

Updates golang/go#34458

Change-Id: Ia17fdadf7091001ea785391da23aaf9d3ec4ac5e
Reviewed-on: https://go-review.googlesource.com/c/sys/+/196806
Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2019-09-24 15:45:21 +00:00
Matt Layher b4ddaad3f8 unix: redefine TIPC_WAIT_FOREVER as a uint32 value
The code generator produces -0x1 for (~0) from the tipc.h C header, but this
value is unusable in Go as a uint32. Undefine and replace this value with
the appropriate constant for TIPC_WAIT_FOREVER.

Fixes golang/go#34310

Change-Id: Ic6ab0ddd14394e15868085e2123a9a97a841bc6d
Reviewed-on: https://go-review.googlesource.com/c/sys/+/195757
Run-TryBot: Matt Layher <mdlayher@gmail.com>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
2019-09-16 20:23:48 +00:00
Tobias Klauser 1a3b71a79e unix: update Dockerfile to Linux 5.3 and use ubuntu 19.04 base image
rsync needs to be explicitly installed for 'make headers_install' to
work.

Change-Id: Icd3d6b3f004a7684b5ae32b4b7cab8d50631900d
Reviewed-on: https://go-review.googlesource.com/c/sys/+/195258
Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Matt Layher <mdlayher@gmail.com>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
2019-09-16 14:18:54 +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
Kir Kolyshkin 9109b7679e unix: add IoctlRetInt for Linux
Add IoctlRetInt() for ioctls that use syscall's return value
as an output parameter. Add a unit test for Linux, and the
NS_GET_ defines that it requires (see ioctl_ns(2)).

Motivation:

Currently, x/sys/unix provides a few functions to deal with ioctls.
In particular, IoctlGetInt(), which "performs an ioctl operation
which gets an integer value". It does that by passing a pointer
to an integer to a syscall and returning that integer. The value
returned from syscall is treated as success/failure flag
(0 means success, -1 means failure, and in such case errno
is used to figure out the underlying error).

It appears that there are a few ioctls in Linux and at least one
in Solaris, which do not use the above way to return an int, instead
they use the syscall's return value (in case it's not negative).

As Linux ioctl(2) man page says,

> RETURN VALUE
> Usually, on success zero is returned. A few ioctl() requests
> use the return value as an output parameter and return
> a nonnegative value on success. On error, -1 is returned,
> and errno is set appropriately.

Currently I am aware of at least 6 Linux ioctls that do that
(return the value directly):

* LOOP_CTL_* ioctls on /dev/loop-control (all 3 of them). Source: loop(4)
* NS_* ioctls (3 out of 4) on /proc/PID/ns/*. Source: ioctl_ns(2)

And one in Solaris:

* I_FIND ioctl, source: streamio(7i).

There might be some more ioctls like the ones above, but since
ioctls are scarcely documented, it is hard to say how many more.

Obviously, using IoctlGetInt() for such ioctls would be a big
mistake, as 0 will always be returned. For example, there was
a bug in Docker's pkg/loopback (moby/moby#39801).

[v6: make it linux-specific for now]

Fixes golang/go#33966

Change-Id: Ie64f72fd84101b955ba14519a357e06a66d685d0
Reviewed-on: https://go-review.googlesource.com/c/sys/+/192780
Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Tobias Klauser <tobias.klauser@gmail.com>
2019-09-02 13:37:55 +00:00
Tobias Klauser fde4db37ae unix/linux: update Dockerfile to glibc 2.30
Change-Id: I4fd358388c46b4c2e8a4081640315db2313e585f
Reviewed-on: https://go-review.googlesource.com/c/sys/+/189438
Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Matt Layher <mdlayher@gmail.com>
2019-08-13 06:44:41 +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 6ec70d6a55 unix: update Dockerfile to Linux 5.2 and Go 1.13beta1
Change-Id: I1a63f6ae5fe6b8b6fb4f493837b12dbe3c2860d4
Reviewed-on: https://go-review.googlesource.com/c/sys/+/185497
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-10 14:34:15 +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
Tobias Klauser abf6ff7781 unix: add MCAST_* constants on linux
This will also add two BPF_* consts which weren't added as part of
CL 174978 because they were generated before the Linux version update
in CL 175158.

Change-Id: I5dfecbecb9d94b56d01490a5f17f2250ad5b30d4
Reviewed-on: https://go-review.googlesource.com/c/sys/+/178658
Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
2019-05-24 12:25:48 +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
Tobias Klauser 2953c62de4 unix: update Dockerfile to Linux 5.1
Also add KexecFileLoad on linux/arm now that is has SYS_KEXEC_FILE_LOAD.

Change-Id: I519bc2f611b511af994e1c7bbaa07f68cd615ef4
Reviewed-on: https://go-review.googlesource.com/c/sys/+/175158
Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2019-05-07 05:39:17 +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
Tobias Klauser e844e0132e unix: update Dockerfile to Go 1.12 and Linux 5.0
Also enable KexecFileLoad on linux/{arm64,riscv64} now that they have
SYS_KEXEC_FILE_LOAD.

Change-Id: I1c52d09a1a617794f2df697e4966c4c24a166611
Reviewed-on: https://go-review.googlesource.com/c/sys/+/164997
Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2019-03-04 15:46:30 +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
Tobias Klauser 41f3e65849 unix/linux: update Dockerfile to glibc 2.29 and Go 1.12beta2
Drop the manually defined *_XDP constants which were added to glibc.
Install python3 instead of python because glibc's confugure script now
requires at least 3.4.

Change-Id: Ic19ff4d8aa4dbadeb5438e331ccafeafc2cc9925
Reviewed-on: https://go-review.googlesource.com/c/160957
Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2019-02-04 20:37:06 +00:00
Tobias Klauser afcc84fd75 unix: add RND* ioctl consts on Linux
Change-Id: I79c721d0f4fe097daf096dc7404675aa3048bf6a
Reviewed-on: https://go-review.googlesource.com/c/160757
Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
2019-02-01 15:26:29 +00:00
Tobias Klauser 054c452bb7 unix: add socket error queue constants and types from linux/errqueue.h
Also add additional packet timestamping constants and types defined
in the same header.

Change-Id: I4280f925b46e229f4c3a83a7fee4612592314016
Reviewed-on: https://go-review.googlesource.com/c/158761
Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2019-01-22 07:17:31 +00:00
Tobias Klauser a457fd0364 unix: add Signalfd on linux
Also add the SFD_* constants and SignalfdSiginfo type.

Change-Id: I3415c212b85c9d5a940ba2bf70f43739a2630d78
Reviewed-on: https://go-review.googlesource.com/c/157897
Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2019-01-15 15:29:22 +00:00
Sebastian Schmidt 2be5172556 unix: add ClockNanosleep and TIMER_ABSTIME
This adds the ClockNanosleep syscall and the TIMER_* constants;
currently only TIMER_ABSTIME for specifying an absolute timestamp.

Change-Id: Ic8d857eb92818529aadab569cd8646a19bb9c055
Reviewed-on: https://go-review.googlesource.com/c/157658
Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Tobias Klauser <tobias.klauser@gmail.com>
2019-01-14 13:03:36 +00:00
Tobias Klauser 82a175fd15 unix/linux: update Dockerfile to Linux Kernel 4.20
Change-Id: Iadc92b5afd18a5c1df0bc42b0d6f52f0b768b47a
Reviewed-on: https://go-review.googlesource.com/c/155979
Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2019-01-02 15:56:01 +00:00
David Anderson ec83556a53 unix: add ioctl definitions for PPP interfaces.
Change-Id: I76b53563e3f029d1fbaad39acd5af73df278343e
GitHub-Last-Rev: b0aff54248
GitHub-Pull-Request: golang/sys#24
Reviewed-on: https://go-review.googlesource.com/c/150317
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
2018-11-19 19:55:03 +00:00
Tobias Klauser 731415f00d unix: add kernel module load/unload syscalls on Linux
InitModule loads a kernel module from an ELF image. FinitModule loads a
kernel module from a file descriptor. DeleteModule unloads a kernel
module.

These syscalls require the CAP_SYS_MODULE capability.

See http://man7.org/linux/man-pages/man2/init_module.2.html and
http://man7.org/linux/man-pages/man2/delete_module.2.html for details.

Also drop deprecated syscalls related to kernel modules from the list
of unimplemented syscalls.

Change-Id: I131e17f02c5617640f5f4073982d2b27a6d78bbf
Reviewed-on: https://go-review.googlesource.com/c/144173
Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2018-10-26 06:49:43 +00:00
Tobias Klauser 8a28ead16f unix: update Dockerfile to Linux 4.19
Change-Id: I58c2cfb11ddd5ce731a880c0c63790092052f130
Reviewed-on: https://go-review.googlesource.com/c/143697
Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2018-10-22 13:44:30 +00:00