Commit Graph

1018 Commits

Author SHA1 Message Date
Tobias Klauser
f659759dc4 unix: add support for ptrace on macOS/ARM64
Same as CL 260718 did for package syscall.

Updates golang/go#38485

Change-Id: I7b282b7c823dd79eb1fe8b172a78da8dfe9acd1c
Reviewed-on: https://go-review.googlesource.com/c/sys/+/262957
Trust: Tobias Klauser <tobias.klauser@gmail.com>
Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Cherry Zhang <cherryyz@google.com>
2020-10-16 16:01:50 +00:00
Ian Lance Taylor
e3ed0017c2 unix/linux: update to Go 1.15.3 release
Does not cause any changes to generated files.

Change-Id: I635230441d4c48d1f649ca5c7cca073974e36b60
Reviewed-on: https://go-review.googlesource.com/c/sys/+/262457
Run-TryBot: Ian Lance Taylor <iant@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Trust: Ian Lance Taylor <iant@golang.org>
2020-10-15 00:08:50 +00:00
Tobias Klauser
cc95f250f6 unix: add FIORDCHK on solaris/illumos
Change-Id: Ib789b19d45f1ca3d5628e53e68b9ab732d6f8200
Reviewed-on: https://go-review.googlesource.com/c/sys/+/261797
Trust: Tobias Klauser <tobias.klauser@gmail.com>
Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Matt Layher <mdlayher@gmail.com>
2020-10-14 08:05:44 +00:00
Tobias Klauser
9029056a59 unix: refresh types and error consts on solaris/illumos
Generated on SunOS 5.11

Change-Id: Ia3a00e9fa4267a748e1d8434ae8a53ffe44494be
Reviewed-on: https://go-review.googlesource.com/c/sys/+/261461
Trust: Tobias Klauser <tobias.klauser@gmail.com>
Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Matt Layher <mdlayher@gmail.com>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
2020-10-14 08:05:34 +00:00
Tobias Klauser
2da7054afa unix: remove stray TODO comment
This was addressed by CL 2816 for package syscall and the same comment
was deleted from asm_linux_386.s.

Same as CL 261458 for package syscall.

Change-Id: Ib5d86dbafb6766f9d8d523c6035e1f095f18e6ed
Reviewed-on: https://go-review.googlesource.com/c/sys/+/261460
Trust: Tobias Klauser <tobias.klauser@gmail.com>
Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2020-10-13 13:26:46 +00:00
Tobias Klauser
a5aeffabbd unix: move build constraints comment below copyright message
Make fcntl_linux_32bit.go consistent with all other files in the
package.

Change-Id: If2e21027b0f31ac27d434806c18d9223ee55992f
Reviewed-on: https://go-review.googlesource.com/c/sys/+/261459
Trust: Tobias Klauser <tobias.klauser@gmail.com>
Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2020-10-13 13:26:27 +00:00
Alex Brainman
0aaa271806 windows/mkwinsyscall: sort by dll names and dll function names
Otherwise generated file changes every time //sys lines are moved
around, or when mkwinsyscall command parameters are reordered.

Change-Id: Ie4bdbee2ba50f9cea36ec78ce9951c57bd5da8a7
Reviewed-on: https://go-review.googlesource.com/c/sys/+/260900
Trust: Alex Brainman <alex.brainman@gmail.com>
Run-TryBot: Alex Brainman <alex.brainman@gmail.com>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
2020-10-13 08:18:32 +00:00
Tobias Klauser
56aa3af1a1 unix: update Dockerfile to Linux 5.9 and Go 1.15.2
Also add some newly added IFLA_* and PERF_* consts and adjust the
renamed NFTA_LIST_UNPEC const (see torvalds/linux@da9125df85).

