Commit Graph

359 Commits

Author SHA1 Message Date
Junya Hayashi
a3f2cbd54c unix: fix typo in unix/asm_linux_arm64.s made in 28a7276
28a7276 causes following error with GOARCH=arm64 environment.

  # golang.org/x/sys/unix
  asm: InitTextSym double init for "".Syscall
  asm: symbol "".Syscall listed multiple times
  asm: invalid encoding for argument 00004 (/home/junya/go/src/golang.org/x/sys/unix/asm_linux_arm64.s:21)        CALL    runtime.entersyscall(SB)
  asm: invalid encoding for argument 00048 (/home/junya/go/src/golang.org/x/sys/unix/asm_linux_arm64.s:32)        CALL    runtime.exitsyscall(SB)
  asm: makeFuncDebugEntry double process "".Syscall
  asm: assembly failed

Change-Id: Ic7895fecc5f4b1fd6ebef63603c5f720227f5130
Reviewed-on: https://go-review.googlesource.com/86135
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2018-01-04 16:29:08 +00:00
Tobias Klauser
28a7276518 unix: add SyscallNoError and RawSyscallNoError on Linux
Add the SyscallNoError and RawSyscallNoError wrapper functions which are
used for syscalls that don't return an error. Also convert all applicable
syscalls to use these wrappers.

Updates golang/go#22924

Change-Id: Ie143abc99de8d12d36b67ac278e08d7565f73ce0
Reviewed-on: https://go-review.googlesource.com/85756
Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
2018-01-03 16:03:02 +00:00
Tobias Klauser
83801418e1 unix: simplify error handling in *listxattr on FreeBSD
The var e error declaration is shadowed inside the for loop, so the
outer e always stays nil. Also, there is no need to reset the inner e in
case of EPERM, as it is reset by ExattrList* on the next iteration
anyhow.

Change-Id: Ib395e34b5a390a5d37bee334c44f6f87d3add2a0
Reviewed-on: https://go-review.googlesource.com/85295
Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
2017-12-22 14:35:36 +00:00
Tobias Klauser
df29b91272 unix: add TestSelect for *BSD
Change-Id: I9aa4ac170c361e56e36bded0cc13fb99346f70cf
Reviewed-on: https://go-review.googlesource.com/85275
Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
2017-12-22 14:35:20 +00:00
Tobias Klauser
801364e02a unix: add Select on Solaris
Change-Id: I9e0e4bc6b9f8700d72e891d623f948db6af7d64b
Reviewed-on: https://go-review.googlesource.com/85255
Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
2017-12-22 14:35:06 +00:00
Tobias Klauser
d818ba11af unix: remove syscall constants on Solaris
SYS_EXECVE and SYS_FCNTL were needed for compatibility reasons in
syscall, but they are not needed in x/sys/unix.

Change-Id: Ic355cf8785c83be51bc91ba84401bc969f8ae6b5
Reviewed-on: https://go-review.googlesource.com/84995
Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2017-12-20 17:24:23 +00:00
Tobias Klauser
236baca679 unix: add timeout tests for Select and Pselect on Linux
Test for correct timeout behavior of Select and Pselect

Updates golang/go#22246

Change-Id: I86d1804c6ddf5072e93f3ef4f359198e732fae94
Reviewed-on: https://go-review.googlesource.com/84955
Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2017-12-20 16:10:48 +00:00
Tobias Klauser
571f7bbbe0 unix: simplify TestGetwd
No need to use err1 and err2, because there is no mode like in
TestChdirAndGetwd (from os/os_test.go). Also, call fd.Close() via defer.

Change-Id: I8e57acbb382f072c48805f8931c464a169203512
Reviewed-on: https://go-review.googlesource.com/84476
Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2017-12-16 17:17:02 +00:00
Tobias Klauser
d5840adf78 unix: add GetsockoptString for Darwin, *BSD and Solaris
As suggested by Brad in CL 83275.

From what I can tell getsockopt syscall on these OSes doesn't return
ERANGE in any case, so these versions don't include the buffer growing.

Change-Id: I667c3751021e26defec0a04761a689fa4b78c65d
Reviewed-on: https://go-review.googlesource.com/84016
Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2017-12-15 07:17:23 +00:00
Tobias Klauser
1d2aa6dbde unix: add Getcwd to support Getwd on all BSDs
All BSDs provide the SYS___GETCWD syscall which can be used to implement
Getwd.

