Commit Graph

88 Commits

Author SHA1 Message Date
Ian Lance Taylor
8bcc2dbee4 unix: add arm64 and ppc64le build tags as needed for Go 1.4
Go1.4 does not recognize arm64 and ppc64le as valid GOARCH values, so
we need explicit build tags.

Change-Id: I1a886c132ae398d9f92b2c2b33d2a4827bbdb9d4
Reviewed-on: https://go-review.googlesource.com/10083
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2015-05-14 20:02:06 +00:00
Alex Brainman
76b6ca6286 unix: include export_test.go only during unix build
Fixes plan9 and windows build.

Change-Id: I3d913441a4f3f3f3da82ab74ef165b91d05eb8d3
Reviewed-on: https://go-review.googlesource.com/10078
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2015-05-14 06:54:30 +00:00
Alex Brainman
1caf55eba1 windows: use FILE_FLAG_BACKUP_SEMANTICS in Utimes/UtimesNano
This is a copy of https://golang.org/cl/154020043 in the syscall package.

Fixes golang/go#10804

Change-Id: I6f6177e30c105c8065fdc8cc351e899090e160a9
Reviewed-on: https://go-review.googlesource.com/10076
Reviewed-by: Minux Ma <minux@golang.org>
2015-05-14 05:04:03 +00:00
Ian Lance Taylor
4cd067a709 unix: add ppc64le/linux support
This incorporates changes from https://golang.org/cl/123290043 and
https://golang.org/cl/127320043.

Files generated on Ubuntu Trusty.

Change-Id: I669c60714e857ef5f06515cd3b65dfc94785e179
Reviewed-on: https://go-review.googlesource.com/10060
Reviewed-by: Rob Pike <r@golang.org>
2015-05-14 00:30:18 +00:00
Ian Lance Taylor
9907ecf448 unix: add arm64/linux support
This incorporates generation script changes from
http://golang.org/cl/7143.

Files generated on Ubuntu Trusty.

Change-Id: I28cfa0993573e1b280c549a67f453c0fb01dee2f
Reviewed-on: https://go-review.googlesource.com/10038
Reviewed-by: Rob Pike <r@golang.org>
2015-05-13 23:16:16 +00:00
Ian Lance Taylor
f2b45db810 unix: update generation scripts for arm64/ppc64
This applies the following CLs from the syscall package:
http://golang.org/cl/9962
http://golang.org/cl/9966
http://golang.org/cl/9924

It also adds arm64/ppc64 support to mkall.sh and mksysnum_linux.pl.

Change-Id: I84fbfde2a2876dbf6d16c6159e847195c274b396
Reviewed-on: https://go-review.googlesource.com/10037
Reviewed-by: Rob Pike <r@golang.org>
2015-05-13 22:31:45 +00:00
Ian Lance Taylor
04f0f96bfa unix: move InotifyInit into GOARCH specific Linux files
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>
2015-05-13 22:15:23 +00:00
Ian Lance Taylor
44366790d7 unix: correct code for cover cmd
This copies http://golang.org/cl/8723 from the syscall package.

Quoting the original CL:

    This is clumsy, but currently cover tool fails as:

    $ go test -run=none -cover syscall
    syscall_linux_amd64.go:15: can only use //go:noescape with external func imp
    FAIL        syscall [build failed]

    This happens because cover tool mishandles //go: comments.
    r and gri said that fixing cover is infeasible due to go/ast limitations.

    So at least fix the offending code so that coverage works.
    This come up in context of coverage-guided fuzzing which works best
    with program-wide coverage.

Change-Id: Id9e243968a4eb7ae75a585877fdf3192c89e419c
Reviewed-on: https://go-review.googlesource.com/10035
Reviewed-by: Rob Pike <r@golang.org>
2015-05-13 22:08:58 +00:00
Ian Lance Taylor
b10968a446 unix: split Pipe/Pipe2/Dup2, use *at replacement calls
This brings over three CLs from the main syscall package:
http://golang.org/cl/5833
http://golang.org/cl/5835
http://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>
2015-05-13 21:31:04 +00:00
Ian Lance Taylor
082a6a3a8b unix: fix infinite recursion in itoa
Bring in http://golang.org/cl/138650044 from syscall package.

Change-Id: I554b0b31b981c682b6826644564971321a55c9e4
Reviewed-on: https://go-review.googlesource.com/10030
Reviewed-by: Rob Pike <r@golang.org>
2015-05-13 20:12:53 +00:00
Ian Lance Taylor
3dec8fc77c unix: fix TestSCMCredentials
Port http://golang.org/cl/9714 from the main syscall package.