Change-Id: Ic37f39e5b5bfe063ae6d7701de05ced07e62abfb
Reviewed-on: https://go-review.googlesource.com/c/sys/+/261457
Trust: Tobias Klauser <tobias.klauser@gmail.com>
Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com>
Reviewed-by: Matt Layher <mdlayher@gmail.com>
TryBot-Result: Go Bot <gobot@golang.org>
2020-10-13 06:48:17 +00:00
Sebastiaan van Stijn
dfb3f7c4e6 windows: errnoErr(): return ENOENT to reduce code duplication
Change-Id: I51c08a4add9c2b31c4bb7c4421dde227b4fff489
GitHub-Last-Rev: ef8ef8646c
GitHub-Pull-Request: golang/sys#89
Reviewed-on: https://go-review.googlesource.com/c/sys/+/259537
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Trust: Alex Brainman <alex.brainman@gmail.com>
2020-10-09 02:54:20 +00:00
Sebastiaan van Stijn
c1f3e3309c windows/mkwinsyscall: simplify generated code for booleans
Change-Id: I31ca4f93924a593e7952c483084616141998a03c
GitHub-Last-Rev: d4fd0c7eca
GitHub-Pull-Request: golang/sys#88
Reviewed-on: https://go-review.googlesource.com/c/sys/+/259302
Trust: Alex Brainman <alex.brainman@gmail.com>
Run-TryBot: Alex Brainman <alex.brainman@gmail.com>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Reviewed-by: Alex Brainman <alex.brainman@gmail.com>
2020-10-08 06:45:18 +00:00
Alex Brainman
280f808b4a windows/svc: add IsWindowsService function
CL 244958 includes isWindowsService function that determines if a
process is running as a service. The code of the function is based on
public .Net implementation.

IsAnInteractiveSession function implements similar functionality, but
is based on an old Stackoverflow post., which is not as authoritative
as code written by Microsoft for their official product.

This change copies CL 244958 isWindowsService function into svc package
and makes it public. The intention is that future users will prefer 
IsWindowsService to IsAnInteractiveSession.

Also this change adds "Deprecated" comment to IsAnInteractiveSession to
point future users to IsWindowsService.

Call to IsAnInteractiveSession is also replaced with IsWindowsService
in golang.org/x/sys/windows/svc/example package.

Change-Id: I4a33b7f590ee8161d1134d8e83668e9da4e6b434
Reviewed-on: https://go-review.googlesource.com/c/sys/+/259397
Run-TryBot: Alex Brainman <alex.brainman@gmail.com>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Trust: Brad Fitzpatrick <bradfitz@golang.org>
Trust: Alex Brainman <alex.brainman@gmail.com>
2020-10-08 06:31:27 +00:00
Ian Lance Taylor
a893ed343c unix: sync with DragonFly 5.8
Change-Id: I258e86b502957d76aeeead286bcc9c5e22b53834
Reviewed-on: https://go-review.googlesource.com/c/sys/+/260001
Trust: Ian Lance Taylor <iant@golang.org>
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Tobias Klauser <tobias.klauser@gmail.com>
2020-10-07 16:58:08 +00:00
Ian Lance Taylor
cec0259cc9 unix: update Darwin ztype files
The main effect is to change some fields of Statfs_t from arrays of int8
to arrays of byte. This makes the types of those fields correspond to the
types used on most other BSD systems.

Change-Id: If7e80fd53d6369a0f7c979c0bf36ffe530dc5d8d
Reviewed-on: https://go-review.googlesource.com/c/sys/+/259903
Trust: Ian Lance Taylor <iant@golang.org>
Run-TryBot: Ian Lance Taylor <iant@golang.org>
Reviewed-by: Tobias Klauser <tobias.klauser@gmail.com>
2020-10-07 16:57:53 +00:00
Sebastiaan van Stijn
8445cc04cb windows: add SetConsoleCursorPosition
Relates to https://github.com/gotestyourself/gotestsum/pull/115#issuecomment-629785089

For details see: https://docs.microsoft.com/en-us/windows/console/SetConsoleCursorPosition

