Commit Graph

382 Commits

Author SHA1 Message Date
Shamil Garatuev
f6cff0780e windows/registry: improve ReadSubKeyNames permissions
The existing implementation requires QUERY_VALUE and ENUMERATE_SUB_KEYS permissions to enumerate
subkeys, so, using registry key name limits, Stat function could be excluded
from methods body and improved method requires only ENUMERATE_SUB_KEYS permission

Registry elements size limits described there:
https://msdn.microsoft.com/library/windows/desktop/ms724872.aspx

Fixes golang/go#23869

Change-Id: Id96beb9b0b294f01cc6eb1bb53bee5f50d02ea7e
Reviewed-on: https://go-review.googlesource.com/95655
Reviewed-by: Alex Brainman <alex.brainman@gmail.com>
Run-TryBot: Alex Brainman <alex.brainman@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
2018-02-24 23:21:35 +00:00
Tobias Klauser
88d2dcc510 unix: add IFLA_* constants for Linux 4.15
Add all IFLA_* constants defined in linux/if_link.h as of Linux kernel
version 4.15.

Change-Id: Ib27205cf560f40303ca9500abe73abf833fc13a8
Reviewed-on: https://go-review.googlesource.com/96595
Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2018-02-23 16:57:47 +00:00
Tobias Klauser
c1138c84af unix: update to Linux 4.15, glibc 2.27 and Go 1.10
Also use the Ubuntu 17.10 docker image and additionally install bison
which is needed by the glibc build.

The resulting change only consists of a few additional constants.
Exclude the X86_CR3_PCID_NOFLUSH constant on 386 and amd64, though.

Change-Id: I0a9b8959146273ff3b259c17bb616625a9ac8278
Reviewed-on: https://go-review.googlesource.com/96255
Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
2018-02-22 21:03:05 +00:00
Tobias Klauser
37707fdb30 unix: move gccgo redeclared *SyscallNoError functions to a separate file
Same as CL 34379, SyscallNoError and RawSyscallNoError are redeclared
for gccgo builds since CL 85756. Thus, move the declarations to a gc
specific file.

Updates golang/go#18312

Change-Id: Ia8f42b31e61a80530e5e90a44c0af32fd3452612
Reviewed-on: https://go-review.googlesource.com/91615
Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
2018-02-02 13:58:01 +00:00
Tobias Klauser
8f27ce8a60 unix: fix cpuset size argument in sched_affinity syscall
Fixes golang/go#23639

Change-Id: I7793dc50de35791a7c8af1966bb2ee4a36a2ac1c
Reviewed-on: https://go-review.googlesource.com/91375
Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2018-02-01 15:31:26 +00:00
Tobias Klauser
3dbebcf8ef unix: use SyscallNoError and RawSyscallNoError on Linux only
The SyscallNoError and RawSyscallNoError functions are only needed on
Linux. Make sure they are not used within the generated zsyscall_*.go
files if $GOOS != "linux".

Updates golang/go#22924

Change-Id: I3b2aa8624895b0527dcc832b2945a8d591f0ba1a
Reviewed-on: https://go-review.googlesource.com/90475
Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2018-01-30 06:43:25 +00:00
Tobias Klauser
ff2a66f350 unix: fix godoc comment for clen
The second part of the godoc sentence appears twice.

Change-Id: I119c7119ff50401eed3d7369a7709d8c779a7f9e
Reviewed-on: https://go-review.googlesource.com/90095
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2018-01-26 16:58:40 +00:00
Tobias Klauser
0346725895 unix: add godoc for Sockaddr* types
Add rudimentary godoc for all existing Sockaddr* types implementing the
Sockaddr interface.

Change-Id: Ida7d1e8756477b54fc773f4bc978002c3d4a376d
Reviewed-on: https://go-review.googlesource.com/89775
Reviewed-by: Ian Lance Taylor <iant@golang.org>
2018-01-25 14:53:36 +00:00
Tobias Klauser
90f0fdc418 plan9: add arm support
Copy zsyscall_plan9_arm.go from syscall and add asm_plan9_arm.s which
just contains jumps to the corresponding syscall functions.

Change-Id: I0eed6449c622ae3f6e73abcb43edfd306e96753f
Reviewed-on: https://go-review.googlesource.com/89795
Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
2018-01-25 14:42:35 +00:00
Garret Kelly
ef802241c9 unix: add sockaddr_l2 definitions
The sockaddr_l2 address type is used with AF_BLUETOOTH sockets using the
BTPROTO_L2CAP protocol.

Change-Id: I263cfd3bb5920a8c1187ead6c2e0527276575d9f
Reviewed-on: https://go-review.googlesource.com/89475
Reviewed-by: Tobias Klauser <tobias.klauser@gmail.com>
Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
2018-01-25 08:08:17 +00:00
Garret Kelly
af9a21289d unix: don't export padding fields on all platforms
Fixes golang/go#18632.

Change-Id: I9d07937dc93f860b09a99a86fe517b85f4dcd1b2
Reviewed-on: https://go-review.googlesource.com/89495
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
2018-01-24 21:25:39 +00:00
Tobias Klauser
af50095a40 unix: use ParseDirent from syscall
Just call syscall's implementation instead of duplicating ParseDirent
and the GOOS-specific private functions needed by it.

