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>
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>
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>
CL 199519 broke the build with Go 1.11. Even though this is not an
officially supported release anymore, people still seem to rely on it
and the fix is easy enough and won't break anyone using newer, supported
Go versions.
Change-Id: I632d6840bc1f49c01c372727c9a55d2daf98f4a8
Reviewed-on: https://go-review.googlesource.com/c/sys/+/206357
Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
This tests the epoll functionality on linux and should hopefully help
catch GOARCHes where additional padding of EpollEvent is needed (see
e.g. CL 189877).
Change-Id: Icd19746a60a63016a5d46535a2cc557ca7a0d474
Reviewed-on: https://go-review.googlesource.com/c/sys/+/205398
Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Add Set, Clear, IsSet and Zero methods to manipulate an *FdSet. These
implement the same functionality as the FD_SET, FD_CLR, FD_ISSET and
FD_ZERO macros in <sys/select.h>.
Change-Id: I6b7bccb98e58ee5e719096ed5743f6edcd232840
Reviewed-on: https://go-review.googlesource.com/c/sys/+/205397
Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
This test's existence was predicated upon assumptions about the full
range of known data types and known data into those types. However,
we've learned from Microsoft that there are several undocumented secret
registry types that are in use by various parts of Windows, and we've
learned from inspection that many Microsoft uses of registry types don't
strictly adhere to the recommended value size. It's therefore foolhardy
to make any assumptions about what goes in and out of the registry, and
so this test is meaningless and error-prone.
Updates golang/go#35084
Change-Id: Ie545229afd8dc5bde90fffa0f735f7102cd4a6eb
Reviewed-on: https://go-review.googlesource.com/c/sys/+/203605
Run-TryBot: Jason A. Donenfeld <Jason@zx2c4.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
According to MSDN, "If the data has the REG_SZ, REG_MULTI_SZ or
REG_EXPAND_SZ type, this size includes any terminating null character or
characters unless the data was stored without them. [...] If the data
has the REG_SZ, REG_MULTI_SZ or REG_EXPAND_SZ type, the string may not
have been stored with the proper terminating null characters. Therefore,
even if the function returns ERROR_SUCCESS, the application should
ensure that the string is properly terminated before using it;
otherwise, it may overwrite a buffer."
It's therefore dangerous to pass it off unbounded as we do, and in fact
this led to crashes on real systems.
Change-Id: I2ab324e85f75dc3e4d6d62fec3b96937fec77510
Reviewed-on: https://go-review.googlesource.com/c/sys/+/202957
Run-TryBot: Jason A. Donenfeld <Jason@zx2c4.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Alex Brainman <alex.brainman@gmail.com>
While the other BSDs use __sysctl as the name, Darwin now uses sysctl,
without the leading underscores, and considers __sysctl to be "private".
Using __sysctl leads to App Store rejections, and Go's syscall package
already uses the proper syscall. So this commit changes Darwin's syscall
to use it too here, while reverting a recent commit that removed it all
together on arm and arm64.
This reverts CL 194097.
Fixesgolang/go#35103
Updates golang/go#34133
Updates golang/go#35101
Change-Id: Ic72d5e7a435b99fe62c533b77b2c3790590f4c9e
Reviewed-on: https://go-review.googlesource.com/c/sys/+/202837
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: David Crawshaw <crawshaw@golang.org>
Reviewed-by: Tobias Klauser <tobias.klauser@gmail.com>
Chmod toggles the FILE_ATTRIBUTES_READONLY flag depending on the
permission bits. That's a bit odd but I guess some compromises were made
at some point and this is what was chosen to map to a Unix concept that
Windows doesn't really have in the same way. That's fine. However, the
logic used in Chmod was forgotten from Open, which then manifested
itself in various places, most recently, go modules' read-only behavior.
This corresonds with the syscall CL 202439.
Updates golang/go#35033
Change-Id: Id8e74c5205057a74a35eda213516780b79a2aed2
Reviewed-on: https://go-review.googlesource.com/c/sys/+/202440
Run-TryBot: Jason A. Donenfeld <Jason@zx2c4.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Bryan C. Mills <bcmills@google.com>
Reviewed-by: Alex Brainman <alex.brainman@gmail.com>