Commit Graph

224 Commits

Author SHA1 Message Date
Mark Ryan
104d4017fa unix: add riscv_hwprobe for riscv64
The riscv_hwprobe system call was introduced in Linux 6.4 and allows
the caller to determine a number of interesting pieces of information
about the underlying RISC-V CPUs, e.g., which extensions they support
and whether they allow fast unaligned memory accesses.  For more information
please see:

https://docs.kernel.org/riscv/hwprobe.html

We also update linux/mksysnum.go to ensure that the generated syscall constants
written to the zsysnum_linux_*.go files are always sorted by their syscall numbers
in ascending order.

Updates golang/go#61416

Change-Id: Iedb0a86adb65faac9061b9a5969ffa09eb5b303a
Reviewed-on: https://go-review.googlesource.com/c/sys/+/510795
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Matthew Dempsky <mdempsky@google.com>
Auto-Submit: Ian Lance Taylor <iant@google.com>
Reviewed-by: Ian Lance Taylor <iant@google.com>
Run-TryBot: Ian Lance Taylor <iant@google.com>
2023-07-26 11:14:25 +00:00
Mauri de Souza Meneguzzo
25d0004552 unix: fix last argument of pselect6 on linux
On Linux, the last argument of pselect6 system call is **not** a
sigseg_t * pointer, but instead it is a structure of the form:

    struct {
        const sigset_t *ss;     /* Pointer to signal set */
        size_t          ss_len; /* Size (in bytes) of object pointed
    };

See man 2 pselect6.

Fixes #61251

Change-Id: Id0aa122a77796713bc6d624dc395d396fbc0c5e2
GitHub-Last-Rev: cb3c6d7da9
GitHub-Pull-Request: golang/sys#167
Reviewed-on: https://go-review.googlesource.com/c/sys/+/510195
Reviewed-by: Bryan Mills <bcmills@google.com>
Reviewed-by: Ian Lance Taylor <iant@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Run-TryBot: Ian Lance Taylor <iant@google.com>
Auto-Submit: Ian Lance Taylor <iant@google.com>
2023-07-19 00:01:56 +00:00
Tobias Klauser
a1a9c4b846 unix/linux: update to Linux kernel 6.4 and Go 1.21rc2
Also fix the glibc 2.37 release date in a comment.

Change-Id: Ibd972a2846f0085bacf67c847ce4726bf130d5ba
Reviewed-on: https://go-review.googlesource.com/c/sys/+/506017
TryBot-Result: Gopher Robot <gobot@golang.org>
Auto-Submit: Carlos Amedee <carlos@golang.org>
Reviewed-by: Ian Lance Taylor <iant@google.com>
Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com>
Reviewed-by: Carlos Amedee <carlos@golang.org>
2023-06-27 17:19:37 +00:00
Jordan Whited
d1abdad3a4 unix/linux: update TUN flags and virtio_net_hdr constants
TUN_F_USO{4,6} and VIRTIO_NET_HDR_GSO_UDP_L4 are new in Linux v6.2.

Change-Id: I7e3dc34118d1c03afeb87fb8699d8167a6e49b7f
GitHub-Last-Rev: c658b9bf0f
GitHub-Pull-Request: golang/sys#165
Reviewed-on: https://go-review.googlesource.com/c/sys/+/506455
Reviewed-by: Carlos Amedee <carlos@golang.org>
Auto-Submit: Carlos Amedee <carlos@golang.org>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Tobias Klauser <tobias.klauser@gmail.com>
Run-TryBot: Ian Lance Taylor <iant@golang.org>
Run-TryBot: Ian Lance Taylor <iant@google.com>
Reviewed-by: Ian Lance Taylor <iant@google.com>
Auto-Submit: Ian Lance Taylor <iant@google.com>
2023-06-27 15:33:31 +00:00
Tobias Klauser
ca096e46e8 unix: add missing IFLA_* consts on linux
Change-Id: Ib221d98f8d7e5aac7ff2db207cdd92145fe1dc60
Reviewed-on: https://go-review.googlesource.com/c/sys/+/503715
Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com>
Reviewed-by: Ian Lance Taylor <iant@google.com>
Auto-Submit: Tobias Klauser <tobias.klauser@gmail.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Bryan Mills <bcmills@google.com>
2023-06-16 18:27:27 +00:00
Tobias Klauser
df9fef2097 unix/linux: update to Linux kernel 6.3 and Go 1.20.5
Change-Id: I347341ae0e45e73477e9a310a3749d37bafa8da7
Reviewed-on: https://go-review.googlesource.com/c/sys/+/503255
Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com>
Reviewed-by: Ian Lance Taylor <iant@google.com>
Auto-Submit: Tobias Klauser <tobias.klauser@gmail.com>
Reviewed-by: Bryan Mills <bcmills@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
2023-06-16 18:27:25 +00:00
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
Dmitri Goutnik
2977c7732d unix: add ptracePtr that accepts pointer arg as unsafe.Pointer
The existing ptrace wrapper accepts pointer argument as an uintptr which
often points to the memory allocated in Go. This violates unsafe.Pointer safety
rules.

For golang/go#58387

Change-Id: Ib3b4c50368725191f0862c6c7c6d46b0568523c7
Reviewed-on: https://go-review.googlesource.com/c/sys/+/469835
Run-TryBot: Ian Lance Taylor <iant@google.com>
Reviewed-by: Bryan Mills <bcmills@google.com>
Run-TryBot: Bryan Mills <bcmills@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@google.com>
Auto-Submit: Ian Lance Taylor <iant@google.com>
2023-02-21 23:06:39 +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
chenguoqi
b829a39df5 unix/linux: update to gcc 13.0.0, qemu 7.1.0 for loong64
No changes in generated files.

Update loongarch64-linux-gcc to 13.0.0
- The kernel header file version is upgraded to 5.19

Update qemu-loongarch64 to 7.1.0
- Support for LoongArch has been merged upstream.

Change-Id: I637925fd9e5575dfb4ce91ece98951d5bf3053e6
Reviewed-on: https://go-review.googlesource.com/c/sys/+/453458
Run-TryBot: Ian Lance Taylor <iant@google.com>
Auto-Submit: Ian Lance Taylor <iant@google.com>
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>
2023-01-30 18:37:20 +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
Tobias Klauser
127c0dd26a unix/linux: use Go 1.20rc1 to generate files
Change-Id: I1bdf6c1d61a3a9835d2f6a7fd54b38a8a16efa16
Reviewed-on: https://go-review.googlesource.com/c/sys/+/456455
Reviewed-by: Than McIntosh <thanm@google.com>
Auto-Submit: Tobias Klauser <tobias.klauser@gmail.com>
Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@google.com>
2022-12-12 14:20:30 +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
Clayton Townsend II
e052cef7d3 unix/linux: run each mkall.go target in a seperate goroutine
Each target within mkall.go is now within a seperate goroutine,
except for making headers which have artifacts in their respective
folders that overlap and conflict during their make target.

Fixes golang/go#54009

Change-Id: I04dad7ffdb772029e62a34a1197577c718b533e1
Reviewed-on: https://go-review.googlesource.com/c/sys/+/419517
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
Reviewed-by: Ian Lance Taylor <iant@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Run-TryBot: Ian Lance Taylor <iant@google.com>
Auto-Submit: Dmitri Shuralyov <dmitshur@golang.org>
2022-08-04 18:27:31 +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
Tobias Klauser
e65921a090 unix/linux: use Go 1.19rc2 instead of building gotip
CL 399336 added support for generating linux/loong64 types and constants
and CL 406794 switched it to use gotip after support for linux/loong64
was merged. The upcoming Go 1.19 release will support that platform, so
switch to use 1.19rc2.

Change-Id: Id3be69eb8f04bdf215f248df09bb5da9456494e7
Reviewed-on: https://go-review.googlesource.com/c/sys/+/419395
Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Cherry Mui <cherryyz@google.com>
Reviewed-by: Ian Lance Taylor <iant@google.com>
2022-07-27 05:50:44 +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
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
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
Tobias Klauser
3f8b81556e unix/linux: update to Linux kernel 5.17
Change-Id: I8e982e355d6058198f5b555c2f33e18301872909
Reviewed-on: https://go-review.googlesource.com/c/sys/+/398435
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>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
2022-04-06 16:36:25 +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
Tobias Klauser
d36c6a25d8 unix/linux: update to Go 1.18
Change-Id: I663b4e6346cec4a51f4423a38cc1315c5b51956d
Reviewed-on: https://go-review.googlesource.com/c/sys/+/396114
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-03-28 11:51:05 +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
Tobias Klauser
f2425489ef unix/linux: update to Go 1.18rc1
The change in ztypes_linux_s390x.go is likely due to CL 350159.

Change-Id: Ib7080255f357d484ee708e128ac9a7ab408a6dc5
Reviewed-on: https://go-review.googlesource.com/c/sys/+/386955
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>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
2022-02-22 20:09:37 +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
Matt Layher
5739886226 unix: implement alarm(2) on Linux on all GOARCH except arm* and riscv.
SYS_ALARM is not defined for arm* or riscv, but is available for all other
Linux GOARCH values. Ian suggested I create a new file with build tags
matching these constraints.

In order to handle special case files such as this one (which don't match the
existing syscall_linux_goarch.go scheme), I've added logic to the Linux build
system which can evaluate the build constraints in a given file to determine
whether that file should be appended to the arguments for a given target.

Change-Id: I0136534522a26a0ce495308f63953546ea6bb8e5
Reviewed-on: https://go-review.googlesource.com/c/sys/+/383734
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Trust: Daniel Martí <mvdan@mvdan.cc>
2022-02-07 23:40:03 +00:00
Tobias Klauser
1c1b9b1eba unix/linux: update to glibc 2.35, Go 1.17.6
Change-Id: I90b7eee499d6ed6ea431d2c8539aae5afa25cfab
Reviewed-on: https://go-review.googlesource.com/c/sys/+/383134
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-02-04 13:58:22 +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
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