Change-Id: I512428b64af253916c81187cb644e40a6ba418b5
GitHub-Last-Rev: c6c7ba0ad0
GitHub-Pull-Request: golang/sys#87
Reviewed-on: https://go-review.googlesource.com/c/sys/+/258038
Reviewed-by: Alex Brainman <alex.brainman@gmail.com>
Trust: Alex Brainman <alex.brainman@gmail.com>
Trust: Tobias Klauser <tobias.klauser@gmail.com>
Trust: Ian Lance Taylor <iant@golang.org>
Run-TryBot: Alex Brainman <alex.brainman@gmail.com>
TryBot-Result: Go Bot <gobot@golang.org>
2020-10-07 08:21:16 +00:00
Matt Layher
ac719f4daa unix: fix typo in PERF_TYPE_HARDWARE introduced in CL 259477
Change-Id: Iee2a067673309abc6b80d3cc96ac49d9d6b52865
Reviewed-on: https://go-review.googlesource.com/c/sys/+/259799
Trust: Matt Layher <mdlayher@gmail.com>
Run-TryBot: Matt Layher <mdlayher@gmail.com>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Bryan C. Mills <bcmills@google.com>
2020-10-06 15:56:30 +00:00
Tobias Klauser
097ba2fa90 unix: fix build on solaris after CL 259637
The build on illumos and solaris currently fails with:

  unix/syscall_solaris.go:558:6: no new variables on left side of :=

Fix this by dropping the named return value.

Change-Id: Ie29956ba08fd107f380fe432cc85f120d66057b5
Reviewed-on: https://go-review.googlesource.com/c/sys/+/259581
Trust: Tobias Klauser <tobias.klauser@gmail.com>
Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Matt Layher <mdlayher@gmail.com>
2020-10-06 15:36:26 +00:00
Matt Layher
9971236665 unix: use runtime.KeepAlive in Solaris IoctlSetTermio
This ensures that value remains live for the duration of the ioctl system call.
This pattern is used in all other IoctlSet* functions but appears to have been
forgotten here.

Change-Id: I2b26a5c4e7c862f779427b839327b36c1bc78c82
Reviewed-on: https://go-review.googlesource.com/c/sys/+/259637
Trust: Matt Layher <mdlayher@gmail.com>
Run-TryBot: Matt Layher <mdlayher@gmail.com>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
2020-10-05 17:22:24 +00:00
Matt Layher
935f906f17 unix: fix typos and reflow comments on IoctlFile* functions
Change-Id: I9be66514d6b5c8c85e7e424c4aa7856d0f4d884d
Reviewed-on: https://go-review.googlesource.com/c/sys/+/259557
Trust: Matt Layher <mdlayher@gmail.com>
Run-TryBot: Matt Layher <mdlayher@gmail.com>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Johan Brandhorst <johan.brandhorst@gmail.com>
2020-10-05 17:05:23 +00:00
Lehner Florian
765f4ea38d unix: update PERF consts on linux
Update the PERF_* consts from /usr/include/linux/perf_event.h.

Change-Id: I2dfa09445547682fa7ed99b385476319e8493c27
Reviewed-on: https://go-review.googlesource.com/c/sys/+/259477
Trust: Ian Lance Taylor <iant@golang.org>
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Tobias Klauser <tobias.klauser@gmail.com>
Reviewed-by: Matt Layher <mdlayher@gmail.com>
2020-10-05 06:50:44 +00:00
Matt Layher
f6757f2700 unix: add Linux watchdog structures and missing constants
This CL also adds the type-safe wrappers IoctlGetWatchdogInfo
and IoctlWatchdogKeepalive around the raw ioctl interface.

Change-Id: I98e3970807b28832e49524700b17b6b6f75d91ed
Reviewed-on: https://go-review.googlesource.com/c/sys/+/259497
Run-TryBot: Matt Layher <mdlayher@gmail.com>
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Terin Stock <terinjokes@gmail.com>
Reviewed-by: Florian Lehner <lehner.florian86@gmail.com>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Reviewed-by: Tobias Klauser <tobias.klauser@gmail.com>
Trust: Tobias Klauser <tobias.klauser@gmail.com>
2020-10-04 23:06:29 +00:00
Ian Lance Taylor
fdedc70b46 unix: use package path in name of C functions
For onsi/ginkgo#725

Change-Id: Iff5f98cb85aabd9c675c0519c30009ed96c2f6be
Reviewed-on: https://go-review.googlesource.com/c/sys/+/258358
Trust: Ian Lance Taylor <iant@golang.org>
Reviewed-by: Than McIntosh <thanm@google.com>
2020-09-30 18:57:26 +00:00
Tobias Klauser
e293359b92 unix: use correct cmsg alignment for netbsd/arm64
netbsd/arm64 requires 128-bit alignment for cmsgs.