Also add a test based on TestChdirAndGetwd from os/os_test.go

Change-Id: I243eae3e02a40e92afad317eb1f8a28b6032c131
Reviewed-on: https://go-review.googlesource.com/83755
Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
2017-12-14 07:29:55 +00:00
Brad Fitzpatrick
0131e684e8 windows: make GetDriveType use GetDriveTypeW
Fixes golang/go#23121

Change-Id: I71495b82a573e9f492a52dde325522a6203c06eb
Reviewed-on: https://go-review.googlesource.com/83855
Reviewed-by: Alex Brainman <alex.brainman@gmail.com>
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
2017-12-13 21:08:10 +00:00
Xi Ruoyao
9418b3fdda unix: add function for converting time.Time to Timespec
Add function TimeToTimespec for converting time.Time to Timespec.

Fixes golang/go#23078.

Change-Id: I685a4871d49131191f330b56b15bfd4f3131a9a5
Reviewed-on: https://go-review.googlesource.com/82919
Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Reviewed-by: Tobias Klauser <tobias.klauser@gmail.com>
2017-12-13 16:20:35 +00:00
Tobias Klauser
76c138986e unix: add unix.test to .gitignore
Change-Id: I216a49d54bf7d9ae89a916eed0d590f786596878
Reviewed-on: https://go-review.googlesource.com/83735
Reviewed-by: Ian Lance Taylor <iant@golang.org>
2017-12-13 15:44:37 +00:00
Tobias Klauser
53aa286056 unix: add GetsockoptString on Linux
Add a Getsockopt variant returning a string. This can e.g. be used to
retrieve a peer's SELinux or AppArmor labels using SO_PEERSEC.

Fixes golang/go#16374

Change-Id: Ia266bad1b0aef94ce19d378719ce1c1c976b4cc5
Reviewed-on: https://go-review.googlesource.com/83275
Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2017-12-11 20:33:43 +00:00
Tobias Klauser
b8f5ef3219 unix: enable TestUname for all GOOSes
Change-Id: I0f9bbda1053bea93b00e47a2d90f380d83c5eb16
Reviewed-on: https://go-review.googlesource.com/82895
Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2017-12-08 15:33:48 +00:00
Tobias Klauser
19b530ce1b unix: add Uname on openbsd
Change-Id: I40f99aab912c7002d113f82ccc60c9f68b9bc496
Reviewed-on: https://go-review.googlesource.com/82855
Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
2017-12-08 14:40:20 +00:00
Tobias Klauser
a0f4589a76 unix: add Uname on netbsd
Change-Id: I8adc5905f8c3da09b395845959def8cc580dd356
Reviewed-on: https://go-review.googlesource.com/82475
Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
2017-12-07 18:43:13 +00:00
Tobias Klauser
9167dbfd0f unix: add Uname on dragonfly
The Utsname members are only 32 bytes on Dragonfly and the syscall
returns ENOMEM in case the value is longer than that. Like uname(3)
on Dragonfly, handle this case gracefully and just truncate the
value.

Change-Id: If617af1b6831cff6d4245f498dad9f264b8fd118
Reviewed-on: https://go-review.googlesource.com/82155
Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
2017-12-06 14:41:49 +00:00
Tobias Klauser
8b4580aae2 unix: remove /dev/ptyp* from device node tests on NetBSD
Follow up for CL 80615

The NetBSD 8.0 builders don't seem to have these device nodes either.
Just remove them entirely.

Change-Id: Ib729574ed119f9ec78b06124ba4a5d9bbc74bf4d
Reviewed-on: https://go-review.googlesource.com/81015
Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2017-11-30 16:37:41 +00:00
Tobias Klauser
13fcbd661c unix: add Getdents on FreeBSD
Fixes golang/go#16137

Change-Id: I0b7ebb71b95de3c262242ddb4032da5f470f5643
Reviewed-on: https://go-review.googlesource.com/80535
Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2017-11-30 01:39:27 +00:00
Tobias Klauser
316e922701 unix: fix tests on NetBSD 8.0
Use /dev/ptyp* instead of /dev/ttyp* which don't seem to be available on
NetBSD 8.0+ anymore.

