Commit Graph

221 Commits

Author SHA1 Message Date
Tobias Klauser
0b25a408a5 unix: add Eventfd function on Linux
Add support for the eventfd2 syscall on Linux.

Use the eventfd2 syscall instead of eventfd, as the latter does not
provide a flags argument and glibc also maps its eventfd() function to
the eventfd2 syscall, see the Notes section in
http://man7.org/linux/man-pages/man2/eventfd.2.html

Also add the corresponding flags values EFD_CLOEXEC, EFD_NONBLOCK and
EFD_SEMAPHORE.

Change-Id: Ia8c99e68d5966ab5c7ebe7e45423943fd7d8214e
Reviewed-on: https://go-review.googlesource.com/45093
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
2017-06-08 16:48:03 +00:00
Tobias Klauser
b9e8d468b0 unix: add additional rlimit resource constants
Add the following additional Getrlimit/Setrlimit resource constants (see
http://man7.org/linux/man-pages/man2/getrlimit.2.html):

  RLIMIT_LOCKS
  RLIMIT_MEMLOCK
  RLIMIT_MSGQUEUE
  RLIMIT_NICE
  RLIMIT_NPROC
  RLIMIT_RSS
  RLIMIT_RTPRIO
  RLIMIT_RTTIME
  RLIMIT_SIGPENDING

Fixes golang/go#14854

Change-Id: I302ff67d6d1b11d94f18614490fbd634a8caec19
Reviewed-on: https://go-review.googlesource.com/45052
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
2017-06-07 14:18:10 +00:00
Tobias Klauser
b90f89a1e7 unix: add missing xattr symlink syscall functions on Linux
Add support for the lgetxattr, llistxattr, lremovexattr and lsetxattr on
Linux, akin to the already existing getxattr, listxattr, removexattr and
setxattr syscalls.

These variants are identical to the already existing variants. except in
the case of a symbolic link where the extended attribute operation is
applied to the link itself rather than to the file that it refers to.
See:

  http://man7.org/linux/man-pages/man2/getxattr.2.html
  http://man7.org/linux/man-pages/man2/listxattr.2.html
  http://man7.org/linux/man-pages/man2/removexattr.2.html
  http://man7.org/linux/man-pages/man2/setxattr.2.html

Fixes golang/go#14116

Change-Id: I786953db8bf862566f54bdd745cc1feca5031be7
Reviewed-on: https://go-review.googlesource.com/44374
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
2017-05-29 18:51:10 +00:00
Matt Layher
a55a760868 unix: add IoctlGetInt and IoctlSetInt on Linux
This CL adds basic integer get/set functions which wrap a generic
ioctl call.  The API is similar the one introduced for solaris/amd64
in CL 14587, but the request parameter has been changed to a uint
instead of an int.  This makes requests with a number larger than the
maximum signed 32-bit integer work on linux/386.

For consistency, the solaris/amd64 API has also been updated to make
use of a uint instead of an int for the request number.

Fixes golang/go#20474

Change-Id: Iaae1ee2e4bb4bfcc420dcec252fe53c8d90ce81d
Reviewed-on: https://go-review.googlesource.com/44009
Run-TryBot: Matt Layher <mdlayher@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2017-05-24 19:12:47 +00:00
helloPiers
dbc2be9168 windows/svc/mgr: correct documentation for args parameter of Mgr.CreateService
The args passed to Mgr.CreateService end up as the command-line
arguments (available via os.Args), not as the args passed to
Svc.Handler.Execute.

Fixes golang/go#20440

Change-Id: I55a1ec3432b377082c018fe960114c96350e8978
Reviewed-on: https://go-review.googlesource.com/43714
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2017-05-21 16:21:43 +00:00
Joe Richey joerichey@google.com
a2e06a18b0 unix: add bindings for keyutils syscalls
This CL adds support for the ADD_KEY, REQUESET_KEY, and KEYCTL syscalls.
These syscalls allow access to the kernel keyring facilities. In C code,
these syscalls are wrapped by the libkeyutils package. See:
	http://man7.org/linux/man-pages/man7/keyutils.7.html

The ADD_KEY and REQUEST_KEY calls are fairly straightforward, but the
KEYCTL syscall is a multiplexor for a number of key management
functions. See:
	http://man7.org/linux/man-pages/man3/keyctl.3.html

The Go bindings for the KEYCTL functions attempt to replicate what
libkeyutils does. This is done via generated helper functions.

Change-Id: If8c97d4ef5bce14c43dee3e6772ded42dc3c595a
Reviewed-on: https://go-review.googlesource.com/41415
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
2017-05-18 22:39:15 +00:00
Julian Pastarmov
e62c3de784 windows: use RegisterServiceCtrlHandlerEx to allow for advanced notifications
This allows services written with this library to register for more
advanced notifications like SERVICE_CONTROL_DEVICEEVENT for example.

Also the code now exposes the service status handle through a new
api call, because the handle is needed to register for such
notifications and can not be obtained by any other means.

Change-Id: I80796e1dd9d94ec9d6c236d0413b17288c67fe1f
Reviewed-on: https://go-review.googlesource.com/42812
Reviewed-by: Alex Brainman <alex.brainman@gmail.com>
Run-TryBot: Alex Brainman <alex.brainman@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
2017-05-18 05:52:01 +00:00
Mikio Hara
98b5b1e7e8 windows/svc/mgr: gofmt -w -s
Change-Id: I4ef179aacaf0694cd7661b4d9972ce85abeee8df
Reviewed-on: https://go-review.googlesource.com/43470
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Run-TryBot: Mikio Hara <mikioh.mikioh@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
2017-05-17 08:38:02 +00:00
Sean Chittenden
1e99a4f9d2 unix: add Illumos statvfs(2) syscall
Reference: https://www.illumos.org/man/2/statvfs

Change-Id: If7af43da35b3204f5069a48eb08426a145544008
Reviewed-on: https://go-review.googlesource.com/43490
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
2017-05-14 20:02:00 +00:00
Derek McGowan
f845067cf7 unix: add Linux CopyFileRange syscall
Introduces the CopyFileRange syscall which first appears in Linux 4.5.
Allows copying file content between file descriptors within the kernel
without transferring data to user space. This syscall also allows the
kernel to take advantage of reflinking or other fast copy methods on
supported file systems.
http://man7.org/linux/man-pages/man2/copy_file_range.2.html

Change-Id: Id365f1e5d4d5ddf7159478e3a13084c9576ebd5c
Reviewed-on: https://go-review.googlesource.com/39992
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2017-05-12 18:10:32 +00:00
James Cowgill
156c5a2da4 unix: use struct pt_regs for PtraceRegs on mips
On mips, "struct user" bears no relation to the actual structure used by
PTRACE_GETREGS. The real structure is "struct pt_regs" which is declared
in asm/ptrace.h

Fixes golang/go#20338.

Change-Id: I604d27bd2b0a0903784380cbd3fa2fd9b9811fa5
Reviewed-on: https://go-review.googlesource.com/43431
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
2017-05-12 16:47:49 +00:00
James Cowgill
6b7068925c unix: add missing dup2 syscall on mips64*
After this commit the testsuite passes on mips64le.

Fixes golang/go#20340.

Change-Id: I6b3f673674af107fd6d249ccf5e695e0e50a41bb
Reviewed-on: https://go-review.googlesource.com/43430
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
2017-05-12 16:37:50 +00:00
Tamir Duberstein
1e4778a9a1 windows: add LoadGetSystemTimePreciseAsFileTime
Useful since GetSystemTimePreciseAsFileTime is Windows 8+.

Change-Id: I736bd0668aaf6ad086f6465b8b9a17f1943f0570
Reviewed-on: https://go-review.googlesource.com/43312
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2017-05-12 16:22:00 +00:00
Mikio Hara
9c9d83fe39 unix: fix Send{msg,msgN}, Recvmsg and control message handling on solaris
This is a backport of https://go-review.googlesource.com/30171.

Updates golang/go#7402.

Change-Id: I4e79570964c248ec52acf14d0ed8306e52073a51
Reviewed-on: https://go-review.googlesource.com/43212
Run-TryBot: Mikio Hara <mikioh.mikioh@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
2017-05-11 21:48:29 +00:00
Mikio Hara
f888ac0c35 unix: fix vet warnings on solaris
Fixes golang/go#17252.

Change-Id: I244c14d531542ea154f82e402059f4bc999241e2
Reviewed-on: https://go-review.googlesource.com/43211
Run-TryBot: Mikio Hara <mikioh.mikioh@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2017-05-11 21:48:19 +00:00
Mikio Hara
1343be6f13 unix: sync with SunOS 5.11 kernel
Change-Id: If732030e7ed8f1ba4ce09d4efc5b132d5f48fd8a
Reviewed-on: https://go-review.googlesource.com/43210
Run-TryBot: Mikio Hara <mikioh.mikioh@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
2017-05-11 21:48:05 +00:00
Mikio Hara
9ccfe848b9 unix: sync with DragonFly BSD 4.8 kernel
Also adds support for accept4 system call.

Change-Id: Ib4f15a3ac47ad2fa86ac2f22331a061ddda12d82
Reviewed-on: https://go-review.googlesource.com/41833
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2017-04-27 04:18:56 +00:00
Mikio Hara
9141ece15e unix: fix mkall.sh and mksyscall.pl
Each language has its own operators.

Change-Id: I765d4d56aeafe693d22914de7ee970d7b1928a25
Reviewed-on: https://go-review.googlesource.com/41832
Reviewed-by: Ian Lance Taylor <iant@golang.org>
2017-04-27 04:04:42 +00:00
Ian Lance Taylor
9f30dcbe5b unix: fix build on DragonFly BSD
The code was broken such that it didn't compile. With this fix, it compiles.

Fixes golang/go#20055.

Change-Id: I9aeb4900f2c99b2ad254be75b4987913cae71e14
Reviewed-on: https://go-review.googlesource.com/41672
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2017-04-25 13:52:08 +00:00
joerichey@google.com
8c0a5eacba unix: add support for Linux filesystem encryption
This CL adds in the necessary types and constants to support Linux
filesystem encryption. This includes the structs for the keys and
polices as well as the constants for key size and encryption algorithms.

This code also reduces the scope of some of the regexes in mkerrors.sh.
This is to reduce the number of unrelated constants added in with this
change.

Note that due to a bug in the Linux uapi headers, not all of the
necessary constants and structures are declared in linux/fs.h despite
being part of the kernel ABI. This means that some constants and types
had to be manually added in.

The bug has been patched (https://patchwork.kernel.org/patch/9662723),
and the manual additions can be removed when the patch is merged into
the mainline kernel.

Change-Id: Ib508ad99bdf4c0068933ffcf351c52bb359cfcf4
Reviewed-on: https://go-review.googlesource.com/41417
Reviewed-by: Matt Layher <mdlayher@gmail.com>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Run-TryBot: Matt Layher <mdlayher@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
2017-04-24 22:03:05 +00:00
Joe Richey
ea9bcade75 unix: generate all Linux go files from source
Right now the process for adding in new constants, errors, or syscalls
for Linux is a pain and unreliable. The scripts are designed to be run
on the target architecture and use the header files installed on the
user's system. This makes it hard to generate files for all the
architectures or to have consistency between users. See golang/go#15282.

This CL fixes this issue by making all of the files for the 11 supported
architectures directly from source checkouts of Linux, glibc, and bluez.
This is done using Docker, the gcc cross-compilers, and qemu emulation.
Previously discussed here:
    https://go-review.googlesource.com/c/37589/

A README.md file is also added to explain how all the parts of the build
system work.

In order to get the build working for all the architectures, I made
some changes to the other scripts called from mkall_linux.go:
  - Files only used for generating linux code, moved to linux/
  - linux/mksysnum.pl supports a specified CC compiler.
  - The generated C code in mkerrors.sh changed to avoid a warning
  - mkerrors.sh headers changed to fix powerpc64 bug in sys/ioctl.h
  - linux/types.go no longer needs to export Ptrace structs in lowercase

Build instructions:
  - Host system needs to be x86-64 Linux
  - Install Docker (https://docs.docker.com/engine/installation/)
  - ./mkall.sh (That's it!!!)

Change-Id: I87067c14442ba12f8d51991349a43a9d73f38ae0
Reviewed-on: https://go-review.googlesource.com/37943
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
2017-04-21 00:52:44 +00:00
Tamir Duberstein
f3918c30c5 windows: add SetStdHandle
https://msdn.microsoft.com/en-us/library/windows/desktop/ms686244(v=vs.85).aspx

Change-Id: If7d460a9fb43767c0a3ee55e86faf3356162c81d
Reviewed-on: https://go-review.googlesource.com/39609
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
2017-04-07 05:08:50 +00:00
Tamir Duberstein
ff24cb3cd8 windows: correct GetStdHandle definition
GetStdHandle: https://msdn.microsoft.com/en-us/library/windows/desktop/ms683231(v=vs.85).aspx
DWORD: https://msdn.microsoft.com/en-us/library/windows/desktop/aa383751(v=vs.85).aspx

Change-Id: I2fb794f85418e7846687911c4513886eb1803770
Reviewed-on: https://go-review.googlesource.com/39608
Reviewed-by: Alex Brainman <alex.brainman@gmail.com>
Run-TryBot: Alex Brainman <alex.brainman@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
2017-04-07 04:52:13 +00:00
Jason Chu
7de4796419 unix: add mips and mipsle to endian files
golang.org/x/sys/unix currently does not compile on mips nor mipsle as it fails to set the `isBigEndian` variable. This is due to mips and mipsle being missing in the build tag of their respective endian files.

This change adds mips to the build tag of `endian_big.go` and mipsle to the build tag of `endian_little.go` to fix this issue.

Change-Id: I79947cedb2645e80143e65bde00f2c95261125fb
Reviewed-on: https://go-review.googlesource.com/39730
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2017-04-06 17:19:08 +00:00
Tamir Duberstein
39e3dc2744 windows: add GetSystemTimePreciseAsFileTime
https://msdn.microsoft.com/en-us/library/windows/desktop/hh706895(v=vs.85).aspx

Change-Id: I6e6a6642c041fad046ae7db725a27e7e94bfbfba
Reviewed-on: https://go-review.googlesource.com/39610
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
2017-04-05 18:25:37 +00:00
Chris Manghane
493114f682 unix: add GetsockoptTCPInfo
Change-Id: I190098a4a969a706c555e48d2ad938d41017601e
Reviewed-on: https://go-review.googlesource.com/39195
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
2017-04-03 20:51:32 +00:00
Koki Ide
9a7256cb28 unix: validate ParseDirent inputs
This is a copy of https://golang.org/cl/23780 for the x/sys repo.

Don't panic, crash, or return references to uninitialized memory when 
ParseDirent is passed invalid input.

Updates golang/go#15653
Fixes golang/go#19754

Change-Id: Idb7cffe14d48ed662e5a55ecb5249c1907cf4003
Reviewed-on: https://go-review.googlesource.com/38758
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2017-03-29 06:16:34 +00:00
Agis Anastasopoulos
afadfcc777 unix: add PtracePeekUser
Fixes golang/go#14459

Change-Id: I9809340141dd5704d5a32a079486a1f889725541
Reviewed-on: https://go-review.googlesource.com/38638
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
2017-03-25 17:05:18 +00:00
Yestin
8fd966b47d unix: add support for OpenBSD pledge
Pledge, the privilege-restricting syscall and mitigation mechanism,
was missing from syscall_openbsd.go. As of the latest release, it
is officially supported in "stable".

More information about the call itself, and hence its importance,
can be found at:

http://www.openbsd.org/papers/hackfest2015-pledge/mgp00001.html

Change-Id: I2fdac1968664668e7bea1175677efe6433e0125e
Reviewed-on: https://go-review.googlesource.com/21815
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2017-03-22 23:48:10 +00:00
Matt Layher
99f16d856c unix: SockaddrVM uses "context ID" terminology instead of "client ID"
"When the client creates a connection, instead of providing an IP address
to choose its server, the client must provide the context ID (CID) of a
virtual machine or host."
Reference:
https://pubs.vmware.com/vsphere-60/topic/com.vmware.ICbase/PDF/ws9_esx60_vmci_sockets.pdf

Change-Id: Ia2dfe015594e0ca43a3c8acec1f43d418f5781af
Reviewed-on: https://go-review.googlesource.com/37864
Reviewed-by: Ian Lance Taylor <iant@golang.org>
2017-03-08 15:33:27 +00:00
Matt Layher
d67a3279ae unix: implement Linux AF_VSOCK sockets
Adds the required constants and new SockaddrVM type for working
with Linux VM sockets.  For more information, see:
https://vmsplice.net/~stefan/stefanha-kvm-forum-2015.pdf.

Fixes golang/go#19434

Change-Id: I9aefb35441b2c7dc412bdfb806ebe08d5c20f6b1
Reviewed-on: https://go-review.googlesource.com/37937
Run-TryBot: Matt Layher <mdlayher@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
2017-03-08 01:50:38 +00:00
Michael Stapelberg
e48874b424 unix: add BLK* Linux ioctls
These are useful for re-reading partition tables and getting device
sizes.

Fixes golang/go#19370

Change-Id: Ia8dbe3416a48dbdbceafa0fff0131d71057d97ca
Reviewed-on: https://go-review.googlesource.com/37640
Reviewed-by: Ian Lance Taylor <iant@golang.org>
2017-03-03 13:59:30 +00:00
Joe Richey
76cc09b634 unix: add Getrandom syscall bindings and flags
This CL introduces the Getrandom syscall. Allowing users of
sufficiently new kernels (3.17) to detect when the operating system
lacks enough entropy to generate cryptographic random data. See:
http://man7.org/linux/man-pages/man2/getrandom.2.html

As we have updated the syscall numbers, the Getrandom function can
just be generated normally. The only other change is to mkerrors.sh
to include the GRND_* flags for getrandom from <linux/random.h>.

It is important to note that currently the mkerrors.sh script cannot
actually be run as it has fallen behind the 4.10 kernel. The GRND_*
flags were added manually.

This was originally part of a larger commit that was split up.
See CL: https://go-review.googlesource.com/37570

Change-Id: I464088a9c9f7224abdcdae476b30a4f2f412d9f5
Reviewed-on: https://go-review.googlesource.com/37589
Reviewed-by: Matt Layher <mdlayher@gmail.com>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Run-TryBot: Matt Layher <mdlayher@gmail.com>
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
2017-03-01 01:59:58 +00:00
Joe Richey
21f2569f6f unix: update syscall numbers to 4.10 kernel
The syscall numbers for Linux were out of date, so with the release of
the 4.10 kernel, now seemed like a reasonable time to update them. Note
that this change is mostly additive except that it removes some invalid
syscalls for arm, and it removes all constants that refer to either the
syscall base or total number of syscalls. Previous versions had only
removed some of them.

The updated syscall numbers were pulled directly from a header build
of the 4.10 kernel. This required some minor adjustements to the sysnum
generating perl script and is why the comments at the tops of the
generated files look slightly different. I could include the script I
used to do this, but right now it cannot generate the zerrors and ztypes
files.

Change-Id: Id94b967eb917f8f87500f818f2e494df9bccf2e0
Reviewed-on: https://go-review.googlesource.com/37570
Reviewed-by: Ian Lance Taylor <iant@golang.org>
2017-02-28 21:18:07 +00:00
Matt Layher
e4594059fe unix: add missing netlink constants on Linux
Fixes golang/go#19262

Change-Id: I67ceb187cd68e90a9387a706a89aafded0befe53
Reviewed-on: https://go-review.googlesource.com/37344
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
Run-TryBot: Matt Layher <mdlayher@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
2017-02-23 22:51:00 +00:00
Matt Layher
075e574b89 unix: implement Vmsplice, add SPLICE_F_* constants
Fixes golang/go#19125

Change-Id: I822b6f260f980178da29a552c6170cb261c8e254
Reviewed-on: https://go-review.googlesource.com/37152
Run-TryBot: Matt Layher <mdlayher@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
2017-02-17 00:34:42 +00:00
Matt Layher
e24f485414 unix: add support for AF_ALG sockets on Linux
Fixes golang/go#19033.

Change-Id: Icbd249f63cd4a9035a1decaa8bf4c521303b4494
Reviewed-on: https://go-review.googlesource.com/36805
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2017-02-13 22:57:39 +00:00
Sameer Ajmani
0ed46b70d9 unix: delete asm.s
This contains a stub for func "use", which was deleted.

See issue https://golang.org/issue/16607

Change-Id: I7165ca55ad956ac449e950f2be6f53cfeb8e6ffa
Reviewed-on: https://go-review.googlesource.com/36720
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2017-02-13 21:28:12 +00:00
Maxime de Roucy
ce7380f5b0 x/sys/unix: add fallocate constants
Add FALLOC_* constants from /usr/include/linux/falloc.h to use with
Fallocate (golang.org/x/sys/unix package).

Fix golang/go#10599

Change-Id: Ie001e554250bb12472c612adcb4b79c6f72cac34
Reviewed-on: https://go-review.googlesource.com/36336
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2017-02-13 20:02:47 +00:00
Sameer Ajmani
aaabbdc969 x/sys/unix: remove the "use" function and its calls.
Update mksyscall*.pl to skip generating calls to "use".
Make build tag handling match what's used in the syscall package.

See issue https://golang.org/issue/16607
and CL https://golang.org/cl/36616

Change-Id: I2d2e823fe1846d2110c07eb1bf976852706ecf60
Reviewed-on: https://go-review.googlesource.com/36715
Run-TryBot: Sameer Ajmani <sameer@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
2017-02-10 16:30:38 +00:00
Steven Hartland
7a6e5648d1 unix: fix SysctlUint64 on 32bit machines
TestSysctlUint64 was using vm.max_kernel_address which is only 64bit
on 64bit machines or 32bit machines with PAE. Switch to using
security.mac.labeled which is a SYSCTL_UQUAD so 64bit on all platforms.

Also:
* Correct typo in test name.

Fixes golang/go#15186

Change-Id: I88b5b6ee6a04dec0730bca1e1f0e282f3c18d20d
Reviewed-on: https://go-review.googlesource.com/36058
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
2017-02-01 05:12:45 +00:00
Samuel Tan
d75a526598 x/sys/unix: move gccgo redeclared functions to separate files
These functions are redeclared in gccgo builds, so move them
to separate files with the "!gccgo" build constraint.

Fixes golang/go#18312

Change-Id: I868cfb77fc394e5e96cee78af0f3abf43db6082a
Reviewed-on: https://go-review.googlesource.com/34379
Reviewed-by: Ian Lance Taylor <iant@golang.org>
2016-12-14 19:05:18 +00:00
Vladimir Stefanovic
478fcf5431 x/sys/unix: added linux/mips{,le} support
Change-Id: Ibf7a9e16ba0e1dde922748a34d61e197a985ed40
Reviewed-on: https://go-review.googlesource.com/33952
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2016-12-05 17:08:28 +00:00
Alex Brainman
f5a6bd4305 windows/registry: add code to access remote pc registry
Introduce OpenRemoteKey function that opens some
root registry keys on remote computer.

Also add PERFORMANCE_DATA key, since it is one of
root keys accessible via OpenRemoteKey.

Change-Id: I738fdfee52a34acd4dc09ddb91fcf0e4c707bd83
Reviewed-on: https://go-review.googlesource.com/33814
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
2016-12-04 22:43:27 +00:00
Alex Brainman
ca83bd2cb9 windows: run "go generate"
Change-Id: Ide01e409af85a5e2615ba647b44eda67bc14c07f
Reviewed-on: https://go-review.googlesource.com/33812
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
2016-12-02 08:03:26 +00:00
Julian Kornberger
d564595380 unix: Use syscall.SysctlRaw in Sysctl
Remove redundant code

Fixes golang/go#18053

Change-Id: Ic8a2b85819ce86e5ebf2cc6274c604fdb69a5495
Reviewed-on: https://go-review.googlesource.com/33612
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
2016-11-29 18:14:19 +00:00
Elliot Morrison-Reed
30237cf4ee x/sys/unix: added SockaddrCAN struct to allow creation of AF_CAN sockets
Fixes golang/go#16188

Change-Id: I396ccbf6ce14147bc03ecdf180c2657c22b477b4
Reviewed-on: https://go-review.googlesource.com/33392
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
2016-11-22 21:48:34 +00:00
Alexander Menzhinsky
b699b70325 x/sys/unix: add Getsid on linux
Fixes golang/go#17872

Change-Id: I4bfe7b47c36c3d2f0c08a2adeba595231e507b81
Reviewed-on: https://go-review.googlesource.com/33050
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2016-11-10 16:12:52 +00:00
Ian Lance Taylor
9a2e24c373 unix: fix name of prlimit parameters
Update golang/go#17606.

Change-Id: I922525561d81a8b7d805729028825953424f6ecc
Reviewed-on: https://go-review.googlesource.com/32912
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Rob Pike <r@golang.org>
2016-11-08 15:13:28 +00:00
Alexander Neumann
c200b10b5d unix: Add FADV_* constants for linux/arm
This is a followup commit for 9eef40adf0
and adds the constants needed for fadvise() on Linux for ARM that were
missing.

Fixes golang/go#16816

Change-Id: Ib7409f48bc07511d7014cb5791a6cc117a9a471e
Reviewed-on: https://go-review.googlesource.com/31641
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
2016-10-23 15:05:41 +00:00