summaryrefslogtreecommitdiff
path: root/src/syscall/zsyscall_linux_mipsle.go
Commit message (Collapse)AuthorAgeFilesLines
* syscall: add race annotations to Pread and PwriteIan Lance Taylor2022-03-121-2/+2
| | | | | | | | | | | Fixes #51618 Change-Id: Ife894d8c313dce8c4929f40fa0ac90a069f77a89 Reviewed-on: https://go-review.googlesource.com/c/go/+/391954 Trust: Ian Lance Taylor <iant@golang.org> Run-TryBot: Ian Lance Taylor <iant@golang.org> TryBot-Result: Gopher Robot <gobot@golang.org> Reviewed-by: Keith Randall <khr@golang.org>
* syscall: remove accept on LinuxTobias Klauser2022-03-021-11/+0
| | | | | | | | | | | | | | accept is no longer used on Linux since CL 346849 changed Accept to use accept4 only. For #45964 Change-Id: I72c13df1457016c4785ec13d356ab89cbca644b6 Reviewed-on: https://go-review.googlesource.com/c/go/+/386415 Trust: Tobias Klauser <tobias.klauser@gmail.com> Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com> TryBot-Result: Gopher Robot <gobot@golang.org> Reviewed-by: Ian Lance Taylor <iant@golang.org>
* all: go fix -fix=buildtag std cmd (except for bootstrap deps, vendor)Russ Cox2021-10-281-1/+0
| | | | | | | | | | | | | | | | | | | | | | | | When these packages are released as part of Go 1.18, Go 1.16 will no longer be supported, so we can remove the +build tags in these files. Ran go fix -fix=buildtag std cmd and then reverted the bootstrapDirs as defined in src/cmd/dist/buildtool.go, which need to continue to build with Go 1.4 for now. Also reverted src/vendor and src/cmd/vendor, which will need to be updated in their own repos first. Manual changes in runtime/pprof/mprof_test.go to adjust line numbers. For #41184. Change-Id: Ic0f93f7091295b6abc76ed5cd6e6746e1280861e Reviewed-on: https://go-review.googlesource.com/c/go/+/344955 Trust: Russ Cox <rsc@golang.org> Run-TryBot: Russ Cox <rsc@golang.org> TryBot-Result: Go Bot <gobot@golang.org> Reviewed-by: Bryan C. Mills <bcmills@google.com>
* syscall: implement Pipe using pipe2 syscall on all linux platformsTobias Klauser2021-09-171-22/+10
| | | | | | | | | | | | | | | | | | | | | Most architectures currently already implement Pipe using the pipe2 syscall. Only 386, amd64 and mips{,le} still use the pipe syscall. However, some systems (e.g. Android seccomp policies) block that syscall, see #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 #45964 so it is possible to unify the implementation of Pipe using the pipe2 syscall. For #45964 Change-Id: I8ed6a391300c95f3107b4ec6b27d320e42fb535b Reviewed-on: https://go-review.googlesource.com/c/go/+/350530 Trust: Tobias Klauser <tobias.klauser@gmail.com> Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com> TryBot-Result: Go Bot <gobot@golang.org> Reviewed-by: Ian Lance Taylor <iant@golang.org>
* all: go fmt std cmd (but revert vendor)Russ Cox2021-02-201-0/+1
| | | | | | | | | | | | | | | | Make all our package sources use Go 1.17 gofmt format (adding //go:build lines). Part of //go:build change (#41184). See https://golang.org/design/draft-gobuild Change-Id: Ia0534360e4957e58cd9a18429c39d0e32a6addb4 Reviewed-on: https://go-review.googlesource.com/c/go/+/294430 Trust: Russ Cox <rsc@golang.org> Run-TryBot: Russ Cox <rsc@golang.org> TryBot-Result: Go Bot <gobot@golang.org> Reviewed-by: Jason A. Donenfeld <Jason@zx2c4.com> Reviewed-by: Ian Lance Taylor <iant@golang.org>
* syscall: support POSIX semantics for Linux syscallsAndrew G. Morgan2020-10-231-50/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This change adds two new methods for invoking system calls under Linux: syscall.AllThreadsSyscall() and syscall.AllThreadsSyscall6(). These system call wrappers ensure that all OSThreads mirror a common system call. The wrappers serialize execution of the runtime to ensure no race conditions where any Go code observes a non-atomic OS state change. As such, the syscalls have higher runtime overhead than regular system calls, and only need to be used where such thread (or 'm' in the parlance of the runtime sources) consistency is required. The new support is used to enable these functions under Linux: syscall.Setegid(), syscall.Seteuid(), syscall.Setgroups(), syscall.Setgid(), syscall.Setregid(), syscall.Setreuid(), syscall.Setresgid(), syscall.Setresuid() and syscall.Setuid(). They work identically to their glibc counterparts. Extensive discussion of the background issue addressed in this patch can be found here: https://github.com/golang/go/issues/1435 In the case where cgo is used, the C runtime can launch pthreads that are not managed by the Go runtime. As such, the added syscall.AllThreadsSyscall*() return ENOTSUP when cgo is enabled. However, for the 9 syscall.Set*() functions listed above, when cgo is active, these functions redirect to invoke their C.set*() equivalents in glibc, which wraps the raw system calls with a nptl:setxid fixup mechanism. This achieves POSIX semantics for these functions in the combined Go and C runtime. As a side note, the glibc/nptl:setxid support (2019-11-30) does not extend to all security related system calls under Linux so using native Go (CGO_ENABLED=0) and these AllThreadsSyscall*()s, where needed, will yield more well defined/consistent behavior over all threads of a Go program. That is, using the syscall.AllThreadsSyscall*() wrappers for things like setting state through SYS_PRCTL and SYS_CAPSET etc. Fixes #1435 Change-Id: Ib1a3e16b9180f64223196a32fc0f9dce14d9105c Reviewed-on: https://go-review.googlesource.com/c/go/+/210639 Trust: Emmanuel Odeke <emm.odeke@gmail.com> Trust: Ian Lance Taylor <iant@golang.org> Trust: Michael Pratt <mpratt@google.com> Run-TryBot: Emmanuel Odeke <emm.odeke@gmail.com> Reviewed-by: Michael Pratt <mpratt@google.com> Reviewed-by: Austin Clements <austin@google.com>
* syscall: don't use deprecated syscalls on linux/arm64Tobias Klauser2019-10-081-71/+76
| | | | | | | | | | | | | Reimplement syscall wrappers for linux/arm64 in terms of supported syscalls (or in case of Ustat make it return ENOSYS) and remove the manually added SYS_* consts for the deprecated syscalls. Adapted from golang.org/x/sys/unix where this is already done since CL 119655. Change-Id: I94ab48a4645924df3822497d0575f1a1573d509f Reviewed-on: https://go-review.googlesource.com/c/go/+/199140 Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Ian Lance Taylor <iant@golang.org>
* syscall: move Renameat to syscall_linux_$GOARCH.goTobias Klauser2019-08-281-20/+20
| | | | | | | | | | | | | | | On linux/riscv64, the renameat syscall no longer exists and has been superseded by renameat2. Thus we'll have to use Renameat2 to implement Renameat on linux/riscv64 for #27532. Prepare for this by moving the Renameat definition to the GOARCH specific files. Follow CL 157899 which did the same for golang.org/x/sys/unix Change-Id: I9670213cc3987df48fee962ddee36915a7785560 Reviewed-on: https://go-review.googlesource.com/c/go/+/192077 Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
* syscall: support Faccessat flags argumentIan Lance Taylor2018-07-271-0/+15
| | | | | | | | | | | | | | | | | | The Linux kernel faccessat system call does not take a flags parameter. The flag parameter to the C library faccessat function is implemented in C. The syscall.Faccessat function takes a flags parameter. In older releases we have passed the flags parameter to the kernel, which ignored it. In CL 120015 we started returning an error if any flags were set. That seems clearly better than ignoring them, but it turns out that some code was using the flags. The code was previously subtly broken. Now it is obviously broken. That is better, but we can do better still: we can implement the flags as the C library does. That is what this CL does. Change-Id: I259bd6f240c3951e939b81c3032dead3d9c567b4 Reviewed-on: https://go-review.googlesource.com/126415 Run-TryBot: Ian Lance Taylor <iant@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
* syscall: implement pipe() on linux/mipsDavid Wimmer2018-07-261-0/+12
| | | | | | | | | | | | | | | Change the Pipe() function to use the pipe() syscall (which has a unique calling convention on linux/mips) instead of using pipe2(). This allows it work on kernels <2.6.27 when pipe2() was introduced. Change-Id: I65dfbd2a02b64e777a8eb13013d718e356521be6 GitHub-Last-Rev: c483a06168387c2cf151b6419e4e16576fab640a GitHub-Pull-Request: golang/go#26608 Reviewed-on: https://go-review.googlesource.com/125915 Run-TryBot: Ian Lance Taylor <iant@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Vladimir Stefanovic <vladimir.stefanovic@mips.com> Reviewed-by: Ian Lance Taylor <iant@golang.org>
* syscall: check faccessat flags parameter on LinuxTobias Klauser2018-06-211-15/+15
| | | | | | | | | | | | | | | | | | Port CL 119495 from golang.org/x/sys/unix to the syscall package. Currently Linux faccessat(2) syscall implementation doesn't support the flags parameter. As per the discussion in #25845, permit the same flags as glibc [1]. [1] https://sourceware.org/git/?p=glibc.git;a=blob;f=sysdeps/unix/sysv/linux/faccessat.c;h=ea42b2303ff4b2d2d6548ea04376fb265f773436;hb=HEAD Updates #25845 Change-Id: I132b33275a9cc72b3a97acea5482806c7f47d7f7 Reviewed-on: https://go-review.googlesource.com/120015 Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Ian Lance Taylor <iant@golang.org>
* syscall, internal/syscall: follow convention for generated code commentTobias Klauser2018-06-141-1/+1
| | | | | | | | | | | | Follow the convertion (https://golang.org/s/generatedcode) for generated code. Change-Id: I4ac8b99ac45f25dd2399d048ea831489e5394984 Reviewed-on: https://go-review.googlesource.com/118821 Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com> Reviewed-by: Alex Brainman <alex.brainman@gmail.com> Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org>
* syscall: check Fchmodat flags parameter on LinuxTobias Klauser2018-06-131-15/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | As mentioned in #25845, port CL 46474 from golang.org/x/sys/unix to the syscall package. Currently Linux' fchmodat(2) syscall implementation doesn't support the flags parameter (though it might in future versions [1]). Fchmodat in the syscall package takes the parameter and (wrongly) passes it on to the syscall which will ignore it. According to the POSIX.1-2008 manual page [2], AT_SYMLINK_NOFOLLOW is the only valid value for the flags parameter and EOPNOTSUPP should be returned in case changing the mode of a symbolic link is not supported by the underlying system. EINVAL should be returned for any other value of the flags parameter. [1] https://patchwork.kernel.org/patch/9596301/ [2] http://pubs.opengroup.org/onlinepubs/9699919799/functions/chmod.html Updates #20130 Updates #25845 Change-Id: I1021dd0e6a4f4cb3557cb1c1b34dd618c378cda6 Reviewed-on: https://go-review.googlesource.com/118658 Reviewed-by: Ian Lance Taylor <iant@golang.org>
* syscall: support Linux syscalls without error return on mipsx/mips64xTobias Klauser2018-06-131-8/+8
| | | | | | | | | | | | | | | | | Like on other architectures, use rawSyscallNoError for Linux syscalls that don't return an error and convert all applicable occurences of RawSyscall to use it instead. This was missed in CL 84485 because mkall.sh doesn't support mipsx/mips64x, so add the corresponding entries as well. Updates #22924 Change-Id: I762cbee0827140b9890c4a10830e0b4cd33de92f Reviewed-on: https://go-review.googlesource.com/118655 Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
* syscall: fix EpollWait for arm64Wei Xiao2018-06-041-17/+17
| | | | | | | | | | | | The SYS_EPOLL_WAIT syscall doesn't exist on arm64. This CL implements EpollWait with SYS_EPOLL_PWAIT syscall. Change-Id: Ica9107a58d7da45351fe2e900f59bec5b7b18f39 Reviewed-on: https://go-review.googlesource.com/115735 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: Brad Fitzpatrick <bradfitz@golang.org>
* syscall: 32-bit MIPS splice system call returns int, not int64Ian Lance Taylor2018-04-261-3/+3
| | | | | | | | Fixes #25106 Change-Id: I315817543b44aa581980828a32ecc224f8c0a44d Reviewed-on: https://go-review.googlesource.com/109316 Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
* syscall: use SYS_GETDENTS64 on linux/mips64{,le}Tobias Klauser2018-01-311-1/+1
| | | | | | | | | | | | | | | | | | | | The getdents64 syscall is only available for mips64/mips64le starting with Linux kernel 3.10. Since mips64le requires at least 4.8 according to [1] (regarding #16848) using it should be fine. [1] https://golang.org/wiki/MinimumRequirements This CL changes the binary layout of type Dirent for mips64/mips64le, but not the public API. But since the currently used layout doesn't match the struct linux_dirent returned by the getdents syscall this should be fine as well. Fixes #23624 Change-Id: Iaa7306fa6e4442ad2fed41c60b37627a7314f117 Reviewed-on: https://go-review.googlesource.com/91055 Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org> Reviewed-by: Cherry Zhang <cherryyz@google.com>
* syscall: make Exit call runtime.exitAlex Brainman2017-09-271-7/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | syscall.Exit and runtime.exit do the same thing. Why duplicate code? CL 45115 fixed bug where windows runtime.exit was correct, but syscall.Exit was broken. So CL 45115 fixed windows syscall.Exit by calling runtime.exit. Austin suggested that all OSes should do the same, and this CL implements his idea. While making changes, I discovered that nacl syscall.Exit returned error func Exit(code int) (err error) and I changed it into func Exit(code int) like all other OSes. I assumed it was a mistake and it is OK to do because cmd/api does not complain about it. Also I changed plan9 runtime.exit to accept int32 just like all other OSes do. Change-Id: I12f6022ad81406566cf9befcc6edc382eebd413b Reviewed-on: https://go-review.googlesource.com/66170 TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Ian Lance Taylor <iant@golang.org> Reviewed-by: Austin Clements <austin@google.com> Reviewed-by: David du Colombier <0intro@gmail.com>
* syscall: add missing int flag argument to utimensatYuval Pavel Zholkover2017-08-151-2/+2
| | | | | | | | | | Fixes #21437 Change-Id: I55fbf5114ae1bb7f4aa1a20450e8d5309756cd5b Reviewed-on: https://go-review.googlesource.com/55430 Run-TryBot: Ian Lance Taylor <iant@golang.org> Reviewed-by: Tobias Klauser <tobias.klauser@gmail.com> Reviewed-by: Ian Lance Taylor <iant@golang.org>
* syscall: remove "use" function and calls from generated code.Sameer Ajmani2017-02-091-40/+3
| | | | | | | | | | | | | | | | Update syscall code generators to set build tags. Regenerate zsyscall files, which makes the following changes: - remove calls to "use" - update build tags, adding missing ones in some cases - "stat" renamed to "st" in some cases - "libc_Utimes" renamed "libc_utimes" in one case I'll mirror this change to x/sys/unix once committed. Change-Id: Ic07e0ae1433dd133eb57e8dd2a3b86a62aab4eda Reviewed-on: https://go-review.googlesource.com/36616 Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
* syscall: fix name of prlimit parametersBrad Fitzpatrick2016-11-081-2/+2
| | | | | | | | | | Fixes #17606 Change-Id: I040c7621cef265d44b58f16556e6d58660a2245d Reviewed-on: https://go-review.googlesource.com/32889 Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Ian Lance Taylor <iant@golang.org>
* syscall: add support for GOARCH=mips{,le}Vladimir Stefanovic2016-11-031-0/+1759
Change-Id: I39a46b2a9412981db1780b688a86fec791f68b6f Reviewed-on: https://go-review.googlesource.com/31488 Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org> Reviewed-by: Cherry Zhang <cherryyz@google.com>