Tobias Klauser
3a27cdcbcf
unix: don't use deprecated sys/capability.h header on FreeBSD
...
sys/capability.h is deprecated, use sys/capsicum.h instead.
Change-Id: I05a3b8ff28d4df6536a3f10e0da7381b48329738
Reviewed-on: https://go-review.googlesource.com/c/147737
Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com >
TryBot-Result: Gobot Gobot <gobot@golang.org >
Reviewed-by: Ian Lance Taylor <iant@golang.org >
2018-11-06 13:43:33 +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
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
Tobias Klauser
b09afc3d57
unix: add MNT_* flags on OpenBSD
...
Now that all BSDs define MNT_NOWAIT, use it in TestGetfsstat instead of
the locally defined copy.
Change-Id: Ib6cee08a6d3a034464c7b79591605b49889a46ae
Reviewed-on: https://go-review.googlesource.com/137195
Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com >
TryBot-Result: Gobot Gobot <gobot@golang.org >
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org >
2018-09-25 11:27:36 +00:00
Tobias Klauser
f02c79500a
unix: add MNT_* flags on DragonflyBSD
...
Change-Id: I0326a7bfcf3cd794eb1158055a8ee98a396d3b47
Reviewed-on: https://go-review.googlesource.com/136818
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-24 17:12:10 +00:00
Tobias Klauser
c01370cb5c
unix: add MNT_* flags on NetBSD
...
Change-Id: Ifc720a583a830883908e83bfe0e2d74c2bfa013f
Reviewed-on: https://go-review.googlesource.com/136817
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-24 14:20:50 +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
Tony Reix
1561086e64
unix: add Termio, Winsize, Statfs_t, TC[GS]ET, Mkdir and Mknod for AIX
...
These changes add Termio/Winsize/Statfs_t for AIX, constants TC[GS]ET and the syscalls Mkdir and Mknod.
It also changes the comments for AIX which still were talking about Linux and glibc.
Change-Id: I64325330328d6e16cff540f103fdfa533b7d8f5b
Reviewed-on: https://go-review.googlesource.com/136295
Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com >
TryBot-Result: Gobot Gobot <gobot@golang.org >
Reviewed-by: Tobias Klauser <tobias.klauser@gmail.com >
2018-09-19 16:26:11 +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
Tony Reix
d99a578cf4
unix: code for AIX ppc and ppc64, for gccgo
...
Change-Id: I187edceaf3604d73110940bd5580fa127a85e87d
Reviewed-on: https://go-review.googlesource.com/129735
Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com >
TryBot-Result: Gobot Gobot <gobot@golang.org >
Reviewed-by: Tobias Klauser <tobias.klauser@gmail.com >
2018-08-28 06:51:06 +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
3b58ed4ad3
unix: add additional file mode bit constants from sys/stat.h on Solaris
...
Also generate the constants using mkerrors.sh instead of having to list
each of them manually in types_solaris.go
In order to avoid _*_MAGIC constants being generated, also adjust the
corresponding rule in mkerrors.sh
Change-Id: If9193b12c2a2ec3b509a324be78329fee35a240d
Reviewed-on: https://go-review.googlesource.com/130355
Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com >
TryBot-Result: Gobot Gobot <gobot@golang.org >
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org >
2018-08-21 14:08:42 +00:00
Tobias Klauser
1c9583448a
unix: add additional file mode bit constants from sys/stat.h on FreeBSD
...
Also generate the constants using mkerror.sh instead of having to list
each of them manually in types_freebsd.go
Change-Id: I00d38d0e528900be7c5afca05c8dc50ee7628b20
Reviewed-on: https://go-review.googlesource.com/129317
Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com >
TryBot-Result: Gobot Gobot <gobot@golang.org >
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org >
2018-08-16 05:55:13 +00:00
Tobias Klauser
871208d995
unix: add additional file mode bit constants from sys/stat.h on DragonflyBSD
...
Also generate the constants using mkerror.sh instead of having to list
each of them manually in types_dragonfly.go
Change-Id: I89b933834be6aa0eeec3d5ddbbf610e693b29327
Reviewed-on: https://go-review.googlesource.com/129316
Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com >
TryBot-Result: Gobot Gobot <gobot@golang.org >
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org >
2018-08-16 05:53:47 +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
f0d5e33068
unix: add *xattr functions on NetBSD
...
Reuse the functions added for FreeBSD.
Change-Id: Icf5bf65c82f91147659947f6ea296dd2555724a0
Reviewed-on: https://go-review.googlesource.com/128256
Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com >
TryBot-Result: Gobot Gobot <gobot@golang.org >
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org >
2018-08-10 07:02:07 +00:00
Tobias Klauser
57f5ac0287
unix: add additional file mode bit constants from sys/stat.h on OpenBSD
...
Also generate the constants using mkerror.sh instead of having to list
each of them manually in types_openbsd.go
Change-Id: I7750ae3cb1e923a13e0035d58d58a81c35e7e86b
Reviewed-on: https://go-review.googlesource.com/128775
Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com >
TryBot-Result: Gobot Gobot <gobot@golang.org >
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org >
2018-08-10 06:36:40 +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
Mark Pulford
34b17bdb43
unix: fix OpenBSD codegen to include F_OK
...
F_OK is used with access(2), but it was removed for openbsd/amd64 when
generated code was updated to OpenBSD 6.3 in 7f59abf3 .
Fixes golang/go#26593
Change-Id: I4a542506b1045f0c860bb3137c4d81149a5e1cae
Reviewed-on: https://go-review.googlesource.com/126635
Run-TryBot: Matt Layher <mdlayher@gmail.com >
TryBot-Result: Gobot Gobot <gobot@golang.org >
Reviewed-by: Matt Layher <mdlayher@gmail.com >
Reviewed-by: Tobias Klauser <tobias.klauser@gmail.com >
2018-08-06 08:24:29 +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
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
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
77b0e43150
unix: add symlink-safe *xattr functions on darwin
...
Updates golang/go#14456
Change-Id: I04632ef1d302e938a2cc373eb90f600f01404380
Reviewed-on: https://go-review.googlesource.com/114198
Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com >
TryBot-Result: Gobot Gobot <gobot@golang.org >
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org >
2018-05-23 21:11:48 +00:00
Tobias Klauser
89da893103
unix: exclude AUDIT_RECORD_MAGIC constant on darwin
...
CL 112696 changed mkerrors.sh to add filesystem magic constants on
linux. This leads to the unrelated AUDIT_RECORD_MAGIC constant being
added on darwin. Avoid this by explicity excluding it in mkerrors.sh.
Change-Id: I5a73797e5e9a1a92cb39f96f360fdb48982a7741
Reviewed-on: https://go-review.googlesource.com/114095
Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com >
TryBot-Result: Gobot Gobot <gobot@golang.org >
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org >
2018-05-22 13:13:21 +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
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
Matt Layher
b9cf5f96b6
unix: add cgroupstats type and constants
...
The cgroupstats structure is available via Linux's generic netlink
taskstats interface.
For more information, please see:
https://www.kernel.org/doc/Documentation/accounting/cgroupstats.txt .
Fixes golang/go#23388 .
Change-Id: I8a05a3875209e99a427d54049eacc98f415e44cf
Reviewed-on: https://go-review.googlesource.com/86975
Run-TryBot: Matt Layher <mdlayher@gmail.com >
TryBot-Result: Gobot Gobot <gobot@golang.org >
Reviewed-by: Tobias Klauser <tobias.klauser@gmail.com >
2018-01-09 18:07:26 +00:00
Tobias Klauser
665f6529cc
unix: add Uname on Darwin
...
Darwin doesn't have a uname syscall but the same information can be
retrieved using sysctls. Use the raw sysctl numbers instead of doing the
roundtrip via SysctlString in order to void the additional sysctl calls
in nametomib and SysctlRaw.
This implementation follows the one in
https://opensource.apple.com/source/Libc/Libc-1244.1.7/gen/uname.c
Change-Id: I19541e2a6700f84ced0549a8fb86faa8cb5e6fbe
Reviewed-on: https://go-review.googlesource.com/77270
Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com >
TryBot-Result: Gobot Gobot <gobot@golang.org >
Reviewed-by: Ian Lance Taylor <iant@golang.org >
2017-11-13 20:21:12 +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
46eaec7899
unix: use setattrlist for UtimesNanoAt on Darwin
...
Use to setarrlist to implement UtimesNanoAt with nanosecond precision
(on Mac OS 10.13 with APFS). Translate AT_SYMLINK_NOFOLLOW to
FSOPT_NOFOLLOW correspondingly.
Change-Id: I1468a1f4eecb53b2280ff6329b1ec64e204701f1
Reviewed-on: https://go-review.googlesource.com/75650
Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com >
TryBot-Result: Gobot Gobot <gobot@golang.org >
Reviewed-by: Ian Lance Taylor <iant@golang.org >
2017-11-02 21:26:49 +00:00
Tobias Klauser
feaf45c67f
unix: use setattrlist for UtimesNano on Darwin for ns resolution
...
Follow CL 74952 for x/sys/unix.
Update golang/go#22528
Change-Id: Id146da75b80a64cfa4eac28e9bb7b3befe944718
Reviewed-on: https://go-review.googlesource.com/75610
Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com >
TryBot-Result: Gobot Gobot <gobot@golang.org >
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org >
2017-11-02 20:14:56 +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
Tobias Klauser
43eea11bc9
unix: add MNT_* flags on FreeBSD
...
Add the MNT_* flags to be used e.g. with Getfsstat on FreeBSD.
Change-Id: I1afb50f715f447f85b4ece3d3fead8b9ce79c4f6
Reviewed-on: https://go-review.googlesource.com/70250
Reviewed-by: Matt Layher <mdlayher@gmail.com >
Run-TryBot: Matt Layher <mdlayher@gmail.com >
TryBot-Result: Gobot Gobot <gobot@golang.org >
2017-10-12 16:43:49 +00:00
Tobias Klauser
1f337fdb7f
unix: add Major, Minor and Mkdev functions on Solaris
...
Add Major, Minor and Mkdev functions for converting device numbers to
their major/minor components and vice versa.
Use the respective functions provided by the Solaris libc instead of
reimplementing them.
Test the conversion function with some well-known static device numbers
for devices which should be present on any Solaris system.
Re-generated files on OpenIndiana Hipster 2017.04 (SunOS 5.11) which
also added some previously missing error constants.
Change-Id: Ief9ea973d91c24956571eb8fafc8a4525b0f5b90
Reviewed-on: https://go-review.googlesource.com/64390
Reviewed-by: Ian Lance Taylor <iant@golang.org >
2017-09-18 21:40:44 +00:00
Joe Richey joerichey@google.com
9aade4d3a3
unix: Fix mkerrors.sh to do comparison correctly
...
Bash should use "=" not "-eq" for equality comparison.
Some incorrect comparison operators were missed in:
https://go-review.googlesource.com/c/sys/+/41832
Change-Id: I110968287b7370870301b2fdd2a4ec188f623a39
Reviewed-on: https://go-review.googlesource.com/61770
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org >
2017-09-06 00:00:21 +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
f1e7f7a8ac
unix: add MNT_* constants on Darwin
...
Add the MNT_* constants used for the Mount and Umount functions on
Darwin.
Generated on Mac OS 10.11 (Darwin 15.6.0). This also brings
zerrors_darwin_{arm,arm64} up to date with constants which are already
present for 386 and amd64.
Fixes golang/go#9891
Change-Id: Id77847a2fb805a759aa0f5b36e8954b764e699a5
Reviewed-on: https://go-review.googlesource.com/54210
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org >
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org >
TryBot-Result: Gobot Gobot <gobot@golang.org >
2017-08-09 13:30:23 +00:00
Ben Laurie
7a4fde3fda
unix: add some FreeBSD Capsicum support.
...
Change-Id: Ibb1426ebd18d27ee9f144af0fd8c94b08c06f7d7
Reviewed-on: https://go-review.googlesource.com/47290
Reviewed-by: Ian Lance Taylor <iant@golang.org >
Run-TryBot: Ian Lance Taylor <iant@golang.org >
TryBot-Result: Gobot Gobot <gobot@golang.org >
2017-07-19 20:48:12 +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