Change-Id: I85e3f119777b0e1f52dfd10365fd30c900120dc2
Reviewed-on: https://go-review.googlesource.com/9961
Reviewed-by: Minux Ma <minux@golang.org>
2015-05-12 03:31:30 +00:00
Ian Lance Taylor
b65462c961 unix: add Syscall9 for gccgo
I meant to do this earlier but forget to "git add".

Change-Id: I14b777b5b9fa5b121809c5821719da3ec4a5e0ce
Reviewed-on: https://go-review.googlesource.com/9960
Reviewed-by: Minux Ma <minux@golang.org>
Reviewed-by: Rob Pike <r@golang.org>
2015-05-12 03:04:57 +00:00
Ian Lance Taylor
e11762ca30 unix: add gccgo support
With these changes the package builds, and the tests pass, using gccgo
on amd64 GNU/Linux.  I have not tested other systems but I don't know
why they wouldn't work.

Change-Id: I727365daef55f158657eb89afbfcdbf3334610d1
Reviewed-on: https://go-review.googlesource.com/9842
Reviewed-by: Minux Ma <minux@golang.org>
Reviewed-by: Rob Pike <r@golang.org>
2015-05-07 23:38:20 +00:00
Damien Neil
f2654f8719 unix: add clock_gettime for Linux
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>
2015-05-06 23:20:22 +00:00
Peter Waller
0a2b4af5eb unix/amd64: add Utimensat call, pass 0 for flags
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>
2015-05-05 17:43:46 +00:00
Alex Brainman
65705ef9e9 windows/svc: add new package to help create and manage Windows services
Change-Id: I58bb446aaa387b31d8a9ff4217793a170b96a7e2
Reviewed-on: https://go-review.googlesource.com/9104
Reviewed-by: Rob Pike <r@golang.org>
2015-05-01 05:26:56 +00:00
Alex Brainman
bbc47fbbc8 windows/registry: mark string end with 0 before calling Windows ExpandEnvironmentStrings
Change-Id: I02bfcdeac44167d1dbeb15bcd5c82111fba3f527
Reviewed-on: https://go-review.googlesource.com/9234
Reviewed-by: Rob Pike <r@golang.org>
2015-04-23 02:52:27 +00:00
Alex Brainman
e961698092 windows/registry: add new package to manipulate Windows registry
Change-Id: Ia7c3d6250c041b95aa43ca5ca2a92251c480ef77
Reviewed-on: https://go-review.googlesource.com/8843
Reviewed-by: Rob Pike <r@golang.org>
2015-04-15 07:18:44 +00:00
David du Colombier
7353fe07c1 plan9: make pwd process-wide on Plan 9
From main repo: https://go-review.googlesource.com/#/c/6350
                https://go-review.googlesource.com/#/c/6385

Change-Id: Ieba5ff60fc501be9aa4739860c8fe026f8b3eb67
Reviewed-on: https://go-review.googlesource.com/8721
Reviewed-by: Rob Pike <r@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2015-04-12 18:03:11 +00:00
David du Colombier
d3c664b24d plan9: reduce the set of architecture-dependent files on Plan 9
From main repo: https://go-review.googlesource.com/#/c/2167

Change-Id: I2043458a432ccd2aa8b206adc107ac7b215e355f
Reviewed-on: https://go-review.googlesource.com/8720
Reviewed-by: Rob Pike <r@golang.org>
2015-04-11 10:39:11 +00:00
Yasuhiro Matsumoto
61f8ff32f5 windows: change Readlink to handle junction
Related issue golang/go#10150

Change-Id: I38e3e13238624655bb828d501bc865ff8a4312e9
Reviewed-on: https://go-review.googlesource.com/7493
Reviewed-by: Alex Brainman <alex.brainman@gmail.com>
2015-04-10 22:14:33 +00:00
Pawel Knap
d008cdcf32 go.sys/windows: Add missing FILE_NOTIFY_CHANGE_SECURITY filter
According to ReadDirectoryChangesW documentation, this parameter is
perfectly valid and its absence in current enumeration makes it incomplete.

Internal flags like FILE_NOTIFY_CHANGE_EA were not added.