Change-Id: Idda6cc91b8cd26f5488852027b8d918f35a5e8fb
Reviewed-on: https://go-review.googlesource.com/80615
Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
2017-11-29 15:52:45 +00:00
Scott Crunkleton
1006bb3484 windows: add DOMAIN_ALIAS_RID* values and Token.IsMember(*SID) (bool, error)
Change-Id: Ib5eead82c8571a4becd4ddf6b1b87f8dcb2eb23e
Reviewed-on: https://go-review.googlesource.com/80155
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2017-11-28 21:08:31 +00:00
Ian Lance Taylor
b76f9891dc unix: skip TestSCMCredentials SOCK_DGRAM test before 1.10
The SOCK_DGRAM version of the test was introduced for 1.10, and breaks
on older versions.

Fixes golang/go#22899

Change-Id: I97ce6f05a8a885541df823eae996cbf5d87428c2
Reviewed-on: https://go-review.googlesource.com/80275
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2017-11-28 17:17:30 +00:00
Tobias Klauser
a204229cd8 unix: remove outdated comment in TestUname, omit string conversion
Follow the review comments by Brad in CL 79918.

Change-Id: Iedb27aa9582502a90231778f5032a2e0109a4621
Reviewed-on: https://go-review.googlesource.com/80015
Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2017-11-27 19:08:27 +00:00
Tobias Klauser
096928d58b unix: add Uname on FreeBSD
FreeBSD doesn't have a uname syscall but the information can be
retrieved using sysctls the same way as on Darwin.

Change-Id: I824c42490d1feed3f1ad3823427c01dd3e5ea3c1
Reviewed-on: https://go-review.googlesource.com/79918
Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2017-11-27 18:31:15 +00:00
Tobias Klauser
4ff8c001ce unix: add Fstatat on Linux for all GOOSes
Looks like it's enough to just add wrappers pointing to the
corresponding SYS_FSTATAT{,64} or SYS_NEWFSTATAT syscall. Add a test to
verify that assumption which checks that the returned stat data matches
what is returned by Stat/Lstat.

Also add the AT_NO_AUTOMOUNT constant which may be used for the flags
parmeter.

Fixes golang/go#14216

Change-Id: I73f27b483bd97d2dcf09d4b95a7957e75d194395
Reviewed-on: https://go-review.googlesource.com/79795
Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2017-11-24 17:10:47 +00:00
Tobias Klauser
a13efeb2fd unix: remove dragonfly/386 from mkall.sh
dragonfly/386 isn't a valid GOOS/GOARCH pair and there are no generated
files for this pair in x/sys/unix.

Follows CL 79675 which did the same for syscall.

Change-Id: Ie70937b464fa911a43c26515bcac1c03740dc1fe
Reviewed-on: https://go-review.googlesource.com/79676
Reviewed-by: Ian Lance Taylor <iant@golang.org>
2017-11-23 18:29:49 +00:00
Tobias Klauser
82aafbf43b unix: add SYS___SYSCTL on darwin/arm
Add the same workaround as already present for 386 (CL 14151), amd64 (CL
14091) and arm64 (CL 14094) on darwin.

Fixes golang/go#22839

Change-Id: I7eee543df204410dd3328dccb7d81166f77e1e2f
Reviewed-on: https://go-review.googlesource.com/79155
Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2017-11-21 20:27:57 +00:00
Tobias Klauser
328643532e unix: fix test compilation error on Go 1.7
testing.Run was introduced in Go 1.7. Skip the tests using it if built
with Go 1.6 or below.

Change-Id: I24c81426ea6d3eaaca5a565ad79b62b30e645d04
Reviewed-on: https://go-review.googlesource.com/78255
Reviewed-by: Ian Lance Taylor <iant@golang.org>
2017-11-20 17:00:34 +00:00
Awn
0ac51a24ef windows: add process creation flags
Fixes golang/go#22801

Change-Id: I1f466e26bcdf52bdd0df09bd81e31dde10347862
Reviewed-on: https://go-review.googlesource.com/78618
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Alex Brainman <alex.brainman@gmail.com>
2017-11-19 03:26:26 +00:00
Scott Crunkleton
0dd5e194bb windows: add Volume Management functions
Change-Id: I6e587cf1b7e8532f45df03bf94e209aafe8f81fd
Reviewed-on: https://go-review.googlesource.com/78235
Reviewed-by: Alex Brainman <alex.brainman@gmail.com>
2017-11-17 07:10:00 +00:00
Tobias Klauser
bf42f188b9 unix: use sort.Search for sysctl lookup on OpenBSD
Use sort.Search to look up sysctl mib values from names instead of using
a hand-crafted binary search.

