Commit Graph

904 Commits

Author SHA1 Message Date
Tobias Klauser
5c8b2ff675 unix: update BPF consts on linux
Update the BPF_* consts from include/uapi/linux/bpf.h as of Linux 5.5.

Change-Id: I5098fc9e4fc1fb3e6cc2e2f85a8e65b369b6a81c
Reviewed-on: https://go-review.googlesource.com/c/sys/+/221797
Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Matt Layher <mdlayher@gmail.com>
2020-03-02 15:01:41 +00:00
Tobias Klauser
062a44052d cpu: add mips64x feature detection
Follow CL 200579

Change-Id: Ibedd6569bda3d7836ccb77a7746ed0e5df13c633
Reviewed-on: https://go-review.googlesource.com/c/sys/+/221698
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-02 08:32:56 +00:00
Johan Jansson
5d559ad92b unix: merge duplicate code in ztypes_linux_*.go
Run mkmerge.go on ztypes_linux_*.go to merge duplicate consts, funcs,
and types into ztypes_linux.go

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

Fixes golang/go#33059

Change-Id: Ic272869fed6bf6bbf3018d3919ae5a6b6bc15bbb
Reviewed-on: https://go-review.googlesource.com/c/sys/+/221320
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 20:44:00 +00:00
Johan Jansson
2f85c7ec1e unix: merge duplicate code in zsyscall_linux_*.go
Run mkmerge.go on zsyscall_linux_*.go to merge duplicate consts, funcs,
and types into zsyscall_linux.go

Also, run mkmerge.go on zsysnum_linux_*.go; currently there is nothing
to merge.

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

Updates golang/go#33059

Change-Id: I715ada044ee957475669d94b16de059ebb9162d1
Reviewed-on: https://go-review.googlesource.com/c/sys/+/221319
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 15:39:31 +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
Johan Jansson
6b2465a022 unix: add tool for merging duplicate code
mkmerge.go parses generated code (z*_GOOS_GOARCH.go) and merges
duplicate consts, funcs, and types, into one file per GOOS (z*_GOOS.go).

Updates golang/go#33059

Change-Id: I1439f260dc8c09e887e5917a3101c39b080f2882
Reviewed-on: https://go-review.googlesource.com/c/sys/+/221317
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 02:57:34 +00:00
Nikson Kanti Paul
d5e6a3e2c0 unix: add adjtimex return constants
Fixes golang/go#37234

Change-Id: I6deda79bc0b8f34c7bb210b64adabbfff5fe675e
Reviewed-on: https://go-review.googlesource.com/c/sys/+/219697
Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Tobias Klauser <tobias.klauser@gmail.com>
2020-02-23 17:06:10 +00:00
Caleb Spare
cb0a6d8edb unix: mark capget/capset as non-blocking
Change-Id: Ifd3a1ab6f6ec9136e77440a484f933dc243f645d
Reviewed-on: https://go-review.googlesource.com/c/sys/+/219940
Run-TryBot: Caleb Spare <cespare@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Reviewed-by: Tobias Klauser <tobias.klauser@gmail.com>
2020-02-19 09:19:48 +00:00
Tobias Klauser
9197077df8 unix: gofmt after CL 218799
CL 218799 wasn't properly gofmt'ed. Also move InotifyInit before Poll so
it matches the position in other syscall_linux_*.go files which
implement InotifyInit using InotifyInit1 (e.g. arm64).

Change-Id: If517ea2450c83ce39919992193592609f7e1e478
Reviewed-on: https://go-review.googlesource.com/c/sys/+/219798
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:22 +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
Doorer
12a6c2dcc1 unix: add InotifyInit for mips64
Change-Id: If58ee4692cd7b22c293556fc320fb013cdb78bb6
GitHub-Last-Rev: 2b5b171559
GitHub-Pull-Request: golang/sys#58
Reviewed-on: https://go-review.googlesource.com/c/sys/+/218799
Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Tobias Klauser <tobias.klauser@gmail.com>
2020-02-12 09:16:48 +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
Aaron Bieber
9fbb57f87d unix: use pipe2 syscall on OpenBSD
pipe2 has been available on OpenBSD for some time, all currently
supported versions of OpenBSD have an implementataion of it.