Change-Id: I9d4182dcfa67e67289c0cc35155a64bf5e5152db
Reviewed-on: https://go-review.googlesource.com/6560
Reviewed-by: Alex Brainman <alex.brainman@gmail.com>
2015-04-09 09:14:14 +00:00
Alex Brainman
ddd1cdae39 windows: fix race when allocating buffer for some windows syscalls
From main repo: https://go-review.googlesource.com/#/c/4940

Change-Id: I56fe7f6aedc0fd350abb94299ad500fcb80c049a
Reviewed-on: https://go-review.googlesource.com/8604
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2015-04-09 00:47:30 +00:00
Shenghou Ma
ea75526483 unix: fix build for linux/386 and linux/arm
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.

Fixes golang/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>
2015-03-31 06:30:55 +00:00
Brad Fitzpatrick
46ba3e7a19 unix: re-run mksyscall on freebsd and linux after previous merge
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>
2015-03-27 17:05:09 +00:00
Eric
ea745763b1 unix: Added posix_fadvise support for Linux and FreeBSD
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>
2015-03-27 16:47:22 +00:00
Brad Fitzpatrick
71c96e4240 unix: don't allocate putting common errno values in error interfaces
From main repo: https://go-review.googlesource.com/#/c/6701/3

Fixes golang/go#10266

Change-Id: I141fefe7f317edcea19b588b1569fa8772237f56
Reviewed-on: https://go-review.googlesource.com/8190
Reviewed-by: Rob Pike <r@golang.org>
2015-03-27 16:15:35 +00:00
Ian Lance Taylor
5829c74886 unix: change Dup,Dup2,Dup3 to use Syscall, not RawSyscall
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>
2015-03-26 17:59:35 +00:00
Shenghou Ma
2cb975bb60 unix: use Getpgid to emulate Getpgrp on linux
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>
2015-03-24 20:03:14 +00:00
Dirk Gadsden
bfff0ae28b unix: Add UnlinkAt on Linux with third flags argument
For golang/go#9923

Change-Id: I7562d32f1bfcc35fe86d2e5fff26845737fd9ecb
Reviewed-on: https://go-review.googlesource.com/7917
Reviewed-by: Rob Pike <r@golang.org>
2015-03-23 23:07:57 +00:00
Tim Hockin
8642817a1a unix: Add [RWX]_OK constants for Access
POSIX defines [FRWX]_OK flags as the second arg to access() (Access()
here). Only F_OK was defined heretofore. This adds the missing
[RWX]_OK constants.

Fixes golang/go#6262

Change-Id: Ie96273db19aa21af92c46affea9509afe0efe63f
Reviewed-on: https://go-review.googlesource.com/7852
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2015-03-20 06:12:11 +00:00
Mikio Hara
dcbb823943 unix: drop small networking libraries
Those libraries, routing message parsers, netlink message parsers,
berkeley packat filter are linux packet filter, are subsets and just for
the net package of standard library. It would be better keeping,
extending them at the net sub repository instead of here.

Updates golang/go#10150.

Change-Id: I1ca437bea2e2be7f7f8f6496d4db291629f49136
Reviewed-on: https://go-review.googlesource.com/7581
Reviewed-by: Russ Cox <rsc@golang.org>
Reviewed-by: Rob Pike <r@golang.org>
2015-03-20 01:30:45 +00:00
Josh Bleecher Snyder
0fcda1387e sys: add codereview.cfg
See golang.org/cl/4131 for context.

Change-Id: If2ba20a1adf9b40435628753ff7ca77577838813
Reviewed-on: https://go-review.googlesource.com/7760
Reviewed-by: David Crawshaw <crawshaw@golang.org>
2015-03-18 17:04:21 +00:00
Alex Brainman
40756181e9 windows: use go generate to build zsyscall_windows.go
Also remove some empty source files while we are at it.

Change-Id: Ia3a35b274a0428196aee63ee2daacc533285d0ea
Reviewed-on: https://go-review.googlesource.com/2530
Reviewed-by: Rob Pike <r@golang.org>
2015-03-15 23:59:38 +00:00
Mikio Hara
4a3569769a unix: add missing Syscall9 for darwin/amd64
Updates golang/go#10068.

Change-Id: Ide71d7dfd2ad95387c1914b89bc743cbcda7d1de
Reviewed-on: https://go-review.googlesource.com/7582
Reviewed-by: Rob Pike <r@golang.org>
2015-03-14 23:35:45 +00:00
Carlos Castillo
5b683257ff x/sys/windows: Add GetComputerNameEx
Provides access to the GetComputerNameEx syscall.

This mirrors the change golang.org/cl/5852 in the standard library, but
provides public access to all name types provided by windows.