Also add a simple test to verify sysctl is still working after the
change.

Change-Id: I844840ac434a704b14c3166c3730daffabd2f347
Reviewed-on: https://go-review.googlesource.com/76930
Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2017-11-14 16:20:44 +00:00
Tobias Klauser
665f6529cc unix: add Uname on Darwin
Darwin doesn't have a uname syscall but the same information can be
retrieved using sysctls. Use the raw sysctl numbers instead of doing the
roundtrip via SysctlString in order to void the additional sysctl calls
in nametomib and SysctlRaw.

This implementation follows the one in
https://opensource.apple.com/source/Libc/Libc-1244.1.7/gen/uname.c

Change-Id: I19541e2a6700f84ced0549a8fb86faa8cb5e6fbe
Reviewed-on: https://go-review.googlesource.com/77270
Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
2017-11-13 20:21:12 +00:00
Tobias Klauser
1e2299c37c unix: add PtracePokeUser
PtracePeekUser was already added in CL 38638, also add its "counterpart"
allowing to modify the tracee's user area.

Change-Id: Id84e85fe17b5cab7df5ecc83b6b7b8a39241241d
Reviewed-on: https://go-review.googlesource.com/76670
Reviewed-by: Ian Lance Taylor <iant@golang.org>
2017-11-10 07:27:04 +00:00
Aman Gupta
4b45465282 windows: add WSA{Send,Recv}Msg
Change-Id: Id71df85e55e586b33fac66c5494291e11db8ed14
Reviewed-on: https://go-review.googlesource.com/76471
Reviewed-by: Alex Brainman <alex.brainman@gmail.com>
Run-TryBot: Alex Brainman <alex.brainman@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
2017-11-09 00:15:38 +00:00
Tobias Klauser
bcc62b628a unix: remove unused function syscallMode
The unexported function syscallMode was added in CL 47290 but was never
used anywhere. Remove it.

FWIW this should also fix the build failure on plan9, as the file in
question was lacking build tags.

Change-Id: Icfd6b2dbcd66ceb2065c945d8a5a6d55e634fe5e
Reviewed-on: https://go-review.googlesource.com/76510
Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
2017-11-08 17:06:27 +00:00
Tobias Klauser
75813c6472 unix: remove empty lines before first comment in block
Re-run tip gofmt to remove empty lines before the first comment in a
block (CL 71990).

Change-Id: I10bed93b88fd4fa4345f9f8f930c45db9f0d6e59
Reviewed-on: https://go-review.googlesource.com/76191
Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2017-11-07 16:15:30 +00:00
Tobias Klauser
a22539bf85 unix: add vmsockets ioctl constant on Linux
To be used e.g. in github.com/mdlayher/vsock

Change-Id: I52148a6e6c53c022c07e2cc8bf7348a96445c17b
Reviewed-on: https://go-review.googlesource.com/76193
Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Matt Layher <mdlayher@gmail.com>
2017-11-07 15:03:14 +00:00
Tobias Klauser
d4266bc12a unix: add ioctl functions on NetBSD
Add IoctlGetInt/IoctlSetInt, IoctlGetTermios/IoctlSetTermios and
IoctlGetWinsize/IoctlSetWinsize on NetBSD. These are similar to the
already existing implementations on Linux, Darwin and Solaris.

Change-Id: I6c38d946b9f461c8e4c6c5e044aaff9b37e4b02f
Reviewed-on: https://go-review.googlesource.com/76171
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2017-11-06 15:25:25 +00:00
Tobias Klauser
5404d63da1 unix: add ioctl functions on Dragonfly
Add IoctlGetInt/IoctlSetInt, IoctlGetTermios/IoctlSetTermios and
IoctlGetWinsize/IoctlSetWinsize on Dragonfly. These are similar to the
already existing implementations on Linux, Darwin and Solaris.

Change-Id: I5a5a7ef69f02e01a4216779df5c927f241e5cec0
Reviewed-on: https://go-review.googlesource.com/76170
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2017-11-06 15:25:04 +00:00
Tobias Klauser
eae8a563e8 unix: add ioctl functions on OpenBSD
Add IoctlGetInt/IoctlSetInt, IoctlGetTermios/IoctlSetTermios and
IoctlGetWinsize/IoctlSetWinsize on OpenBSD. These are similar to the
already existing implementations on Linux, Darwin and Solaris.