Change-Id: I740da07139541084f99a4fa4efcf67a591eed9e5
Reviewed-on: https://go-review.googlesource.com/c/sys/+/216244
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
2020-01-24 20:44:21 +00:00
Sergey Ivanov
e047566fdf unix: add new setfsuid/setfsgid wrappers
Added SetfsgidRetGid and SetfsuidRetUid wrappers for corresponding
syscalls, both returning previous gid or uid set.

Fixes golang/go#36649

Change-Id: I95176f4442258ca68db79cf967fbf0bbf0a57acf
Reviewed-on: https://go-review.googlesource.com/c/sys/+/215579
Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Tobias Klauser <tobias.klauser@gmail.com>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
2020-01-22 13:43:26 +00:00
Tobias Klauser
34d275377b unix: correct PtraceIoDesc and define PtraceIoDesc per GOARCH on freebsd
CL 179099 introduced ptrace support for freebsd but it seems the
PtraceIoDesc type was not generated by cgo -godefs through mkall.sh
as it contains an uint member. Regenerate the type and adjust
PtraceIoDesc to deal with the type difference on 32-bit vs. 64-bit.

Change-Id: I1ec9662aa8e1b199ebe557387aa27827f23d9d40
Reviewed-on: https://go-review.googlesource.com/c/sys/+/215242
Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
2020-01-21 08:24:15 +00:00
Tobias Klauser
655fe14d74 unix: test (*FdSet).Clear in TestFdSet
Follow-up for CL 205397 so all *FdSet functionality is tested.

Change-Id: Ieb5dce6ad020ce1252cae7f3fe96ba6bf0069f5e
Reviewed-on: https://go-review.googlesource.com/c/sys/+/215241
Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2020-01-20 15:18:20 +00:00
Brad Fitzpatrick
c1edf53553 Revert "unix: fix Setfsuid and Setfsgid return values"
This reverts commit 94506bca4f.

Reason for revert: breaking API change; I want more discussion before we do this.
 
e.g. it breaks https://github.com/search?utf8=%E2%9C%93&q=unix.Setfsuid+filename%3A*.go&type=Code&ref=advsearch&l=&l= ... like 351481c720/src/LinuxBoot/github.com/u-root/u-root/cmds/core/fusermount/fusermount_linux.go

Change-Id: I474195047f080d0b2c2178578c5f45520af96c53
Reviewed-on: https://go-review.googlesource.com/c/sys/+/215518
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2020-01-20 15:04:07 +00:00
Sergey Ivanov
94506bca4f unix: fix Setfsuid and Setfsgid return values
setfsuid(2) and setfsgid(2) both return an int value that indicates the
previous fsuid or fsgid set. This change makes unix.Setfsgid() and
unix.Setfsuid() return these values too instead of returning only an
error.

Fixes golang/go#36649

Change-Id: I56cbb49d7485023b6b04f7b95e8f675473241d8c
Reviewed-on: https://go-review.googlesource.com/c/sys/+/215240
Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Tobias Klauser <tobias.klauser@gmail.com>
2020-01-20 14:57:06 +00:00
Tobias Klauser
59e60aa80a cpu: don't read ARM64 registers on Android
It seems like on Android we're not allowed in all cases to read the
registers ISAR0, ISAR1 and PFR0 to detect CPU features.

Fixes golang/go#36622

Change-Id: I577bd928a5a4dcd6e908cf059faa15fc0c80e3e5
Reviewed-on: https://go-review.googlesource.com/c/sys/+/215237
Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2020-01-17 14:54:32 +00:00
maltalex
b77594299b windows: add missing network-related constants
Change-Id: I75c432e527c42bdf3c91e07590a143c67d9a97a3
GitHub-Last-Rev: d738e281e2
GitHub-Pull-Request: golang/sys#53
Reviewed-on: https://go-review.googlesource.com/c/sys/+/214997
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
2020-01-16 00:19:09 +00:00
Tobias Klauser
86b910548b unix: add missing chtmpdir in TestPpoll on openbsd
This ensures the the fifos are created in a temporary directory.

