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

99 Коммитов

Автор SHA1 Сообщение Дата
Tobias Klauser f81de40a84 unix: add KexecFileLoad on linux/{amd64,ppc64x,s390x}
Add a wrapper for the kexec_file_load syscall on the architectures that
implement it (amd64, ppc64x, s390x). See
http://man7.org/linux/man-pages/man2/kexec_file_load.2.html

Change-Id: Ie29f871902176610a6ba7ed0a7bcc95c10eb172b
Reviewed-on: https://go-review.googlesource.com/c/140037
Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
2018-10-05 13:07:39 +00:00
Matt Layher d47a0f3392 unix: implement Linux AF_XDP sockets
Provides access to the Linux AF_XDP socket family.  For more
information on AF_XDP, see:
https://www.kernel.org/doc/html/latest/networking/af_xdp.html.

Change-Id: I7efb82c4a67da3e15932e3c0d882f0bad7ba16ef
Reviewed-on: https://go-review.googlesource.com/136695
Run-TryBot: Matt Layher <mdlayher@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Tobias Klauser <tobias.klauser@gmail.com>
2018-09-21 16:39:48 +00:00
Tobias Klauser ee1b12c67a unix: add MemfdCreate on Linux
Add a wrapper for the memfd_create syscall on Linux. See
http://man7.org/linux/man-pages/man2/memfd_create.2.html for more
information.

Also add the corresponding MFD_* constants to be used in the flags
argument.

Change-Id: Ib30a007e15575a38ecf204601ffede9c913799b6
Reviewed-on: https://go-review.googlesource.com/135915
Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
2018-09-18 15:37:33 +00:00
Tobias Klauser ebe1bf3edb unix: add SYNC_FILE_RANGE_* constants on Linux
These are usefule to specify SyncFileRange's flags argument.

Change-Id: I1726c3adf55aaebac61beed09d39a48a8e040a93
Reviewed-on: https://go-review.googlesource.com/133475
Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2018-09-05 08:04:54 +00:00
Tobias Klauser 4910a1d54f unix: add UBI ioctl constants on Linux
Change-Id: Icde91c6504cd45d78208c6041bf6dc097d2d8334
Reviewed-on: https://go-review.googlesource.com/131235
Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
2018-08-24 14:33:01 +00:00
Tobias Klauser 4e1fef5609 unix: update Dockerfile to Linux 4.18, glibc 2.28 and Go 1.11beta3
Including linux/stat.h in mkerrors.sh is no longer necessary because the
statx types and constants were added to the glibc headers.

Change-Id: I643c35fd2da76dd2c15015556658d7fa862249c4
Reviewed-on: https://go-review.googlesource.com/129100
Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2018-08-14 07:20:32 +00:00
Tobias Klauser 2be389f392 unix: add Renameat2 on Linux
Renameat2 is Linux-specific and allows to pass an additional flags
argument to the renameat syscall. Also add the corresponding RENAME_*
flag mask values.

Change-Id: Ib4baa46fdd0b07ccd0988ac624862ce69d5c3ad5
Reviewed-on: https://go-review.googlesource.com/127763
Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2018-08-06 19:25:00 +00:00
Casey Callendrello 3dc4335d56 unix: add Linux network namespace constants
This adds the NETNSA constants from net_namespace.h, used for creating
and querying network namespace IDs.

