Done with:
go get go@1.18
go mod tidy
go fix ./...
Using go1.21.3.
Also update code generators to use only the new go:build lines,
not the old +build ones.
For golang/go#60268.
Change-Id: I6aabc42efb6ab3329981100e1db2263aac5e92a6
Reviewed-on: https://go-review.googlesource.com/c/sys/+/534222
Reviewed-by: Ian Lance Taylor <iant@google.com>
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
Auto-Submit: Dmitri Shuralyov <dmitshur@golang.org>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
As of Go 1.21 syscall.Setrlimit and syscall.prlimit can affect
starting a new process, by restoring the original NOFILE rlimit.
That is recorded locally in the syscall package, so just always
call the syscall functions.
For golang/go#46279
Change-Id: I2f3dafe5562a7dde1297bad6f5d34a80af5d620b
Reviewed-on: https://go-review.googlesource.com/c/sys/+/476695
Run-TryBot: Ian Lance Taylor <iant@golang.org>
Run-TryBot: Ian Lance Taylor <iant@google.com>
Reviewed-by: Ian Lance Taylor <iant@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Bryan Mills <bcmills@google.com>
Auto-Submit: Ian Lance Taylor <iant@google.com>
Fixesgolang/go#53444
Change-Id: I284e85f954f1646f7026478987db74993ae06d4a
GitHub-Last-Rev: 490f814484
GitHub-Pull-Request: golang/sys#134
Reviewed-on: https://go-review.googlesource.com/c/sys/+/428174
Reviewed-by: Michael Knyszek <mknyszek@google.com>
Run-TryBot: Ian Lance Taylor <iant@golang.org>
Run-TryBot: Ian Lance Taylor <iant@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@google.com>
Auto-Submit: Ian Lance Taylor <iant@google.com>
Same as CL 386415 does for package syscall.
accept is no longer used on Linux since CL 347329 changed Accept to use
accept4 only.
For golang/go#45964
Change-Id: I9f431044c03e7f28c08152390ad71f45eddfe9dd
Reviewed-on: https://go-review.googlesource.com/c/sys/+/386954
Trust: Tobias Klauser <tobias.klauser@gmail.com>
Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Matt Layher <mdlayher@gmail.com>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
SYS_ALARM is not defined for arm* or riscv, but is available for all other
Linux GOARCH values. Ian suggested I create a new file with build tags
matching these constraints.
In order to handle special case files such as this one (which don't match the
existing syscall_linux_goarch.go scheme), I've added logic to the Linux build
system which can evaluate the build constraints in a given file to determine
whether that file should be appended to the arguments for a given target.
Change-Id: I0136534522a26a0ce495308f63953546ea6bb8e5
Reviewed-on: https://go-review.googlesource.com/c/sys/+/383734
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Trust: Daniel Martí <mvdan@mvdan.cc>
Android's Bionic libc installs a seccomp filter that allows ppoll but
not poll. This has been fine for arm64, where we already implement poll
in terms of ppoll, but not the other architectures, such as amd64, which
runs on Chromebooks, and currently leads to crashes.
This commit implements poll in terms of ppoll on the remaining
architectures and makes this common code, so that everyone uses the more
modern syscall.
Change-Id: Ic01a32b5abe48ab53a2549f592a41561f1684c30
Reviewed-on: https://go-review.googlesource.com/c/sys/+/352310
Trust: Jason A. Donenfeld <Jason@zx2c4.com>
Trust: Brad Fitzpatrick <bradfitz@golang.org>
Run-TryBot: Jason A. Donenfeld <Jason@zx2c4.com>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
The minimum required Linux kernel version for Go 1.18 will be changed to
2.6.32, see golang/go#45964. The dup3 syscall was added in 2.6.27, so it
can be used instead of the dup2 syscall which is not implemented on
arm64 and riscv64 or blocked on android.
For golang/go#45964
Change-Id: I9c677db4bae3ce441b258c49580fb9a2cd600436
Reviewed-on: https://go-review.googlesource.com/c/sys/+/350552
Trust: Tobias Klauser <tobias.klauser@gmail.com>
Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Matt Layher <mdlayher@gmail.com>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Most architectures currently already implement Pipe using the pipe2
syscall. Only 386, amd64, mips{,le}, ppc and sparc64 still use the pipe
syscall. However, some systems (e.g. Android seccomp policies) block
that syscall, see golang/go#40828 for an example.
The pipe2 syscall was added in Linux kernel version 2.6.27. The minimum
required Linux kernel version for Go 1.18 will be changed to 2.6.32
per golang/go#45964 so it is possible to unify the implementation of
Pipe using the pipe2 syscall.
Same as CL 350530 did for package syscall.
For golang/go#45964Fixesgolang/go#40828
Change-Id: I07d84d3ea06a54e37d9ff6b72702fe5d96efef7b
Reviewed-on: https://go-review.googlesource.com/c/sys/+/350549
Trust: Tobias Klauser <tobias.klauser@gmail.com>
Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Matt Layher <mdlayher@gmail.com>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Most newer architectures (e.g. arm64 or riscv64) don't provide the
epoll_create syscall. Some systems (e.g. Android) block it even if it
were available. In the kernel, the epoll_create syscall is implemented
[1] the same way EpollCreate is implemented in this package for
platforms without the epoll_create syscall. Thus, avoid the separate
wrapper and consistently implement EpollCreate using EpollCreate1.
[1] https://elixir.bootlin.com/linux/v5.15-rc1/source/fs/eventpoll.c#L2006
Change-Id: I8ac11d0de939dafa4b1d189d97d350b9c324c3ab
Reviewed-on: https://go-review.googlesource.com/c/sys/+/349809
Trust: Tobias Klauser <tobias.klauser@gmail.com>
Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Matt Layher <mdlayher@gmail.com>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
The minimum required Linux kernel version for Go 1.18 will be changed to
2.6.32, see golang/go#45964. The current minimum required version is
2.6.23 and the inotify_init1 syscall was added in 2.6.27, so the
fallback to inotifyInit and inotifyInit itself can be removed on
linux/amd64.
For golang/go#45964
Change-Id: I8dc83ef04d74cfc9ec80da503076b9acfa9c365a
Reviewed-on: https://go-review.googlesource.com/c/sys/+/347330
Trust: Tobias Klauser <tobias.klauser@gmail.com>
Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Matt Layher <mdlayher@gmail.com>
Make all our package sources use Go 1.17 gofmt format
(adding //go:build lines).
Not strictly necessary but will avoid spurious changes
as files are edited.
Part of //go:build change (#41184).
See https://golang.org/design/draft-gobuild
Change-Id: I01667f826428426a39c84717d02efa25fa44553c
Reviewed-on: https://go-review.googlesource.com/c/sys/+/294490
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Keith Randall <khr@golang.org>
Reviewed-by: Josh Bleecher Snyder <josharian@gmail.com>
Reviewed-by: Matt Layher <mdlayher@gmail.com>
Trust: Josh Bleecher Snyder <josharian@gmail.com>
Trust: Russ Cox <rsc@golang.org>
Run-TryBot: Josh Bleecher Snyder <josharian@gmail.com>
Run-TryBot: Russ Cox <rsc@golang.org>
Android O and newer blocks access to the dup2 syscall. Route calls
to Dup2 to Dup3.
Change-Id: I76c0180db260ece4840b8ebf2736fb3f8c7ff9eb
Reviewed-on: https://go-review.googlesource.com/c/sys/+/231277
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
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>
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.
Fixesgolang/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>
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>
Asymmetric keyrings can require key payloads to be X.509 certificates
signed by a key in a different keyring. This can be helpful for rotating
keys on a live machines for subsystems like IMA while preventing local
tampering.
Tested locally by applying the "key_or_keyring:<id>" restriction to a
keyring.
Change-Id: Ia8dcb343abc5f405d374c357d5cac3d5181d7159
Reviewed-on: https://go-review.googlesource.com/c/sys/+/178400
Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Tobias Klauser <tobias.klauser@gmail.com>
Add wrappers for Getcap/Setcap on Linux as well as some related types
and consts.
Change-Id: I07764c2e64717214850ea3cbdc238e313d1e38c4
Reviewed-on: https://go-review.googlesource.com/c/sys/+/183218
Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
The kernel raw syscall takes an additional parameter specifying
the size of the Sigset_t parameter, returns a file descriptor and sets errno.
Add a uintptr maxSize parameter, adjust the return to be (newfd int, err error).
Add the _NSIG #define and a wrapper to call with maxSize set to _C__NSIG/8 as done
in glibc/musl.
Change-Id: I277db0aab5c12364533c26ea800b7f394ec83ae4
Reviewed-on: https://go-review.googlesource.com/c/sys/+/178858
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
No usable change for users in this CL; just auto-generated syscall
wrapper funcs & types.
The next CL will have hand-written code adding the nice Go API around
these unexported symbols. (as outlined in the comment at
https://golang.org/issue/30537#issuecomment-470284573)
Updates golang/go#30537
Change-Id: I5e34df517efcf509fff97f670425500cc6608d59
Reviewed-on: https://go-review.googlesource.com/c/sys/+/172584
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Tobias Klauser <tobias.klauser@gmail.com>
This teaches unix/mksyscall.go about mapping uint64 to syscall
arguments, similar to existing handling of int64.
Change-Id: I536b4b09bbf6a8e3016565a4a04d2b9d32cbc624
Reviewed-on: https://go-review.googlesource.com/c/164664
Reviewed-by: Tobias Klauser <tobias.klauser@gmail.com>
On linux/riscv64, the renameat syscall no longer exists and has been
superseded by renameat2. Use Renameat2 to implement Renameat on
linux/riscv64.
Based on a patch by Ryan O'Leary.
Updates golang/go#27532
Change-Id: I7c60c7f824750408265f67397b8ac1fa7226f425
Reviewed-on: https://go-review.googlesource.com/c/157899
Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
This adds the ClockNanosleep syscall and the TIMER_* constants;
currently only TIMER_ABSTIME for specifying an absolute timestamp.
Change-Id: Ic8d857eb92818529aadab569cd8646a19bb9c055
Reviewed-on: https://go-review.googlesource.com/c/157658
Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Tobias Klauser <tobias.klauser@gmail.com>
ARM64 does this exact same thing, and in fact this is required on
Android 9, where Bionic now only allows lstat on 32-bit platforms
Folks are running into this when using Android on Chromebooks,
which are keeping AMD64 Android alive. So, we change the AMD64
behavior to model that of ARM64.
Change-Id: Id933cc22b42ab365c12980915557bdbf88661a4d
Reviewed-on: https://go-review.googlesource.com/c/153319
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
ARM64 does this exact same thing, and in fact this is required on
Android 9, where Bionic now only allows inotify_init on 32-bit
platforms. Folks are running into this when using Android on
Chromebooks, which are keeping AMD64 Android alive. So, we change the
AMD64 behavior to model that of ARM64. However, since Go must run on
kernels between 2.6.27 and 2.6.23, we must still fall back to the
original call.
Fixes: https://lore.kernel.org/wireguard/CALv=V9Gv6apdWJ9P-80zf9bgByd=c3QqPhRHuw6o0_OaH0=W6g@mail.gmail.com
Change-Id: I183e82679cb7d702d12a35457920ccd422176254
Reviewed-on: https://go-review.googlesource.com/c/153318
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Port mksyscall.pl Perl script to mksyscall.go.
mkall scripts are modified to run mksyscall.go.
Running ./mkall.sh does not generate any git diff besides
the command name in comments of generated files.
Updates golang/go#27779
Change-Id: I8c6eb852e6821f4a91dc03cc042d8d343f1bcf66
Reviewed-on: https://go-review.googlesource.com/c/150217
Reviewed-by: Tobias Klauser <tobias.klauser@gmail.com>
Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
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>
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>
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>
Fsetxattr should just return an error (like Setxattr and like Fsetxattr
is already doing on FreeBSD).
Fix for CL 128176
Updates golang/go#26832
Change-Id: Id1c1315d9eb6952128e0c0ce44b19060e0403cc0
Reviewed-on: https://go-review.googlesource.com/128495
Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
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>
On linux/arm64 we used to manually define syscall numbers for some
deprecated syscalls. Most of them are unused by now anyhow. Convert the
remaining syscall wrappers using them to implement the respective
functionality using a non-deprecated syscall (in the same way glibc does
it):
- Implement EpollCreate using EpollCreate1 and additionally check
that the passed size argument is larger than 0.
- Implement Futimesat and utimes using utimensat. Also change futimesat
on the other geese to take a string instead of *byte and let the
generated wrapper do the BytePtrFromString conversion.
- Return ENOSYS from Ustat. The ustat syscall has been deprecated for a
long time in favor of fstatfs and statfs. Even glibc will deprecate
ustat in the upcoming 2.28 release [1].
[1] https://sourceware.org/git/?p=glibc.git;a=blob;f=NEWS;h=d51fa09544f03899b7ff5a80569db088c3c23c28;hb=HEAD#l90
Change-Id: I7ea38a3cd394b0875f17443b14e107fd9c70350d
Reviewed-on: https://go-review.googlesource.com/119655
Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
The stat syscall is disallowed by Android's seccomp policy on
linux/amd64. Use the fstatat syscall with AT_FDCWD and zero flags to
achieve the same behavior.
CL 109835 did the same for package syscall.
Change-Id: Iaa7d0dbf17ade4803f59b4361973ce627bcb65b4
Reviewed-on: https://go-review.googlesource.com/110061
Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
This is yet another syscall that needs to be changed around for
Android's seccomp. We already do this in MIPS64 and ARM64, but
apparently forgot about AMD64.
Change-Id: I42c8a4653a55d4714dacfaf7add14012f428c992
Reviewed-on: https://go-review.googlesource.com/109835
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
This adds a wrapper around perf_event_open, exported constants and
two structs:
- perf_event_attr, used to configure the syscall
- perf_event_mmap_page to coordinate the kernel's mmap ring buffer
Change-Id: Ife7ded8344de9e3eb74441bd51ab9a04c81b4965
Reviewed-on: https://go-review.googlesource.com/105756
Reviewed-by: Tobias Klauser <tobias.klauser@gmail.com>
Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
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>
Add the SyscallNoError and RawSyscallNoError wrapper functions which are
used for syscalls that don't return an error. Also convert all applicable
syscalls to use these wrappers.
Updates golang/go#22924
Change-Id: Ie143abc99de8d12d36b67ac278e08d7565f73ce0
Reviewed-on: https://go-review.googlesource.com/85756
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>
Looks like it's enough to just add wrappers pointing to the
corresponding SYS_FSTATAT{,64} or SYS_NEWFSTATAT syscall. Add a test to
verify that assumption which checks that the returned stat data matches
what is returned by Stat/Lstat.
Also add the AT_NO_AUTOMOUNT constant which may be used for the flags
parmeter.
Fixesgolang/go#14216
Change-Id: I73f27b483bd97d2dcf09d4b95a7957e75d194395
Reviewed-on: https://go-review.googlesource.com/79795
Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Follow CL 70590 which did the same for syscall.
unix.Select uses SYS_PSELECT6 on arm64 and mipx64x, however this
syscall expects its 5th argument to be of type Timespec (with seconds
and nanoseconds) instead of type Timeval (with seconds and microseconds)
This leads to the timeout being too short by a factor of 1000.
This CL fixes this by adjusting the timeout argument accordingly,
similarly to how glibc does it for architectures where neither
SYS_SELECT nor SYS__NEWSELECT are available. It also makes Pselect
generaly available on linux.
Updates golang/go#22246
Change-Id: I69f8821a40c59ee469b8a986d784a4db8727ee9a
Reviewed-on: https://go-review.googlesource.com/70610
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Change https://go-review.googlesource.com/c/sys/+/56172 did not run
./mkall.sh after modifying syscall_linux.go. This change simply runs
./mkall.sh to correctly generate the modified files.
Note that the previous change simply reordered a few functions, so the
functions are simply reordered in the generated files.
Change-Id: I2d819f9ca4ae0e59e67e42d04bb6e6513b3c6c45
Reviewed-on: https://go-review.googlesource.com/61750
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Syncfs is Linux-specific system call to synchronize to disk one
filesystem specified by fd to any of its files.
See http://man7.org/linux/man-pages/man2/syncfs.2.html for details.
Change-Id: Ia2ad6208c3fa0e9c40d5112ce938edd5d374131d
Reviewed-on: https://go-review.googlesource.com/51510
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>