Change-Id: I744122207700e77a7a180d4f61336a93f3e5efca
Reviewed-on: https://go-review.googlesource.com/c/sys/+/214479
Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com>
Run-TryBot: Matt Layher <mdlayher@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Matt Layher <mdlayher@gmail.com>
2020-01-13 16:29:24 +00:00
Tobias Klauser
548cf772de unix: add SysctlClockinfo on dragonfly and freebsd
Change-Id: I0d439b5c59c79594c6ecfebe0375971e1344cc09
Reviewed-on: https://go-review.googlesource.com/c/sys/+/213400
Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
2020-01-07 16:21:24 +00:00
Tobias Klauser
ef85f5a75d unix: add Inet4Pktinfo type on solaris
Change-Id: I4f18b5d98697120a16b56657a012d7ab5fe1b83c
Reviewed-on: https://go-review.googlesource.com/c/sys/+/213399
Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
2020-01-07 14:46:01 +00:00
Tobias Klauser
b016eb3dc9 unix: test UtimesNanoAt on *bsd and solaris
Move TestUtimesNanoAt to syscall_unix_test.go. All BSDs and
solaris/illumos provide UtimesNanoAt. The implementations on linux and
darwin are already the same and the type conversions of Timespec members
on aix should no longer be necessary since CL 177838.

Change-Id: If0d03a92b3167da08191b6e98888eec92f27c3c9
Reviewed-on: https://go-review.googlesource.com/c/sys/+/213398
Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2020-01-06 16:20:15 +00:00
Tobias Klauser
5f8ca72cd6 unix: don't zero out extra registers on riscv64 syscalls
Follow the implementation in package syscall, see CL 204659.

Change-Id: Ib97f86958cbdb0135b7980faf23729543c68d42a
Reviewed-on: https://go-review.googlesource.com/c/sys/+/213397
Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Joel Sing <joel@sing.id.au>
2020-01-06 11:46:38 +00:00
Tobias Klauser
a1369afcda unix: add flags argument in //sys comments for Fstatvfs1 and Statvfs1 on netbsd
Otherwise, these functions would not be generated correctly. Follow-up
for CL 209637.

Also regenerate the zsyscall_netbsd_*.go files, causing the definition
of sysctl to move.

Change-Id: I829e8c94a69b6aeb251b46bc4762f2a7bbc45a8e
Reviewed-on: https://go-review.googlesource.com/c/sys/+/212460
Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Reviewed-by: Benny Siegert <bsiegert@gmail.com>
2020-01-03 14:33:44 +00:00
Tobias Klauser
c96a22e43c unix: add Dup3 on netbsd and openbsd
Change-Id: Id871d3d211d6d5896e41b673c7bfe3a1d8e756a6
Reviewed-on: https://go-review.googlesource.com/c/sys/+/212461
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
2020-01-02 14:19:24 +00:00
Tobias Klauser
04cbcbbfee unix: correct build tag to define Getdirentries for darwin/arm with Go 1.11
Fixes golang/go#36300

Change-Id: I42692b47135870b52a26eb9662ca54648c9cfaf2
Reviewed-on: https://go-review.googlesource.com/c/sys/+/212459
Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com>
Reviewed-by: Keith Randall <khr@golang.org>
2019-12-28 21:39:18 +00:00
maltalex
c709ea063b windows: added SO_RCVTIMEO and IPPROTO_ICMP constants
Added missing Windows constants SO_RCVTIMEO and IPPROTO_ICMP

Change-Id: I3a13fa0af2d085a7294b8d983a94d0d9c3c6ec31
GitHub-Last-Rev: cfafa03e60
GitHub-Pull-Request: golang/sys#50
Reviewed-on: https://go-review.googlesource.com/c/sys/+/211559
Run-TryBot: Alex Brainman <alex.brainman@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Alex Brainman <alex.brainman@gmail.com>
2019-12-24 08:55:50 +00:00
Tobias Klauser
5a3cf8467b unix: compare Stat_t members in TestFstatat
TestFstatat occasionally fails on some builders due to mismatching
Stat_t info returned by the calls to Fstatat (most likely due to Atime
changing). Fix the test by just comparing some well known members.

Change-Id: I862957ad9d3632173a97d93692a6c672779ac508
Reviewed-on: https://go-review.googlesource.com/c/sys/+/212417
Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
2019-12-23 22:42:16 +00:00
Tobias Klauser
abf886d6f5 unix: unify definition of func fcntl
For linux and *bsd, implement func fcntl in fcntl.go instead of
generating it. Implement it using fcntl64Syscall, so SYS_FCNTL64 is used
on 32-bit linux.

For aix, darwin and solaris continue generate func fcntl as before.