Change-Id: Icf49769390929463323608e093dd2a3d1c0ae4d3
Reviewed-on: https://go-review.googlesource.com/88475
Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
2018-01-22 08:19:59 +00:00
Ryan Zhang
2c42eef076 unix: adjust replacement regex for removed struct fields for linux/s390x
CL 87555 added the AT_STATX_* constants which are garbled on linux/s390x due
to the replacement regex in mkpost.go being too broad. Adjust the regex to
only match on word boundaries.

Change-Id: I898547fbbbc5d02965e86300e9144fb65207ab33
Reviewed-on: https://go-review.googlesource.com/87876
Reviewed-by: Tobias Klauser <tobias.klauser@gmail.com>
Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
2018-01-17 17:00:59 +00:00
Tobias Klauser
fff93fa7cd unix: add Statx on Linux
statx(2) allows to get enhanced file status information (not currently
available through the existing stat syscalls), lightweight stat,
heavyweight stat. The Statx_t type used by Statx has consistent field
sizes on all arches (with year-2038-capable timestamps) and is closer to
the BSD implementation of Stat_t.

See http://man7.org/linux/man-pages/man2/statx.2.html for details. The
syscall was added in Linux kernel 4.11.

See https://github.com/tklauser/statx for an example of how this
function and types can be used to report stat(1)-like file status
information.

Change-Id: I9e9642b5b42a393f94fd532453888ce9ba4f0003
Reviewed-on: https://go-review.googlesource.com/87555
Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
2018-01-15 08:58:44 +00:00
Tobias Klauser
52ba35ddf9 unix: check error return of os.Symlink in tests on Linux
Change-Id: Iddb6fbcb0f0f834fa9fd7ef95d57aa8c7b4007fd
Reviewed-on: https://go-review.googlesource.com/87575
Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com>
Run-TryBot: Ian Lance Taylor <iant@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
2018-01-15 08:58:03 +00:00
Tobias Klauser
810d700034 unix: match seek argument size to signature on linux/arm
Follow CL 2810

Change-Id: Ic833681c7abd8973e952aaad40986fd3385c94db
Reviewed-on: https://go-review.googlesource.com/86895
Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
2018-01-10 07:17:38 +00:00
Matt Layher
b9cf5f96b6 unix: add cgroupstats type and constants
The cgroupstats structure is available via Linux's generic netlink
taskstats interface.

For more information, please see:
https://www.kernel.org/doc/Documentation/accounting/cgroupstats.txt.

Fixes golang/go#23388.

Change-Id: I8a05a3875209e99a427d54049eacc98f415e44cf
Reviewed-on: https://go-review.googlesource.com/86975
Run-TryBot: Matt Layher <mdlayher@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Tobias Klauser <tobias.klauser@gmail.com>
2018-01-09 18:07:26 +00:00
Tamir Duberstein
d38bf781f1 unix: restore gccgo support
Initially added in https://golang.org/cl/9842 and
subsequently broken in https://golang.org/cl/85756.

Fixes golang/go#23361

Change-Id: Id458efdb4a9ffc5f038b4070fd514de9f78c17d7
Reviewed-on: https://go-review.googlesource.com/86755
Reviewed-by: Ian Lance Taylor <iant@golang.org>
2018-01-09 00:06:53 +00:00
Tobias Klauser
2493af8e3b plan9: move Unsetenv into env_plan9.go
Unsetenv was in its own file for Go 1.4 compatibility. This version is
no longer supported, so move Unsetenv with the other environment
specific functions.

Change-Id: I8b6621993f2ab0fbafe900b19dcaee7b5b3ed26f
Reviewed-on: https://go-review.googlesource.com/86540
Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
2018-01-08 22:11:54 +00:00
Tobias Klauser
3ca7571cef windows: move Unsetenv into env_windows.go
Unsetenv was in its own file for Go 1.4 compatibility. This version is
no longer supported, so move Unsetenv with the other environment
specific functions.

Change-Id: I63d67e2a9e4d7651be79c2e72a7f27fe0fac68c4
Reviewed-on: https://go-review.googlesource.com/86539
Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
2018-01-08 22:11:41 +00:00
Tobias Klauser
1792d66dc8 unix: move Unsetenv into env_unix.go
Unsetenv was in its own file for Go 1.4 compatibility. This version is
no longer supported, so move Unsetenv with the other environment
specific functions.

Change-Id: I81ed5182297598a7b3859711211ec8ef194bbe9a
Reviewed-on: https://go-review.googlesource.com/86538
Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2018-01-07 21:14:47 +00:00
Brad Fitzpatrick
dd9ec17814 unix: fix build on Go 1.8
Don't use math/bits yet. Go 1.8 doesn't have it, and Go 1.8 is still
supported for a few weeks.

Fixes golang/go#23353

Change-Id: Ie69163f6f6dca95d4652441849e0152d2e346cd0
Reviewed-on: https://go-review.googlesource.com/86477
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Run-TryBot: Ian Lance Taylor <iant@golang.org>
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
2018-01-06 05:20:50 +00:00
Tobias Klauser
12d9d5b281 unix: add SchedGetaffinity and SchedSetaffinity on Linux
SchedGetaffinity and SchedSetaffinity are used to get and set a thread's
CPU affinity mask.

See http://man7.org/linux/man-pages/man2/sched_setaffinity.2.html for
details.

Also add a manual implementation of CpuSet_t and the corresponding
accessor functions (mimicking the CPU_* macros from sched.h).

Fixes golang/go#11243

Change-Id: Ia5abc0053cd06810b3b09ab65c27434f5323c1ad
Reviewed-on: https://go-review.googlesource.com/85915
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>
2018-01-05 20:31:47 +00:00
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