Commit Graph

74 Commits

Author SHA1 Message Date
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
Brad Fitzpatrick
c65f27ffe6 go.sys: add Unsetenv
LGTM=r
R=r
CC=golang-codereviews
https://golang.org/cl/153810043
2014-10-01 12:10:37 -07:00
Rob Pike
c1f6f8bcc5 go.sys/unix: use "use" in syscall interface
LGTM=iant
R=golang-codereviews, iant
CC=golang-codereviews
https://golang.org/cl/144980043
2014-09-16 13:36:53 -07:00
Rob Pike
c83757ae5b go.sys/unix/mkerrors.sh: restore missing include blocks
Dropped (or not moved) for some unknown reason. Restore them.

LGTM=rsc
R=rsc
CC=golang-codereviews
https://golang.org/cl/140680044
2014-09-16 10:48:40 -07:00
Rob Pike
6d0305dc7d go.sys/unix: undo CL 119530044's effects in go.sys for BSD
That CL worked around a bug present in the
OS X Yosemite Public Beta versions 1 and 2.
Beta 3 (released today) has fixed the bug.

LGTM=bradfitz
R=golang-codereviews, bradfitz
CC=golang-codereviews
https://golang.org/cl/144010043
2014-09-16 10:39:57 -07:00
Rob Pike
417a323d1f go.sys/plan9: define "use" in plan9/syscall.go
LGTM=0intro
R=rsc, 0intro
CC=golang-codereviews
https://golang.org/cl/141870043
2014-09-09 11:25:43 -07:00
Rob Pike
477fd0357c go.sys/plan9: update to use "use"
LGTM=rsc, aram, 0intro
R=rsc, aram, 0intro
CC=golang-codereviews
https://golang.org/cl/138280043
2014-09-09 11:02:42 -07:00
David du Colombier
02c66d5dc9 go.sys/plan9: use syscall.ErrorString instead of NewError
LGTM=bradfitz, r
R=r, bradfitz
CC=golang-codereviews
https://golang.org/cl/126090044
2014-08-25 02:23:33 +02:00
Rob Pike
fcfc1156f8 go.sys/plan9: delete Exec etc.
These are being deleted from go.sys because in general they can
only be implemented in close coordination with the runtime.

LGTM=0intro
R=golang-codereviews, 0intro
CC=golang-codereviews
https://golang.org/cl/132810043
2014-08-22 15:33:52 -07:00
Rob Pike
866b9d8a48 go.sys/unix: delete Fork and Exec etc.
These are being deleted from go.sys because in general they can
only be implemented in close coordination with the runtime.

LGTM=dave
R=rsc, dave, josharian
CC=golang-codereviews
https://golang.org/cl/129500043
2014-08-21 16:14:51 -07:00
Rob Pike
9782d98bb0 go.sys/windows: delete StartProcess and Exec
These are being deleted from go.sys because in general they can
only be implemented in close coordination with the runtime.

LGTM=alex.brainman
R=alex.brainman
CC=golang-codereviews
https://golang.org/cl/132010043
2014-08-21 16:07:11 -07:00
Alex Brainman
d1ee94ce83 go.sys/windows: apply latest syscall changes
71db3dc120af os: make SameFile handle paths like c:a.txt properly
ff34a3e84dc0 net: fix CNAME resolving on Windows

LGTM=r
R=golang-codereviews, r
CC=golang-codereviews
https://golang.org/cl/130250043
2014-08-20 12:25:19 +10:00
Alex Brainman
7d091bfd99 go.sys/windows: use $GOROOT/src/pkg/syscall/mksyscall_windows.go to generate syscalls
Also zsyscall_windows_386.go and zsyscall_windows_amd64.go
have same contents, so merge them into single file.

LGTM=r
R=r
CC=golang-codereviews
https://golang.org/cl/124430043
2014-08-19 15:20:17 +10:00
Rob Pike
dc3c21c62b go.sys/unix: use syscall.Errno for errors
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
2014-08-15 09:57:24 -07:00
Alex Brainman
70c4b52aa0 go.sys/windows: delete errors_windows.go (except APPLICATION_ERROR) and Errno
All consts in errors_windows.go (except APPLICATION_ERROR) were
"invented" at the start of windows port to have minimal impact on
existing Go packages. No point keeping them around.
Also remove Errno, since we will be using syscall.Errno everywhere anyway.

LGTM=r
R=golang-codereviews, r
CC=golang-codereviews
https://golang.org/cl/128290044
2014-08-15 13:37:15 +10:00