Change-Id: I5fbad5abe721de70e9d2b5dda2fafb7a9c419220
Reviewed-on: https://go-review.googlesource.com/6320
Reviewed-by: Alex Brainman <alex.brainman@gmail.com>
2015-03-04 23:29:43 +00:00
William Orr
fb0c33c555 unix: Update zerrors and zsysnum on FreeBSD based on 10.1-RELEASE
Fixes golang/go#9705

Change-Id: Ie236633e0e6912de1fbf1274fa5cb3ada6ce3055
Reviewed-on: https://go-review.googlesource.com/6370
Reviewed-by: Minux Ma <minux@golang.org>
2015-03-02 01:40:34 +00:00
Andrew Gerrand
28779c6dad doc: add CONTRIBUTING.md
Change-Id: I54489b2beda898103e622316d3095b54393039d6
Reviewed-on: https://go-review.googlesource.com/5414
Reviewed-by: Minux Ma <minux@golang.org>
2015-02-20 05:00:49 +00:00
William Orr
853bdd547a unix: add mlock/munlock/mlockall/munlockall/mprotect to *BSD
Change-Id: I01c5dd902bbc349b860600ec2b3d556e2dc406c9
Reviewed-on: https://go-review.googlesource.com/1921
Reviewed-by: Ian Lance Taylor <iant@golang.org>
2015-01-06 02:05:08 +00:00
Alex Brainman
c2a8d2745f sys: copying .gitattributes to all subrepositories
Fixes #9281

Change-Id: Ia4bb2e9af9f660f42202bb1d07920578cd0f9c3e
Reviewed-on: https://go-review.googlesource.com/2076
Reviewed-by: Minux Ma <minux@golang.org>
2014-12-23 09:43:20 +00:00
William Orr
c31551b2f3 unix: fix uri for openbsd's syscall numbers
Change-Id: Ibc189f7e27ccdde94fd7da25a155636ee6bd6b25
Reviewed-on: https://go-review.googlesource.com/1920
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2014-12-22 04:34:25 +00:00
David Symonds
1da8e6ee6d sys: add import comments.
Change-Id: I0ebbb4f2da41bea7871f893332f2e4847b1bfefa
Reviewed-on: https://go-review.googlesource.com/1241
Reviewed-by: Andrew Gerrand <adg@golang.org>
2014-12-09 22:46:33 +00:00
David Symonds
98c940b171 remove codereview.cfg. 2014-12-08 10:59:03 +11:00
David Symonds
3146fa09d5 convert .hgignore to .gitignore. 2014-12-08 10:44:52 +11:00
Dave Cheney
bd7f565490 x/sys/unix: regenerate zsyscall_* files
Fixes build breakage due to missing syscall import.

LGTM=adg, r
R=r, adg
CC=golang-codereviews
https://golang.org/cl/162650044
2014-11-10 11:48:04 +00:00
Andrew Gerrand
dea3d764c2 go.sys: use golang.org/x/... import paths
LGTM=bradfitz, rsc
R=rsc, bradfitz
CC=golang-codereviews
https://golang.org/cl/171050043
2014-11-10 08:56:17 +11:00
Alex Brainman
7c39a4f50c go.sys/windows: add SIO_UDP_CONNRESET const
It was part of recently submitted CL 149510043.

LGTM=r
R=golang-codereviews, r
CC=golang-codereviews
https://golang.org/cl/155320044
2014-11-06 11:00:43 +11:00
William Orr
ac22431096 go.sys/unix: add support for *xattr functions on FreeBSD
Add wrappers that provide Linux-y behavior around the FreeBSD extattr(2)
functions. This allows certain packages, like the fuse package to run
under FreeBSD.

LGTM=iant
R=golang-codereviews, iant
CC=golang-codereviews
https://golang.org/cl/147850043
2014-10-08 07:29:25 -07:00
Ian Lance Taylor
7f1554891e mksyscall.pl, types_linux.go: regenerate linux {386,amd64} files
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.

Fixes golang/go#8865.

LGTM=r
R=r
CC=golang-codereviews
https://golang.org/cl/152980044
2014-10-06 12:02:17 -07:00
Alex Brainman
c17938b803 go.sys/windows: keep windows syscall pointers live
apply latest changes made to syscall/mksyscall_windows.go

LGTM=r
R=golang-codereviews, r
CC=golang-codereviews
https://golang.org/cl/152200043
2014-10-06 10:48:58 +11:00