This is a copy of http://golang.org/cl/9870 in the syscall package.
This is in preparation for arm64 support, as the arm64 Linux kernel
does not have an inotify_init system call, only inotify_init1.
Update golang/go#10150.
Change-Id: I9224a094af79adbb2f5714ad977b195d5a941eb0
Reviewed-on: https://go-review.googlesource.com/10036
Reviewed-by: Rob Pike <r@golang.org>
This brings over three CLs from the main syscall package:
http://golang.org/cl/5833http://golang.org/cl/5835http://golang.org/cl/5837
Pipe, Pipe2, and Dup2 are moved from syscall_linux.go to the GOARCH
specific variants. On 386 and amd64, Linux kernel version 2.6.23 (the
documented minimum Linux kernel version the Go distribution supports)
does not support the pipe2 system call, so Pipe continues to call
pipe. On ARM, Pipe now calls pipe2.
Several system calls are reimplemented in terms of the *at syscalls,
passing AT_FDCWD to indicate that pathnames are to be interpreted
relative to the current directory. The *at syscalls were added in
Linux kernel version 2.6.16.
This is in preparation for arm64 support, as the arm64 Linux kernel
does not provide the traditional syscall variants.
Change-Id: Id6bc6097dc5f4324cd9e429c5e1f3a411a08ce42
Reviewed-on: https://go-review.googlesource.com/10032
Reviewed-by: Rob Pike <r@golang.org>
Includes 386, amd64, and arm for Linux.
Change-Id: I428bfb732141448659a94dc6e2ab7a98efea507a
Reviewed-on: https://go-review.googlesource.com/9766
Reviewed-by: Rob Pike <r@golang.org>
Reviewed-by: David Symonds <dsymonds@golang.org>
This CL adds the Utimensat syscall and AT_SYMLINK_NOFOLLOW constant.
This is required for setting the access/modification times on symlinks.
In addition, it updates the UtimesNano function to pass 0 as the flags
parameter, to avoid potentially passing junk.
Change-Id: I280645f3f53173628b1e1986bc7a47bac254fcf8
Reviewed-on: https://go-review.googlesource.com/9379
Reviewed-by: Rob Pike <r@golang.org>
Because ARM ABI requires 64-bit argument to be passed in even
register pairs, to avoid wasting one register between fd and
advise in the usual fadvise64 syscall signature, linux/arm
has its own variation that reorders the argument so that the
arguments fit in six registers.
While we're at it, also fix build for linux/386.
Fixesgolang/go#10294.
Change-Id: I322e2226619c5aa9c096a1d5cb7ae1e94fd4a5a1
Signed-off-by: Shenghou Ma <minux@golang.org>
Reviewed-on: https://go-review.googlesource.com/8282
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
The previous cherry-pick merge of fadvice from Gerrit added the
fadvise system calls, but from before the errno CL, which went in
concurrently.
Change-Id: I6f01e020bfe2930a8ea2fdbe4998ab9e2669ce14
Reviewed-on: https://go-review.googlesource.com/8199
Reviewed-by: Rob Pike <r@golang.org>
Support includes 386, amd64, and arm for both Linux and FreeBSD.
FreeBSD changes courtesy Dave Chapeskie <dchapeskie@gmail.com>
Change-Id: I89dc18533d7178e74ae6c442a2e6272c9bd9692c
Reviewed-on: https://go-review.googlesource.com/8055
Reviewed-by: Rob Pike <r@golang.org>
This avoids hanging when a Go program uses a FUSE filesystem and the
dup system call has to close a file descriptor. When dup uses
RawSyscall then the goroutine calling dup will occupy a scheduler slot
(a p structure) during the call, and may block waiting for some other
goroutine to respond to the close call on the FUSE filesystem.
Changing to Syscall avoids the problem. This makes Dup a tiny bit
slower but is quite unlikely to make a difference for any real
programs.
Update golang/go#10202.
Change-Id: I590c5c9a04e0a1281a85dc553c7592fa83949ac7
Reviewed-on: https://go-review.googlesource.com/8056
Reviewed-by: Rob Pike <r@golang.org>
Some Linux architectures (e.g. arm64) don't have the getpgrp syscall,
use getpgid(0) to emulate it.
Update golang/go#10150.
This brings CL 8022 that has been applied to the syscall package to
x/sys.
Change-Id: I24c6d7e8b5b2f075ca4e68b142b2e03ab8a43342
Signed-off-by: Shenghou Ma <minux@golang.org>
Reviewed-on: https://go-review.googlesource.com/8023
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Import syscall so that Kill can refer to syscall.Signal. Drop
termios constants from types_linux.go--all other systems get
them from mkerrors.sh.
Fixesgolang/go#8865.
LGTM=r
R=r
CC=golang-codereviews
https://golang.org/cl/152980044
If we use a local type, it won't compare properly with errors from
the rest of the standard library. Errors are the one type from syscall
that propagates through the system, so it's important to have only
one type for them.
Ditto for syscall.Signal.
LGTM=dave
R=rsc, dave
CC=golang-codereviews
https://golang.org/cl/123490043
Semi-automatic migration from package syscall to package {plan9,windows,unix}.
No builds attempted yet, but this gets a lot of noise behind us so subsequent
CLs will be more concise and easier to follow.
Subsequent CLs will have semantic content.
LGTM=rsc
R=golang-codereviews, rsc
CC=golang-codereviews
https://golang.org/cl/121520043
This CL copies to each package of go.sys the files from syscall it will need.
Different directories have different files, but these:
mkall.sh
str.go
syscall.go
mksyscall.pl
race.go
race0.go
syscall_test.go
are copied to all three.
No changes yet, these are just copies. They are not ready to use yet:
package names are wrong, for starters. But this clean copy will make
it easier to follow the changes as the packages are enabled.
LGTM=rsc
R=golang-codereviews, rsc
CC=golang-codereviews
https://golang.org/cl/126960043