Change-Id: I99e9434fa50338a0b5d825490513e9383539727d
Reviewed-on: https://go-review.googlesource.com/75791
Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2017-11-06 15:24:42 +00:00
Tobias Klauser
8413e589a2 unix: regenerate for macOS 10.13/iOS 11.1
Update the syscall numbers and error constants on macOS 10.13 with iOS
SDK 11.1.

The removed syscalls are all removed or marked as deprecated/old in the
following list

  https://opensource.apple.com/source/xnu/xnu-4570.1.46/bsd/kern/syscalls.master

which according to

  https://opensource.apple.com/release/macos-1013.html

is the kernel version used for macOS 10.13.

The poll function was moved around because I missed to regenerate the
zsyscall_darwin_*.go files in CL 74290.

Change-Id: I747c8c842f78f3db8d25b46759265aa99da9d739
Reviewed-on: https://go-review.googlesource.com/75972
Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2017-11-06 15:14:41 +00:00
Tobias Klauser
8eb05f94d4 windows: fix go vet warning
Now that go tip runs vet during go test	(CL 74356), the x/sys/windows
test fails due to the following vet error:

  syscall_windows_test.go:84: Fatal call has possible formatting directive %x

Fix it by using Fatalf instead.

Change-Id: I02536312c00bc9002400b29b5b5acef879a0e51a
Reviewed-on: https://go-review.googlesource.com/75973
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2017-11-04 19:33:50 +00:00
Tobias Klauser
4fe5d79250 unix: use keyed composite literal in TestSelect
Fixes the following vet error:

  syscall_linux_test.go:181: golang.org/x/sys/unix.Timeval composite literal uses unkeyed fields

Change-Id: I6973ad4ecd54b542074610a755573f98eb23f343
Reviewed-on: https://go-review.googlesource.com/75790
Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2017-11-03 17:53:29 +00:00
Tobias Klauser
7e31d873de unix: add missing err checks in tests
Change-Id: I7b1ff99b46273ad32c26247a2435e674c9e42789
Reviewed-on: https://go-review.googlesource.com/75810
Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2017-11-03 17:52:41 +00:00
Tobias Klauser
46eaec7899 unix: use setattrlist for UtimesNanoAt on Darwin
Use to setarrlist to implement UtimesNanoAt with nanosecond precision
(on Mac OS 10.13 with APFS). Translate AT_SYMLINK_NOFOLLOW to
FSOPT_NOFOLLOW correspondingly.

Change-Id: I1468a1f4eecb53b2280ff6329b1ec64e204701f1
Reviewed-on: https://go-review.googlesource.com/75650
Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
2017-11-02 21:26:49 +00:00
Tobias Klauser
feaf45c67f unix: use setattrlist for UtimesNano on Darwin for ns resolution
Follow CL 74952 for x/sys/unix.

Update golang/go#22528

Change-Id: Id146da75b80a64cfa4eac28e9bb7b3befe944718
Reviewed-on: https://go-review.googlesource.com/75610
Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2017-11-02 20:14:56 +00:00
Tobias Klauser
95c6576299 unix: enable TestPoll for all unix systems
Poll is now supported for all unix systems. Also enable TestPoll for all
of them.

Change-Id: Id6250702bf0d29c49fbeeed4cca21d232b72666a
Reviewed-on: https://go-review.googlesource.com/74310
Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
2017-10-31 08:18:56 +00:00
Tobias Klauser
af4555b109 unix: move Poll implementation for BSDs into syscall_bsd.go
Now that all BSD flavors support Poll, move the common implementation
into syscall_bsd.go

Change-Id: Id62a6163d41ef24e33f96540b661002b095a2fa1
Reviewed-on: https://go-review.googlesource.com/74290
Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
2017-10-31 08:18:28 +00:00
Tobias Klauser
4da7545edf unix: convert Utsname members from {u,}int8 array to byte array
In order to make conversion to string easier, change the Utsname
members from int8 array to byte array.

Also add a test on Linux for Uname and the string conversion of the
Utsname members.

Fixes golang/go#20753

Change-Id: Iec793dfb4a6dd8f3523cf0b6284a6162074f2e9e
Reviewed-on: https://go-review.googlesource.com/74331
Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
2017-10-31 08:17:53 +00:00