Fixes golang/go#26330
Change-Id: I786c4c4771be3eddc4fdb830a52e128aa1a2b9fd
Reviewed-on: https://go-review.googlesource.com/124436
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
2018-08-01 22:11:39 +00:00
Tobias Klauser 9e6071e1da unix: follow convention for generated code comment
Follow the convertion (https://golang.org/s/generatedcode) for generated
code.

Change-Id: I27899b24366d5c0d2c5574b5eaf3d7e0babc8909
Reviewed-on: https://go-review.googlesource.com/118820
Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2018-06-14 13:37:17 +00:00
Michael Stapelberg 56ede360ec unix: add rtc defines and types
Change-Id: I280fc3b2cd3402c40f2840d152bac2fa288f48a0
Reviewed-on: https://go-review.googlesource.com/118661
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
2018-06-13 17:11:35 +00:00
Matt Layher a9e25c09b9 unix: update Dockerfile to Ubuntu 18.04, Linux 4.17, and Go 1.10.3
The code has been regenerated using the updated software versions.

Change-Id: Ic2af968d4d8cbf3ab31e5bca1d6640642eb7115a
Reviewed-on: https://go-review.googlesource.com/118255
Run-TryBot: Matt Layher <mdlayher@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Tobias Klauser <tobias.klauser@gmail.com>
2018-06-12 14:22:14 +00:00
Michael Stapelberg 31355384c8 unix: add nftables defines and types
Change-Id: I55efe06ec81e891ec3872405ba75c7eb9ce4e635
Reviewed-on: https://go-review.googlesource.com/114518
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Reviewed-by: Tobias Klauser <tobias.klauser@gmail.com>
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
2018-05-25 06:20:15 +00:00
Tobias Klauser 7c87d13f8e unix: add tpacket types and constants on Linux
Change-Id: I4f2fd8a7c899403f545d8dc73fec2ebbb0b322c0
Reviewed-on: https://go-review.googlesource.com/113035
Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
2018-05-14 14:36:08 +00:00
Tobias Klauser 9950ad118b unix: add statfs and filesystem magic constants on Linux
Fixes golang/go#25341

Change-Id: I79cb4c77b771e005eb27d4e495ac6a7491e2e66e
Reviewed-on: https://go-review.googlesource.com/112696
Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2018-05-11 13:39:06 +00:00
Tobias Klauser 6f686a352d unix: add ErrnoName and SignalName
Add ErrnoName and SignalName to get errno and signal name strings from
syscall.Errno and syscall.Signal values, respectively.

This repurposes the errors and signals vars (because they are not used
within x/sys/unix currently) and turns them into slices of struct,
containing errno/signal number, name and description. ErrnoName and
SignalName can then be trivially implemented using sort.Search.

Renaming errors to errorList additionaly allows to avoid package aliases
for the errors package.

Fixes golang/go#25134

Change-Id: Ie195872793f44c437f0f175ccfaa13a2546338c5
Reviewed-on: https://go-review.googlesource.com/110875
Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
2018-05-04 06:42:12 +00:00
Matt Layher 79b0c68887 unix: add Linux block device ioctl types and constants
These types and constants are taken from hdreg.h, and will enable
querying and manipulation of block devices on Linux.

Fixes golang/go#24971

Change-Id: Iafe8f81ba7ab9f1e127743dab6a9fb1912874a5c
Reviewed-on: https://go-review.googlesource.com/108455
Run-TryBot: Matt Layher <mdlayher@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Tobias Klauser <tobias.klauser@gmail.com>
2018-04-20 14:53:19 +00:00
Tobias Klauser 3b87a42e50 unix: update Dockerfile to Linux 4.16 and Go 1.10.1
Also avoid installing recommended packages if possible to silightly
reduce the Docker image size.

Change-Id: I7a3ea33f6501cf063b1aa0324b5928f96241d048
Reviewed-on: https://go-review.googlesource.com/105077
Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2018-04-06 13:57:29 +00:00
Tobias Klauser c1138c84af unix: update to Linux 4.15, glibc 2.27 and Go 1.10
Also use the Ubuntu 17.10 docker image and additionally install bison
which is needed by the glibc build.

The resulting change only consists of a few additional constants.
Exclude the X86_CR3_PCID_NOFLUSH constant on 386 and amd64, though.

Change-Id: I0a9b8959146273ff3b259c17bb616625a9ac8278
Reviewed-on: https://go-review.googlesource.com/96255
Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
2018-02-22 21:03:05 +00:00
Tobias Klauser fff93fa7cd unix: add Statx on Linux
statx(2) allows to get enhanced file status information (not currently
available through the existing stat syscalls), lightweight stat,
heavyweight stat. The Statx_t type used by Statx has consistent field
sizes on all arches (with year-2038-capable timestamps) and is closer to
the BSD implementation of Stat_t.

See http://man7.org/linux/man-pages/man2/statx.2.html for details. The
syscall was added in Linux kernel 4.11.

See https://github.com/tklauser/statx for an example of how this
function and types can be used to report stat(1)-like file status
information.

Change-Id: I9e9642b5b42a393f94fd532453888ce9ba4f0003
Reviewed-on: https://go-review.googlesource.com/87555
Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
2018-01-15 08:58:44 +00:00
Tobias Klauser a22539bf85 unix: add vmsockets ioctl constant on Linux
To be used e.g. in github.com/mdlayher/vsock

Change-Id: I52148a6e6c53c022c07e2cc8bf7348a96445c17b
Reviewed-on: https://go-review.googlesource.com/76193
Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Matt Layher <mdlayher@gmail.com>
2017-11-07 15:03:14 +00:00
Tobias Klauser 52c393dd0c unix: update Dockerfile to go 1.9.2
Update go to 1.9.2 in the Dockerfile used to generate the Linux go files.

The update also changes some zerror definitions: RLIM_INFINITY is
assigned to Rlimit.{Cur,Max} which are both uint64 on all architectures.
PR_SET_PTRACER_ANY is used with Prctl which expects an uintptr.

With the current version, an "constant -1 overflows uint64" error would
result if these constants were used directly without type conversion.

Change-Id: Iefd23a44e983b4fcf210121776531df225014112
Reviewed-on: https://go-review.googlesource.com/73873
Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
2017-10-27 13:58:47 +00:00
Michael Stapelberg a57a2b53a1 unix: add watchdog constants on Linux
To be used e.g. in
2e60d5b8c8

Change-Id: If79ffec9021dc79375c861a0ddd9dd443adb4692
Reviewed-on: https://go-review.googlesource.com/72375
Reviewed-by: Tobias Klauser <tobias.klauser@gmail.com>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
2017-10-23 17:49:30 +00:00
Tobias Klauser ff8cd6cb4f unix: add UTIME_* constants on Linux
They might be used as special values in struct Timespec. See
http://man7.org/linux/man-pages/man2/utimensat.2.html for details.

Change-Id: I1c2d6d7731ca7f077d033e51ee6421a4f2cfbb89
Reviewed-on: https://go-review.googlesource.com/72376
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
2017-10-23 17:48:59 +00:00
Joe Richey joerichey@google.com 31e1fafe95 unix: update Linux to v4.13 kernel and v2.26 glibc
This change updates the Linux symbols to correspond to v4.13 of the
kernel and v2.26 of glibc. To get everything building correctly, newer
versions of the build tools are required. Instead of trying to get an
Ubuntu 17.10 docker image working, we just add Artful sources to
/etc/apt/sources.list to get a similar effect.

Now that the kernel UAPI is updated, FS_MAX_KEY_SIZE and fscrypt_key no
longer need to be manually declared, as they are now in the proper
kernel headers.

Change-Id: I5f14c99fd70b43dbb8b44e05f53e4e9f09c9a345
Reviewed-on: https://go-review.googlesource.com/61771
Reviewed-by: Ian Lance Taylor <iant@golang.org>
2017-09-07 22:07:22 +00:00
Matt Layher ab9e364efd unix: add generic netlink types and constants on Linux
Generic netlink is a generalized netlink family which enables a series
of different communication channels to be multiplexed on a single
netlink family.

For more information, please see: https://lwn.net/Articles/208755/.

Fixes golang/go#21682.

Change-Id: I2095150e06471f4a0e1322fba669573aa8f0a9b1
Reviewed-on: https://go-review.googlesource.com/59931
Run-TryBot: Matt Layher <mdlayher@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
2017-08-29 18:59:17 +00:00
Matt Layher 22e23b7432 unix: add taskstats type and constants on Linux
Taskstats is a netlink-based interface for sending per-task and
per-process statistics from the kernel to userspace.

For more information, please see:
https://www.kernel.org/doc/Documentation/accounting/taskstats.txt.

Fixes golang/go#21616.

Change-Id: I7d4b8035aa8e993074d61911d9a8c3a3e61c9b2e
Reviewed-on: https://go-review.googlesource.com/59050
Run-TryBot: Matt Layher <mdlayher@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
2017-08-25 17:12:00 +00:00
Tobias Klauser abf9c25f54 unix: add additional socket ioctl constants on Linux
Add additional SIOC* socket ioctl constants from linux/sockios.h on
Linux.

Change-Id: I76f8c9d9d0015d398ee52844b3c9f506cd182329
Reviewed-on: https://go-review.googlesource.com/47950
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
2017-07-10 16:16:58 +00:00
Tobias Klauser 739734461d unix: add perf event ioctl constants on Linux
Add the PERF_EVENT_IOC_* constants on Linux which are used to
enable/disable/configure perf events. Also add the PERF_IOC_FLAG_GROUP
constant which might be using as part of the ioct argument. See section
"perf_event ioctl calls" in
http://man7.org/linux/man-pages/man2/perf_event_open.2.html

Change-Id: I92fb8f6ef5cc53711f00db566d8e277cdf1cd607
Reviewed-on: https://go-review.googlesource.com/47770
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
2017-07-07 16:14:08 +00:00
Tobias Klauser 90796e5a05 unix: add UMOUNT_NOFOLLOW constant
Add the UMOUNT_NOFOLLOW on Linux, available since Linux 2.6.34. See
http://man7.org/linux/man-pages/man2/umount.2.html and
https://github.com/torvalds/linux/commit/db1f05bb85d796

Fixes golang/go#18316

Change-Id: I5c7dafdbb311f287b6cf290aa8a0eaf2940b9834
Reviewed-on: https://go-review.googlesource.com/46771
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
2017-06-27 16:08:55 +00:00
Tobias Klauser 50298aa7a9 unix: add seccomp mode constants
Add the SECCOMP_MODE_DISABLED, SECCOMP_MODE_STRICT and
SECCOMP_MODE_FILTER constants to be used with the PR_SET_SECCOMP prctl.
See http://man7.org/linux/man-pages/man2/prctl.2.html

Change-Id: Iacd1ffaeced4ae95e780a09038d35b763778a3d3
Reviewed-on: https://go-review.googlesource.com/46691
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2017-06-26 17:54:06 +00:00
Tobias Klauser 8d3b82dc77 unix: add Setxattr constants
Add the XATTR_CREATE and XATTR_REPLACE constants, to be used in the
flags parameter of Setxattr/Lsetxattr. See
http://man7.org/linux/man-pages/man2/setxattr.2.html

Fixes golang/go#14454

Change-Id: I868ac019fe3be755e0f6f8bff734f843ba602ee9
Reviewed-on: https://go-review.googlesource.com/46690
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2017-06-26 16:26:13 +00:00
Tobias Klauser 0b25a408a5 unix: add Eventfd function on Linux
Add support for the eventfd2 syscall on Linux.

Use the eventfd2 syscall instead of eventfd, as the latter does not
provide a flags argument and glibc also maps its eventfd() function to
the eventfd2 syscall, see the Notes section in
http://man7.org/linux/man-pages/man2/eventfd.2.html

Also add the corresponding flags values EFD_CLOEXEC, EFD_NONBLOCK and
EFD_SEMAPHORE.

Change-Id: Ia8c99e68d5966ab5c7ebe7e45423943fd7d8214e
Reviewed-on: https://go-review.googlesource.com/45093
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
2017-06-08 16:48:03 +00:00
Tobias Klauser b9e8d468b0 unix: add additional rlimit resource constants
Add the following additional Getrlimit/Setrlimit resource constants (see
http://man7.org/linux/man-pages/man2/getrlimit.2.html):

  RLIMIT_LOCKS
  RLIMIT_MEMLOCK
  RLIMIT_MSGQUEUE
  RLIMIT_NICE
  RLIMIT_NPROC
  RLIMIT_RSS
  RLIMIT_RTPRIO
  RLIMIT_RTTIME
  RLIMIT_SIGPENDING

Fixes golang/go#14854

Change-Id: I302ff67d6d1b11d94f18614490fbd634a8caec19
Reviewed-on: https://go-review.googlesource.com/45052
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
2017-06-07 14:18:10 +00:00
Joe Richey joerichey@google.com a2e06a18b0 unix: add bindings for keyutils syscalls
This CL adds support for the ADD_KEY, REQUESET_KEY, and KEYCTL syscalls.
These syscalls allow access to the kernel keyring facilities. In C code,
these syscalls are wrapped by the libkeyutils package. See:
	http://man7.org/linux/man-pages/man7/keyutils.7.html

The ADD_KEY and REQUEST_KEY calls are fairly straightforward, but the
KEYCTL syscall is a multiplexor for a number of key management
functions. See:
	http://man7.org/linux/man-pages/man3/keyctl.3.html

The Go bindings for the KEYCTL functions attempt to replicate what
libkeyutils does. This is done via generated helper functions.

Change-Id: If8c97d4ef5bce14c43dee3e6772ded42dc3c595a
Reviewed-on: https://go-review.googlesource.com/41415
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
2017-05-18 22:39:15 +00:00
joerichey@google.com 8c0a5eacba unix: add support for Linux filesystem encryption
This CL adds in the necessary types and constants to support Linux
filesystem encryption. This includes the structs for the keys and
polices as well as the constants for key size and encryption algorithms.

This code also reduces the scope of some of the regexes in mkerrors.sh.
This is to reduce the number of unrelated constants added in with this
change.

Note that due to a bug in the Linux uapi headers, not all of the
necessary constants and structures are declared in linux/fs.h despite
being part of the kernel ABI. This means that some constants and types
had to be manually added in.

The bug has been patched (https://patchwork.kernel.org/patch/9662723),
and the manual additions can be removed when the patch is merged into
the mainline kernel.

Change-Id: Ib508ad99bdf4c0068933ffcf351c52bb359cfcf4
Reviewed-on: https://go-review.googlesource.com/41417
Reviewed-by: Matt Layher <mdlayher@gmail.com>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Run-TryBot: Matt Layher <mdlayher@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
2017-04-24 22:03:05 +00:00
Joe Richey ea9bcade75 unix: generate all Linux go files from source
Right now the process for adding in new constants, errors, or syscalls
for Linux is a pain and unreliable. The scripts are designed to be run
on the target architecture and use the header files installed on the
user's system. This makes it hard to generate files for all the
architectures or to have consistency between users. See golang/go#15282.

This CL fixes this issue by making all of the files for the 11 supported
architectures directly from source checkouts of Linux, glibc, and bluez.
This is done using Docker, the gcc cross-compilers, and qemu emulation.
Previously discussed here:
    https://go-review.googlesource.com/c/37589/

A README.md file is also added to explain how all the parts of the build
system work.

In order to get the build working for all the architectures, I made
some changes to the other scripts called from mkall_linux.go:
  - Files only used for generating linux code, moved to linux/
  - linux/mksysnum.pl supports a specified CC compiler.
  - The generated C code in mkerrors.sh changed to avoid a warning
  - mkerrors.sh headers changed to fix powerpc64 bug in sys/ioctl.h
  - linux/types.go no longer needs to export Ptrace structs in lowercase

Build instructions:
  - Host system needs to be x86-64 Linux
  - Install Docker (https://docs.docker.com/engine/installation/)
  - ./mkall.sh (That's it!!!)

Change-Id: I87067c14442ba12f8d51991349a43a9d73f38ae0
Reviewed-on: https://go-review.googlesource.com/37943
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
2017-04-21 00:52:44 +00:00
Matt Layher d67a3279ae unix: implement Linux AF_VSOCK sockets
Adds the required constants and new SockaddrVM type for working
with Linux VM sockets.  For more information, see:
https://vmsplice.net/~stefan/stefanha-kvm-forum-2015.pdf.

Fixes golang/go#19434

Change-Id: I9aefb35441b2c7dc412bdfb806ebe08d5c20f6b1
Reviewed-on: https://go-review.googlesource.com/37937
Run-TryBot: Matt Layher <mdlayher@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
2017-03-08 01:50:38 +00:00
Michael Stapelberg e48874b424 unix: add BLK* Linux ioctls
These are useful for re-reading partition tables and getting device
sizes.

Fixes golang/go#19370

Change-Id: Ia8dbe3416a48dbdbceafa0fff0131d71057d97ca
Reviewed-on: https://go-review.googlesource.com/37640
Reviewed-by: Ian Lance Taylor <iant@golang.org>
2017-03-03 13:59:30 +00:00
Joe Richey 76cc09b634 unix: add Getrandom syscall bindings and flags
This CL introduces the Getrandom syscall. Allowing users of
sufficiently new kernels (3.17) to detect when the operating system
lacks enough entropy to generate cryptographic random data. See:
http://man7.org/linux/man-pages/man2/getrandom.2.html

As we have updated the syscall numbers, the Getrandom function can
just be generated normally. The only other change is to mkerrors.sh
to include the GRND_* flags for getrandom from <linux/random.h>.

It is important to note that currently the mkerrors.sh script cannot
actually be run as it has fallen behind the 4.10 kernel. The GRND_*
flags were added manually.

This was originally part of a larger commit that was split up.
See CL: https://go-review.googlesource.com/37570

Change-Id: I464088a9c9f7224abdcdae476b30a4f2f412d9f5
Reviewed-on: https://go-review.googlesource.com/37589
Reviewed-by: Matt Layher <mdlayher@gmail.com>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Run-TryBot: Matt Layher <mdlayher@gmail.com>
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
2017-03-01 01:59:58 +00:00
Matt Layher e4594059fe unix: add missing netlink constants on Linux
Fixes golang/go#19262

Change-Id: I67ceb187cd68e90a9387a706a89aafded0befe53
Reviewed-on: https://go-review.googlesource.com/37344
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
Run-TryBot: Matt Layher <mdlayher@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
2017-02-23 22:51:00 +00:00
Matt Layher 075e574b89 unix: implement Vmsplice, add SPLICE_F_* constants
Fixes golang/go#19125

Change-Id: I822b6f260f980178da29a552c6170cb261c8e254
Reviewed-on: https://go-review.googlesource.com/37152
Run-TryBot: Matt Layher <mdlayher@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
2017-02-17 00:34:42 +00:00
Matt Layher e24f485414 unix: add support for AF_ALG sockets on Linux
Fixes golang/go#19033.

Change-Id: Icbd249f63cd4a9035a1decaa8bf4c521303b4494
Reviewed-on: https://go-review.googlesource.com/36805
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2017-02-13 22:57:39 +00:00
Maxime de Roucy ce7380f5b0 x/sys/unix: add fallocate constants
Add FALLOC_* constants from /usr/include/linux/falloc.h to use with
Fallocate (golang.org/x/sys/unix package).

Fix golang/go#10599

Change-Id: Ie001e554250bb12472c612adcb4b79c6f72cac34
Reviewed-on: https://go-review.googlesource.com/36336
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2017-02-13 20:02:47 +00:00
Elliot Morrison-Reed 30237cf4ee x/sys/unix: added SockaddrCAN struct to allow creation of AF_CAN sockets
Fixes golang/go#16188

Change-Id: I396ccbf6ce14147bc03ecdf180c2657c22b477b4
Reviewed-on: https://go-review.googlesource.com/33392
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
2016-11-22 21:48:34 +00:00
Jess Frazelle b44883b474 unix: add CLONE_NEWCGROUP for linux kernel >=4.6
Change-Id: I827a97ad2b43f9b33281d0da36fe4cfdf24b928f
Reviewed-on: https://go-review.googlesource.com/23965
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
2016-06-10 01:22:07 +00:00
Nick Patavalis 7486f8ece0 unix: additional termios-related constants
- mkerrors.sh: Included several termios-related constants that were
  missing. Also included definitions of tty-related ioctl numbers for
  linux.

- zerrors_linux_*: the files have been generated using
  "./mkerrors.sh". After their automatic generation the files have
  been manually edited to remove changes that were not due to this
  patch.

Change-Id: I0463112542a5c1c41583007003b652375f9ce572
Reviewed-on: https://go-review.googlesource.com/17184
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2015-11-23 20:52:33 +00:00
Shenghou Ma 379497e3ff unix: add explicit build tags
Change-Id: I62774b8ee0c1a7cc1a3b7009ca860e3fd64a6564
Signed-off-by: Shenghou Ma <minux@golang.org>
Reviewed-on: https://go-review.googlesource.com/10182
Reviewed-by: Rob Pike <r@golang.org>
2015-05-18 19:15:57 +00:00
Ian Lance Taylor 8bcc2dbee4 unix: add arm64 and ppc64le build tags as needed for Go 1.4
Go1.4 does not recognize arm64 and ppc64le as valid GOARCH values, so
we need explicit build tags.

Change-Id: I1a886c132ae398d9f92b2c2b33d2a4827bbdb9d4
Reviewed-on: https://go-review.googlesource.com/10083
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2015-05-14 20:02:06 +00:00
Ian Lance Taylor 9907ecf448 unix: add arm64/linux support
This incorporates generation script changes from
http://golang.org/cl/7143.

Files generated on Ubuntu Trusty.

Change-Id: I28cfa0993573e1b280c549a67f453c0fb01dee2f
Reviewed-on: https://go-review.googlesource.com/10038
Reviewed-by: Rob Pike <r@golang.org>
2015-05-13 23:16:16 +00:00