Change-Id: I49d7a4dc223f15322c795569292b24200cedd389
Reviewed-on: https://go-review.googlesource.com/c/sys/+/258457
Trust: Tobias Klauser <tobias.klauser@gmail.com>
Trust: Benny Siegert <bsiegert@gmail.com>
Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Benny Siegert <bsiegert@gmail.com>
2020-09-30 18:24:49 +00:00
Tobias Klauser
4d22bbb62b unix: remove darwin support from mksysnum.go
Since CL 250437 this package no longer supports non-libc, direct
syscalls on darwin. Thus support for generating zsysnum_*.go files on
darwin can be removed from the generating mksysnum.go program.

Change-Id: I8916ddcd028a60d876ad43b8ce18a1c0925ce272
Reviewed-on: https://go-review.googlesource.com/c/sys/+/258058
Trust: Tobias Klauser <tobias.klauser@gmail.com>
Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
2020-09-29 08:30:18 +00:00
Anton Kuklin
006507a758 cpu: add support for detecting AVX-512
The existing implementation hasn't AVX-512 detection support.
This patch extends cpu package with such a functionality.

Fixes golang/go#41288

Change-Id: Iaddd57c5ff6d73360b77886458b9210b6c446859
Reviewed-on: https://go-review.googlesource.com/c/sys/+/257937
Trust: Tobias Klauser <tobias.klauser@gmail.com>
Trust: Cuong Manh Le <cuong.manhle.vn@gmail.com>
Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Tobias Klauser <tobias.klauser@gmail.com>
2020-09-28 20:51:50 +00:00
Tobias Klauser
9d91bd6205 unix: implement Getwd using getcwd from libSystem on darwin
Directly wrap the getcwd implementation provided by libSystem.dylib on
darwin and use it to implement Getwd like on the BSDs. This allows to
drop the custom implementation using getAttrList and to merge the
implementation of Getwd for darwin and the BSDs in syscall_bsd.go.

Change-Id: I62d38a239a7279fb95c912344bda2830856d4da4
Reviewed-on: https://go-review.googlesource.com/c/sys/+/257497
Trust: Tobias Klauser <tobias.klauser@gmail.com>
Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
2020-09-26 10:08:07 +00:00
Cherry Zhang
d9f96fdee2 all: add GOOS=ios
Following CL 254740, this CL does it on x/sys.

Updates golang/go#38485.

Change-Id: I5eab09a9a87c87fc883b5701434415648fb28eb0
Reviewed-on: https://go-review.googlesource.com/c/sys/+/255557
Trust: Cherry Zhang <cherryyz@google.com>
Run-TryBot: Cherry Zhang <cherryyz@google.com>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2020-09-23 18:26:05 +00:00
Tobias Klauser
aee5d888a8 unix: add IoctlFile{Clone,CloneRange,DedupeRange} on linux
Add wrappers for the FICLONE, FICLONERANGE and FIDEDUPERANGE ioctl
operations on linux. See the ioctl_ficlone(2), ioctl_ficlonerange(2) and
ioctl_fideduperange(2) man pages for details.

Change-Id: If3bad98facc362d4f7524e8d7a128815e9e2f204
Reviewed-on: https://go-review.googlesource.com/c/sys/+/256000
Trust: Tobias Klauser <tobias.klauser@gmail.com>
Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
2020-09-22 07:02:32 +00:00
Tobias Klauser
e10f822d58 unix: import accept4 from libsocket.so on illumos
The accept4 symbol is provided in libsocket.so on illumos. Follow-up fix
for CL 254717.

Change-Id: Iad70e998ea4ab80763288a300797eae8bed7de1a
Reviewed-on: https://go-review.googlesource.com/c/sys/+/256277
Trust: Tobias Klauser <tobias.klauser@gmail.com>
Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
2020-09-22 07:02:05 +00:00
Tobias Klauser
cb7fb32132 unix: allow overriding GOOS using GOOS_TARGET in mksyscall.go
The syscall wrapper generator utility is platform independent and can in
principle be run on a GOOS other than the one we're generating the
syscall wrappers for. Allow overriding GOOS by setting GOOS_TARGET,
similar to other generator programs in the repo.