Change-Id: I3750b88d1ee5573daaee2b75c369f723fde8834a
Reviewed-on: https://go-review.googlesource.com/c/sys/+/212337
Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
2019-12-23 22:40:30 +00:00
Ian Lance Taylor
0732a99047 unix: use correct file name in comment
Change-Id: Ib05fbd6f1dca630a3ac596f88373756797d8c27e
Reviewed-on: https://go-review.googlesource.com/c/sys/+/212298
Reviewed-by: Tobias Klauser <tobias.klauser@gmail.com>
2019-12-20 22:00:14 +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
maltalex
af0d71d358 windows: fix recvfrom and sendto data types
Fixes wrong data type used in Windows recvfrom and sendto calls

In Windows, `int` refers to a 32-bit signed integer
(https://docs.microsoft.com/en-us/windows/win32/winprog/windows-data-types#int).
However, the current implementation (https://golang.org/cl/208321)
uses the `int` type, which can have a different size. This is especially
important when recvfrom` returns a 32bit value of `-1`, indicating an error,
since it is interpreted as the 64bit value 4294967295.

Change-Id: Ib966ff317b0be7e29e48ee373a794cd0267fb007
GitHub-Last-Rev: 9aad4c377f
GitHub-Pull-Request: golang/sys#51
Reviewed-on: https://go-review.googlesource.com/c/sys/+/211998
Reviewed-by: Ian Lance Taylor <iant@golang.org>
2019-12-19 23:57:34 +00:00
Umang Parmar
4a24b40652 unix: add PrctlRetInt, a Prctl variant that returns (int, error)
Fixes golang/go#35978

Change-Id: I396f0c2c6443e000bcecc9081841cd55145c050b
GitHub-Last-Rev: d461448006
GitHub-Pull-Request: golang/sys#48
Reviewed-on: https://go-review.googlesource.com/c/sys/+/209969
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-18 08:49:08 +00:00
erifan01
ac6580df44 unix: move functions Ptrace{Get|Set}RegSetArm64 to a separate file
CL 204418 adds functions PtraceGetRegSetArm64 and PtraceSetRegSetArm64 to file
zptrace_armnn_linux.go, both of which depend on type Iovec. The definitions of type
Iovec on linux arm and arm64 are different, but file zptrace_armnn_linux.go is
shared by them. So these two functions cause compilation errors on linux arm. This
patch fixes this error by moving these two functions into a separate file.

Fixes golang/go#36032

Change-Id: Ia380bd863895900599c09d4631ed26f204955112
Reviewed-on: https://go-review.googlesource.com/c/sys/+/210322
Run-TryBot: eric fang <eric.fang@arm.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
2019-12-10 02:34:23 +00:00
Umang Parmar
eeba5f6aab unix: replace readlink in mkall.sh with portable shell commands
Fixes golang/go#35997

Change-Id: I1c489a126646a0ff4abf9e8b7ba357ff62cb66ac
GitHub-Last-Rev: e01b1c0e8b
GitHub-Pull-Request: golang/sys#49
Reviewed-on: https://go-review.googlesource.com/c/sys/+/210157
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
2019-12-06 22:06:18 +00:00
erifan01
bc7efcf3b8 unix: add functions PtraceGetRegSetArm64 and PtraceSetRegSetArm64
Since arm64 GNU/Linux version 2.6.34, PTRACE_GETREGS was replaced by PTRACE_GETREGSET,
in order to get or set the general purpose and floating-point register values,
PTRACE_GETREGSET/PTRACE_SETREGSET request type and a proper "NT_XXX" constant values
should be used. For the sake of not breaking the existing API, we added two functions
PtraceGetRegSetArm64 and PtraceSetRegSetArm64, they take an additional argument "addr",
and use PTRACE_GETREGSET and PTRACE_SETREGSET request types respectively.

Change-Id: I14c55733e15cea4b7d775187b1018fcb2880d6a9
Reviewed-on: https://go-review.googlesource.com/c/sys/+/204418
Run-TryBot: eric fang <eric.fang@arm.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
2019-12-06 21:42:22 +00:00
Tobias Klauser
ce4227a45e unix: add Statvfs and Fstatvfs on NetBSD
NetBSD replaced statfs with statvfs in NetBSD 3.0. statfs is derived
from BSD4.4, while NetBSD (and Solaris) implement statvfs from POSIX
instead.

Generated and tested on NetBSD 8.0 (amd64). Also tested on NetBSD 7.0 (amd64).

Change-Id: I53738b77815d04c7774a6455b4a31cd4e9571f7b
Reviewed-on: https://go-review.googlesource.com/c/sys/+/209637
Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Benny Siegert <bsiegert@gmail.com>
2019-12-04 07:23:24 +00:00
Tobias Klauser
85b82a3add cpu: support reading arm64 CPU feature registers
This allows to detect ARM64 CPU features on non-Linux systems. On Linux,
this is used in case /proc/self/auxv cannot be read.

Change-Id: I67d55e989f2beda0c05a97ca5e55781840a8e01c
Reviewed-on: https://go-review.googlesource.com/c/sys/+/209478
Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
2019-12-04 07:21:56 +00:00
maltalex
6d18c012ae windows: add Recvfrom and Sendto implementations
Added the missing `Sendto` and `Recvfrom` syscalls for Windows.
Fixes golang/go#7170

Change-Id: I794b4f631fad424400fec85ccecc3a3b3abe5465
GitHub-Last-Rev: 39ebe929ca
GitHub-Pull-Request: golang/sys#46
Reviewed-on: https://go-review.googlesource.com/c/sys/+/208321
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-28 01:58:09 +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
Tobias Klauser
bd437916bb unix: check number of ready file descriptors in TestPselect
Like in TestSelect, check the number of ready file descriptors returned
by Pselect.

Change-Id: I4a64720092132c5ba432d6d1274df8c68bb5b6bf
Reviewed-on: https://go-review.googlesource.com/c/sys/+/207862
Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
2019-11-20 15:59:48 +00:00
Tobias Klauser
76d669a226 unix: don't fail TestSelect on EINTR from Select
Change-Id: Ie162966c830ffd86947cf4f04532a7f6741a5587
Reviewed-on: https://go-review.googlesource.com/c/sys/+/207861
Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
2019-11-20 15:59:35 +00:00
Simon Rozman
6bfc516c86 windows: add Get*PreferredUILanguages
This commit adds the following MUI functions:
- GetUserPreferredUILanguages
- GetSystemPreferredUILanguages
- GetThreadPreferredUILanguages
- GetProcessPreferredUILanguages

Change-Id: I44f1c07245ab814935778c6b910b224d24cc753c
Reviewed-on: https://go-review.googlesource.com/c/sys/+/207860
Reviewed-by: Simon Rozman <simon@rozman.si>
Reviewed-by: Jason A. Donenfeld <Jason@zx2c4.com>
Run-TryBot: Jason A. Donenfeld <Jason@zx2c4.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
2019-11-20 13:05:36 +00:00
Tobias Klauser
f068ffe820 unix: use same TestSelect on all Unices
Also change t.Error messages to use "got foo, expected bar" notation.

Change-Id: Ia0b452f96b08cbb69a0b64cc2a467b5cf94e72da
Reviewed-on: https://go-review.googlesource.com/c/sys/+/207858
Reviewed-by: Ian Lance Taylor <iant@golang.org>
2019-11-19 19:55:28 +00:00
Tobias Klauser
e882bf8e40 unix: fix EINTR check in TestPselect
err == EINTR needs to be checked before err != nil for the interrupted
syscall to be retried properly.

Follow-up for CL 207284

Updates golang/go#35555

Change-Id: I76d569058b7985ec51f07909d86807a8b4911772
Reviewed-on: https://go-review.googlesource.com/c/sys/+/207292
Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
2019-11-19 06:07:38 +00:00
Clément Chigot
cf1e2d5771 unix: regenerate zerrors for AIX
Add "sys/select.h" in order to have NFDBITS on AIX and regenerate
zerrors_aix_ppc.go and zerrors_aix_ppc64.go at the same time.

Fixes: golang/go#35635

Change-Id: Iaad62ea1faf50f4b08364f288b3c63013ac4bc6e
Reviewed-on: https://go-review.googlesource.com/c/sys/+/207657
Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Tobias Klauser <tobias.klauser@gmail.com>
2019-11-18 13:31:27 +00:00
Alex Brainman
b5d5184f72 windows: revert security_windows.go change of CL 202177
This change is golang.org/x/sys/windows copy of CL 204117.

Updates golang/go#34972

Change-Id: I338c91bfe3971a80cbf44c2a0f1807adaa00918d
Reviewed-on: https://go-review.googlesource.com/c/sys/+/207199
Run-TryBot: Alex Brainman <alex.brainman@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Tobias Klauser <tobias.klauser@gmail.com>
2019-11-18 09:04:20 +00:00