I just created a couple of virtual machines/QEMU instances containing
stock copies of FreeBSD 12.1-RELEASE. On these systems I ran mkall.sh,
thereby bringing the definitions in sync with that version of FreeBSD.
I also attempted to bring the GOOS=freebsd GOARCH=arm port up to date,
but was unfortunately not able to do so. There doesn't seem to be any
documentation on how to bring this port of FreeBSD up on an emulator.
The only option seems to be to use physical hardware.
Change-Id: I54c9f5d15587996ad5fbb535480ab0aa0e723260
GitHub-Last-Rev: ad79b1bda1
GitHub-Pull-Request: golang/sys#63
Reviewed-on: https://go-review.googlesource.com/c/sys/+/223698
Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Tobias Klauser <tobias.klauser@gmail.com>
Add constants and types to support IP-encapsulated L2TP/RFC3931
tunnels on Linux systems.
The L2TP subsystem for IP encapsulated tunnels hooks into the inet
kernel code using a specific IP protocol value. In order to handle
this, anyToSockaddr now has to query the socket protocol type using
GetsockoptInt for the AF_INET and AF_INET6 address families.
Although this change is reasonably simple, unit tests have been added
to validate handling of the new types.
Fixesgolang/go#37787
Change-Id: I16ae1e24dcced4ccc6ce6a79a90a5a2f6a560967
GitHub-Last-Rev: ca554ad1b6
GitHub-Pull-Request: golang/sys#60
Reviewed-on: https://go-review.googlesource.com/c/sys/+/223157
Reviewed-by: Ian Lance Taylor <iant@golang.org>
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>
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>
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>
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>
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>
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>
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.
Fixesgolang/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>
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>
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.4Fixesgolang/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>
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>
When checking the old affinity mask with the fix introduced in CL
137675, the wrong CPU (5 instead of 1) is checked. Correct this and also
move the call to SchedGetaffinity closer to the SchedSetaffinity call in
order to reduce the time window for CPUs to go offline.
Updates golang/go#27875Fixesgolang/go#35184
Change-Id: Ie50320c82d1334aa26764281253dc9dde066a730
Reviewed-on: https://go-review.googlesource.com/c/sys/+/206863
Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Bryan C. Mills <bcmills@google.com>