Also remove the unused GOARCH_TARGET override in the same file.

Change-Id: I91459113af9f662f12a99b99c581c7f2615cb394
Reviewed-on: https://go-review.googlesource.com/c/sys/+/256278
Trust: Tobias Klauser <tobias.klauser@gmail.com>
Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
2020-09-22 07:01:10 +00:00
Tobias Klauser
af09f7315a unix: add FcntlFstore on darwin
This allows to perform a fcntl syscall with the F_PREALLOCATE command.
See man fcntl(2) on macOS for details.

Change-Id: I21f95b91269513064859425ab7adc42a73d6adb5
Reviewed-on: https://go-review.googlesource.com/c/sys/+/255917
Trust: Tobias Klauser <tobias.klauser@gmail.com>
Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
2020-09-18 17:44:21 +00:00
Tobias Klauser
efd3b9a0ff unix: skip TestClonefile* on ENOSYS or ENOTSUP
The clonefile syscalls added by CL 254757 might fail on certain macOS
versions and/or file systems according to the clonefile(2) manpage. Skip
the corresponding tests in these cases.

This fixes the test failure on the darwin-amd64-10_12 builder.

Change-Id: Iae1d2b6d8e2fcddc129d639f003fbb1817b45006
Reviewed-on: https://go-review.googlesource.com/c/sys/+/255198
Trust: Tobias Klauser <tobias.klauser@gmail.com>
Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
2020-09-17 07:31:48 +00:00
Tobias Klauser
648f2a0390 unix: add clonefile flags for clonefile syscalls on darwin
These are used with the flags parameter of
Clonefile/Clonefileat/Fclonefileat added by CL 254757.

Change-Id: Ia869315f319003c366f201f82a04b5801be08993
Reviewed-on: https://go-review.googlesource.com/c/sys/+/255197
Trust: Tobias Klauser <tobias.klauser@gmail.com>
Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
2020-09-17 06:19:48 +00:00
Tobias Klauser
dbad9cb7cb unix: add Pipe2 on illumos
Change-Id: Ib8d259c16b2ea4081f5ee8d927ef8658315268b8
Reviewed-on: https://go-review.googlesource.com/c/sys/+/254979
Trust: Tobias Klauser <tobias.klauser@gmail.com>
Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Matt Layher <mdlayher@gmail.com>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
2020-09-16 08:47:44 +00:00
Stan Hu
2334cc1a13 unix: add Darwin support for clonefile syscalls
This commit adds support for three Darwin-specific calls that accelerate
the copying of files:

* clonefile()
* clonefileat()
* fclonefileat()

Fixes golang/go#41366

Change-Id: I7e6c525fc23d8474ea85feff24314d3d672d87ed
Reviewed-on: https://go-review.googlesource.com/c/sys/+/254757
Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Tobias Klauser <tobias.klauser@gmail.com>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Trust: Tobias Klauser <tobias.klauser@gmail.com>
2020-09-16 03:07:50 +00:00
Lewis Waddicor
288bc346aa windows: support service PreShutdown service control signal
This adds support for the PreShutdown signal indicating the system will
be shutting down. This allows services which need time to shutdown
gracefully to use SERVICE_ACCEPT_PRESHUTDOWN to register for
SERVICE_CONTROL_PRESHUTDOWN events.

https://docs.microsoft.com/en-us/windows/win32/api/winsvc/nc-winsvc-lphandler_function_ex?redirectedfrom=MSDN

Change-Id: I380d366d49ff380972c1efe83f43610b30432f35
GitHub-Last-Rev: db8ea88b25
GitHub-Pull-Request: golang/sys#85
Reviewed-on: https://go-review.googlesource.com/c/sys/+/253477
Reviewed-by: Alex Brainman <alex.brainman@gmail.com>
Run-TryBot: Alex Brainman <alex.brainman@gmail.com>
TryBot-Result: Go Bot <gobot@golang.org>
Trust: Daniel Martí <mvdan@mvdan.cc>
2020-09-15 08:46:02 +00:00
Tobias Klauser
6d893a6b69 unix: add Accept4 on illumos
Wrap the accept syscall which is available on illumos.

Also use tabs instead of spaces in the //sys comments in
syscall_illumos.go

Change-Id: Ic7fbfe29b44c6a168b9be4d4679a6321cc891bf1
Reviewed-on: https://go-review.googlesource.com/c/sys/+/254717
Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Matt Layher <mdlayher@gmail.com>
Trust: Tobias Klauser <tobias.klauser@gmail.com>
2020-09-15 05:08:20 +00:00
Kir Kolyshkin
eff7692f90 unix: add openat2 for linux
openat2 is a new syscall added to Linux 5.6. It provides a superset of
openat(2) functionality, extending it with flags telling the kernel how
to resolve the paths.

For more info, see https://lwn.net/Articles/803237/

NOTE that this is a second attempt to add the call; the previous one
(https://golang.org/cl/227280) was reverted
(https://golang.org/cl/227846) due to the test case failure on ARM
(https://golang.org/issue/38357).

This CL has the test case reworked to be less assumptive to the testing
environment. In particular, it first tries if the most simplistic
openat2() call succeeds, and skips the test otherwise. It is done that
way because CI can be under under different kernels and in various
envrionments -- in particular, Docker+seccomp can result in EPERM from a
system call (which is not expected otherwise).

For previous discussions about the test case, see
https://golang.org/cl/227865.

Change-Id: I4276cf13dc29ecbdbdc9c58da0f76270f585a67f
Reviewed-on: https://go-review.googlesource.com/c/sys/+/253057
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Tobias Klauser <tobias.klauser@gmail.com>
2020-09-09 08:10:42 +00:00
Tobias Klauser
d2e65c121b unix: update Dockerfile to Go 1.15.1
Change-Id: Ia1a7cecc953968e04e710b065668ec9d06c2c1d3
Reviewed-on: https://go-review.googlesource.com/c/sys/+/253437
Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Matt Layher <mdlayher@gmail.com>
2020-09-08 13:41:30 +00:00
Alex Brainman
be1d3432aa windows: add TestJobObjectInfo
Add test for CL 251197.

Updates golang/go#41001

Change-Id: I6317678057eb8b18a1f7564842a92682c0c9930f
Reviewed-on: https://go-review.googlesource.com/c/sys/+/253097
Run-TryBot: Alex Brainman <alex.brainman@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
2020-09-05 00:46:54 +00:00
Ian Lance Taylor
e0c6998df7 windows: use GOARCH-specific JOBOBJECT_BASIC_LIMIT_INFORMATION
The Windows compilers appear to align JOBOBJECT_BASIC_LIMIT_INFORMATION
to an 8-byte boundary, which on 32-bit systems means adding 32 bits of
padding. Unfortunately we can't always add a padding field, because
no padding is required on a 64-bit system. So use different versions
of the struct for different targets.

Fixes golang/go#41001

Change-Id: I38d14edfd3f3a80da22825455f20e1f7de136638
Reviewed-on: https://go-review.googlesource.com/c/sys/+/251197
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Marc-Antoine Ruel <maruel@google.com>
Reviewed-by: Alex Brainman <alex.brainman@gmail.com>
2020-09-05 00:46:41 +00:00
Tobias Klauser
196b9ba873 unix: re-add SYS___SYSCTL on darwin
CL 250437 removed all SYS_* consts on darwin as direct syscalls are no
longer supported on this platform. However, some external packages (e.g.
github.com/shirou/gopsutil) still seem to rely on SYS___SYSCTL being
defined to implement their own sysctl wrappers. Re-add SYS___SYSCTL to
avoid breaking these packages.

Change-Id: I1ef1c05ba47a4b89be61ee8919d1651b7531d9c7
Reviewed-on: https://go-review.googlesource.com/c/sys/+/251738
Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2020-08-31 18:03:12 +00:00
Tobias Klauser
157a740278 unix: fix build with Go 1.12 on darwin
CL 250437 broke the build with Go 1.12 on darwin, due to
SYS_GETDIRENTRIES64 being removed. However, this is still needed to
implement Getdirentries for Go 1.12 because it does not provide
syscall_syscallPtr for fdopendir. Thus, add _SYS_GETDIRENTRIES64 as an
unexported const.

Change-Id: I52b420095deeb50d7fac002702dfce01cbf34bb7
Reviewed-on: https://go-review.googlesource.com/c/sys/+/251317
Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2020-08-28 19:40:41 +00:00
Tobias Klauser
c663848e9a unix: remove darwin direct syscall special case from mksyscall.go
Since CL 250437 this package no longer supports non-libc, direct
syscalls. Thus the corresponding special cases can be removed from
the generating mksyscall.go program.

Change-Id: I54be144de8ffd483f10c7b3a69b0761b83542c55
Reviewed-on: https://go-review.googlesource.com/c/sys/+/251318
Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com>
Reviewed-by: Matt Layher <mdlayher@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
2020-08-28 16:14:17 +00:00
Stephan Klatt
8dfe04af21 unix: add constants for raw CAN sockets
Fixes golang/go#41091

Change-Id: Icae9ad639599474144b286510f744f4a283aba06
GitHub-Last-Rev: 541bdb97bb
GitHub-Pull-Request: golang/sys#83
Reviewed-on: https://go-review.googlesource.com/c/sys/+/251357
Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com>
Reviewed-by: Matt Layher <mdlayher@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
2020-08-28 15:00:25 +00:00
Stephan Klatt
131dc92a58 unix: add CAN error constants
Fixes golang/go#41067

Change-Id: I110ed054074c9173911ce36009087bf1d0dc9499
GitHub-Last-Rev: 2309ec0882
GitHub-Pull-Request: golang/sys#82
Reviewed-on: https://go-review.googlesource.com/c/sys/+/251037
Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Tobias Klauser <tobias.klauser@gmail.com>
2020-08-28 08:12:04 +00:00
Tobias Klauser
6fcdbc0bbc unix: drop support for pre-1.12 direct syscalls on darwin
Go 1.12 and newer are using libSystem for syscalls on darwin.
Go 1.11 is the last release to use direct syscalls. It hasn't been
supported since the release of Go 1.13 in September 2019, so drop
support for direct syscalls.

Change-Id: I2baf6f3d1031de8e474dc770369a25147e5efe2a
Reviewed-on: https://go-review.googlesource.com/c/sys/+/250437
Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2020-08-28 08:09:24 +00:00
Joel Sing
f9321e4c35 unix: add support for openbsd/mips64
Update golang/go#40995

Change-Id: Ic5cbeea2a4b54bd047a8bffab8eb84579854fce3
Reviewed-on: https://go-review.googlesource.com/c/sys/+/250119
Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Tobias Klauser <tobias.klauser@gmail.com>
2020-08-26 17:35:25 +00:00
Tobias Klauser
c12d262b63 unix: cap RLIMIT_NOFILE soft limit in TestRlimit on darwin
On some machines, kern.maxfilesperproc is 4096. If Rlimit.Cur is larger
than that, Setrlimit will get an errEINVAL.

Same as CL 246658 did in package syscall.

Updates golang/go#40564

Change-Id: I8c45a23352fa2039772e04205680640e8a0e1840
Reviewed-on: https://go-review.googlesource.com/c/sys/+/250000
Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Matt Layher <mdlayher@gmail.com>
2020-08-24 13:15:25 +00:00
Tobias Klauser
2bddbd2f0c unix: make IoctlSetPointerInt available on all platforms
This may be used with unix.TIOCSPGRP which is available on platforms
other than linux.

Fixes golang/go#40986

Change-Id: Ic96b119e68395e5b6c5f33504ad40f3dfd4804f7
Reviewed-on: https://go-review.googlesource.com/c/sys/+/250001
Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Matt Layher <mdlayher@gmail.com>
2020-08-24 13:14:58 +00:00
Stephan Klatt
fda516888d unix: fix AF_CAN tests for big endian systems
see discussion in https://go-review.googlesource.com/c/sys/+/248977

Change-Id: I25dff34d2a6587d0b02836d7e2c9c40e08378731
GitHub-Last-Rev: 33cf644d65
GitHub-Pull-Request: golang/sys#81
Reviewed-on: https://go-review.googlesource.com/c/sys/+/249743
Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Tobias Klauser <tobias.klauser@gmail.com>
Reviewed-by: Matt Layher <mdlayher@gmail.com>
2020-08-21 14:05:26 +00:00