summaryrefslogtreecommitdiffstats
path: root/vendor/golang.org/x/sys
diff options
context:
space:
mode:
Diffstat (limited to 'vendor/golang.org/x/sys')
-rw-r--r--vendor/golang.org/x/sys/unix/bluetooth_linux.go1
-rw-r--r--vendor/golang.org/x/sys/unix/fdset.go29
-rw-r--r--vendor/golang.org/x/sys/unix/mkerrors.sh2
-rw-r--r--vendor/golang.org/x/sys/unix/sockcmsg_dragonfly.go16
-rw-r--r--vendor/golang.org/x/sys/unix/sockcmsg_linux.go2
-rw-r--r--vendor/golang.org/x/sys/unix/sockcmsg_unix.go36
-rw-r--r--vendor/golang.org/x/sys/unix/sockcmsg_unix_other.go38
-rw-r--r--vendor/golang.org/x/sys/unix/syscall_bsd.go2
-rw-r--r--vendor/golang.org/x/sys/unix/syscall_darwin.1_13.go2
-rw-r--r--vendor/golang.org/x/sys/unix/syscall_darwin.go2
-rw-r--r--vendor/golang.org/x/sys/unix/syscall_darwin_386.go1
-rw-r--r--vendor/golang.org/x/sys/unix/syscall_darwin_amd64.go1
-rw-r--r--vendor/golang.org/x/sys/unix/syscall_darwin_arm.go4
-rw-r--r--vendor/golang.org/x/sys/unix/syscall_darwin_arm64.go4
-rw-r--r--vendor/golang.org/x/sys/unix/syscall_dragonfly.go24
-rw-r--r--vendor/golang.org/x/sys/unix/syscall_freebsd.go13
-rw-r--r--vendor/golang.org/x/sys/unix/syscall_linux.go2
-rw-r--r--vendor/golang.org/x/sys/unix/syscall_netbsd.go4
-rw-r--r--vendor/golang.org/x/sys/unix/syscall_openbsd.go4
-rw-r--r--vendor/golang.org/x/sys/unix/syscall_solaris.go2
-rw-r--r--vendor/golang.org/x/sys/unix/zerrors_linux_386.go6
-rw-r--r--vendor/golang.org/x/sys/unix/zerrors_linux_amd64.go6
-rw-r--r--vendor/golang.org/x/sys/unix/zerrors_linux_arm.go6
-rw-r--r--vendor/golang.org/x/sys/unix/zerrors_linux_arm64.go6
-rw-r--r--vendor/golang.org/x/sys/unix/zerrors_linux_mips.go6
-rw-r--r--vendor/golang.org/x/sys/unix/zerrors_linux_mips64.go6
-rw-r--r--vendor/golang.org/x/sys/unix/zerrors_linux_mips64le.go6
-rw-r--r--vendor/golang.org/x/sys/unix/zerrors_linux_mipsle.go6
-rw-r--r--vendor/golang.org/x/sys/unix/zerrors_linux_ppc64.go6
-rw-r--r--vendor/golang.org/x/sys/unix/zerrors_linux_ppc64le.go6
-rw-r--r--vendor/golang.org/x/sys/unix/zerrors_linux_riscv64.go6
-rw-r--r--vendor/golang.org/x/sys/unix/zerrors_linux_s390x.go6
-rw-r--r--vendor/golang.org/x/sys/unix/zerrors_linux_sparc64.go6
-rw-r--r--vendor/golang.org/x/sys/unix/zsyscall_darwin_386.1_11.go32
-rw-r--r--vendor/golang.org/x/sys/unix/zsyscall_darwin_386.go42
-rw-r--r--vendor/golang.org/x/sys/unix/zsyscall_darwin_386.s6
-rw-r--r--vendor/golang.org/x/sys/unix/zsyscall_darwin_amd64.1_11.go32
-rw-r--r--vendor/golang.org/x/sys/unix/zsyscall_darwin_amd64.go42
-rw-r--r--vendor/golang.org/x/sys/unix/zsyscall_darwin_amd64.s4
-rw-r--r--vendor/golang.org/x/sys/unix/zsyscall_darwin_arm.1_11.go16
-rw-r--r--vendor/golang.org/x/sys/unix/zsyscall_darwin_arm.go21
-rw-r--r--vendor/golang.org/x/sys/unix/zsyscall_darwin_arm64.1_11.go16
-rw-r--r--vendor/golang.org/x/sys/unix/zsyscall_darwin_arm64.go21
-rw-r--r--vendor/golang.org/x/sys/unix/zsyscall_darwin_arm64.s4
-rw-r--r--vendor/golang.org/x/sys/unix/ztypes_freebsd_arm64.go2
-rw-r--r--vendor/golang.org/x/sys/unix/ztypes_linux_386.go181
-rw-r--r--vendor/golang.org/x/sys/unix/ztypes_linux_amd64.go181
-rw-r--r--vendor/golang.org/x/sys/unix/ztypes_linux_arm.go181
-rw-r--r--vendor/golang.org/x/sys/unix/ztypes_linux_arm64.go181
-rw-r--r--vendor/golang.org/x/sys/unix/ztypes_linux_mips.go181
-rw-r--r--vendor/golang.org/x/sys/unix/ztypes_linux_mips64.go181
-rw-r--r--vendor/golang.org/x/sys/unix/ztypes_linux_mips64le.go181
-rw-r--r--vendor/golang.org/x/sys/unix/ztypes_linux_mipsle.go181
-rw-r--r--vendor/golang.org/x/sys/unix/ztypes_linux_ppc64.go181
-rw-r--r--vendor/golang.org/x/sys/unix/ztypes_linux_ppc64le.go181
-rw-r--r--vendor/golang.org/x/sys/unix/ztypes_linux_riscv64.go181
-rw-r--r--vendor/golang.org/x/sys/unix/ztypes_linux_s390x.go181
-rw-r--r--vendor/golang.org/x/sys/unix/ztypes_linux_sparc64.go181
-rw-r--r--vendor/golang.org/x/sys/windows/empty.s8
-rw-r--r--vendor/golang.org/x/sys/windows/security_windows.go4
-rw-r--r--vendor/golang.org/x/sys/windows/syscall_windows.go12
-rw-r--r--vendor/golang.org/x/sys/windows/zsyscall_windows.go31
62 files changed, 2560 insertions, 353 deletions
diff --git a/vendor/golang.org/x/sys/unix/bluetooth_linux.go b/vendor/golang.org/x/sys/unix/bluetooth_linux.go
index 6e3229697..a178a6149 100644
--- a/vendor/golang.org/x/sys/unix/bluetooth_linux.go
+++ b/vendor/golang.org/x/sys/unix/bluetooth_linux.go
@@ -23,6 +23,7 @@ const (
HCI_CHANNEL_USER = 1
HCI_CHANNEL_MONITOR = 2
HCI_CHANNEL_CONTROL = 3
+ HCI_CHANNEL_LOGGING = 4
)
// Socketoption Level
diff --git a/vendor/golang.org/x/sys/unix/fdset.go b/vendor/golang.org/x/sys/unix/fdset.go
new file mode 100644
index 000000000..b27be0a01
--- /dev/null
+++ b/vendor/golang.org/x/sys/unix/fdset.go
@@ -0,0 +1,29 @@
+// Copyright 2019 The Go Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+// +build aix darwin dragonfly freebsd linux netbsd openbsd solaris
+
+package unix
+
+// Set adds fd to the set fds.
+func (fds *FdSet) Set(fd int) {
+ fds.Bits[fd/NFDBITS] |= (1 << (uintptr(fd) % NFDBITS))
+}
+
+// Clear removes fd from the set fds.
+func (fds *FdSet) Clear(fd int) {
+ fds.Bits[fd/NFDBITS] &^= (1 << (uintptr(fd) % NFDBITS))
+}
+
+// IsSet returns whether fd is in the set fds.
+func (fds *FdSet) IsSet(fd int) bool {
+ return fds.Bits[fd/NFDBITS]&(1<<(uintptr(fd)%NFDBITS)) != 0
+}
+
+// Zero clears the set fds.
+func (fds *FdSet) Zero() {
+ for i := range fds.Bits {
+ fds.Bits[i] = 0
+ }
+}
diff --git a/vendor/golang.org/x/sys/unix/mkerrors.sh b/vendor/golang.org/x/sys/unix/mkerrors.sh
index 67b84828a..4da0a63d2 100644
--- a/vendor/golang.org/x/sys/unix/mkerrors.sh
+++ b/vendor/golang.org/x/sys/unix/mkerrors.sh
@@ -190,6 +190,7 @@ struct ltchars {
#include <linux/can.h>
#include <linux/capability.h>
#include <linux/cryptouser.h>
+#include <linux/devlink.h>
#include <linux/errqueue.h>
#include <linux/falloc.h>
#include <linux/fanotify.h>
@@ -524,6 +525,7 @@ ccflags="$@"
$2 ~ /^(HDIO|WIN|SMART)_/ ||
$2 ~ /^CRYPTO_/ ||
$2 ~ /^TIPC_/ ||
+ $2 ~ /^DEVLINK_/ ||
$2 !~ "WMESGLEN" &&
$2 ~ /^W[A-Z0-9]+$/ ||
$2 ~/^PPPIOC/ ||
diff --git a/vendor/golang.org/x/sys/unix/sockcmsg_dragonfly.go b/vendor/golang.org/x/sys/unix/sockcmsg_dragonfly.go
new file mode 100644
index 000000000..5144deecc
--- /dev/null
+++ b/vendor/golang.org/x/sys/unix/sockcmsg_dragonfly.go
@@ -0,0 +1,16 @@
+// Copyright 2019 The Go Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+package unix
+
+// Round the length of a raw sockaddr up to align it properly.
+func cmsgAlignOf(salen int) int {
+ salign := SizeofPtr
+ if SizeofPtr == 8 && !supportsABI(_dragonflyABIChangeVersion) {
+ // 64-bit Dragonfly before the September 2019 ABI changes still requires
+ // 32-bit aligned access to network subsystem.
+ salign = 4
+ }
+ return (salen + salign - 1) & ^(salign - 1)
+}
diff --git a/vendor/golang.org/x/sys/unix/sockcmsg_linux.go b/vendor/golang.org/x/sys/unix/sockcmsg_linux.go
index 6079eb4ac..8bf457059 100644
--- a/vendor/golang.org/x/sys/unix/sockcmsg_linux.go
+++ b/vendor/golang.org/x/sys/unix/sockcmsg_linux.go
@@ -17,7 +17,7 @@ func UnixCredentials(ucred *Ucred) []byte {
h.Level = SOL_SOCKET
h.Type = SCM_CREDENTIALS
h.SetLen(CmsgLen(SizeofUcred))
- *((*Ucred)(cmsgData(h))) = *ucred
+ *(*Ucred)(h.data(0)) = *ucred
return b
}
diff --git a/vendor/golang.org/x/sys/unix/sockcmsg_unix.go b/vendor/golang.org/x/sys/unix/sockcmsg_unix.go
index 062bcabab..003916ed7 100644
--- a/vendor/golang.org/x/sys/unix/sockcmsg_unix.go
+++ b/vendor/golang.org/x/sys/unix/sockcmsg_unix.go
@@ -9,35 +9,9 @@
package unix
import (
- "runtime"
"unsafe"
)
-// Round the length of a raw sockaddr up to align it properly.
-func cmsgAlignOf(salen int) int {
- salign := SizeofPtr
-
- switch runtime.GOOS {
- case "aix":
- // There is no alignment on AIX.
- salign = 1
- case "darwin", "dragonfly", "solaris", "illumos":
- // NOTE: It seems like 64-bit Darwin, DragonFly BSD,
- // illumos, and Solaris kernels still require 32-bit
- // aligned access to network subsystem.
- if SizeofPtr == 8 {
- salign = 4
- }
- case "netbsd", "openbsd":
- // NetBSD and OpenBSD armv7 require 64-bit alignment.
- if runtime.GOARCH == "arm" {
- salign = 8
- }
- }
-
- return (salen + salign - 1) & ^(salign - 1)
-}
-
// CmsgLen returns the value to store in the Len field of the Cmsghdr
// structure, taking into account any necessary alignment.
func CmsgLen(datalen int) int {
@@ -50,8 +24,8 @@ func CmsgSpace(datalen int) int {
return cmsgAlignOf(SizeofCmsghdr) + cmsgAlignOf(datalen)
}
-func cmsgData(h *Cmsghdr) unsafe.Pointer {
- return unsafe.Pointer(uintptr(unsafe.Pointer(h)) + uintptr(cmsgAlignOf(SizeofCmsghdr)))
+func (h *Cmsghdr) data(offset uintptr) unsafe.Pointer {
+ return unsafe.Pointer(uintptr(unsafe.Pointer(h)) + uintptr(cmsgAlignOf(SizeofCmsghdr)) + offset)
}
// SocketControlMessage represents a socket control message.
@@ -94,10 +68,8 @@ func UnixRights(fds ...int) []byte {
h.Level = SOL_SOCKET
h.Type = SCM_RIGHTS
h.SetLen(CmsgLen(datalen))
- data := cmsgData(h)
- for _, fd := range fds {
- *(*int32)(data) = int32(fd)
- data = unsafe.Pointer(uintptr(data) + 4)
+ for i, fd := range fds {
+ *(*int32)(h.data(4 * uintptr(i))) = int32(fd)
}
return b
}
diff --git a/vendor/golang.org/x/sys/unix/sockcmsg_unix_other.go b/vendor/golang.org/x/sys/unix/sockcmsg_unix_other.go
new file mode 100644
index 000000000..7d08dae5b
--- /dev/null
+++ b/vendor/golang.org/x/sys/unix/sockcmsg_unix_other.go
@@ -0,0 +1,38 @@
+// Copyright 2019 The Go Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+// +build aix darwin freebsd linux netbsd openbsd solaris
+
+package unix
+
+import (
+ "runtime"
+)
+
+// Round the length of a raw sockaddr up to align it properly.
+func cmsgAlignOf(salen int) int {
+ salign := SizeofPtr
+
+ // dragonfly needs to check ABI version at runtime, see cmsgAlignOf in
+ // sockcmsg_dragonfly.go
+ switch runtime.GOOS {
+ case "aix":
+ // There is no alignment on AIX.
+ salign = 1
+ case "darwin", "illumos", "solaris":
+ // NOTE: It seems like 64-bit Darwin, Illumos and Solaris
+ // kernels still require 32-bit aligned access to network
+ // subsystem.
+ if SizeofPtr == 8 {
+ salign = 4
+ }
+ case "netbsd", "openbsd":
+ // NetBSD and OpenBSD armv7 require 64-bit alignment.
+ if runtime.GOARCH == "arm" {
+ salign = 8
+ }
+ }
+
+ return (salen + salign - 1) & ^(salign - 1)
+}
diff --git a/vendor/golang.org/x/sys/unix/syscall_bsd.go b/vendor/golang.org/x/sys/unix/syscall_bsd.go
index 3e6671426..d52bcc41c 100644
--- a/vendor/golang.org/x/sys/unix/syscall_bsd.go
+++ b/vendor/golang.org/x/sys/unix/syscall_bsd.go
@@ -237,7 +237,7 @@ func anyToSockaddr(fd int, rsa *RawSockaddrAny) (Sockaddr, error) {
break
}
}
- bytes := (*[10000]byte)(unsafe.Pointer(&pp.Path[0]))[0:n]
+ bytes := (*[len(pp.Path)]byte)(unsafe.Pointer(&pp.Path[0]))[0:n]
sa.Name = string(bytes)
return sa, nil
diff --git a/vendor/golang.org/x/sys/unix/syscall_darwin.1_13.go b/vendor/golang.org/x/sys/unix/syscall_darwin.1_13.go
index 24960c38b..f911617be 100644
--- a/vendor/golang.org/x/sys/unix/syscall_darwin.1_13.go
+++ b/vendor/golang.org/x/sys/unix/syscall_darwin.1_13.go
@@ -27,8 +27,6 @@ func libc_fdopendir_trampoline()
func Getdirentries(fd int, buf []byte, basep *uintptr) (n int, err error) {
// Simulate Getdirentries using fdopendir/readdir_r/closedir.
- const ptrSize = unsafe.Sizeof(uintptr(0))
-
// We store the number of entries to skip in the seek
// offset of fd. See issue #31368.
// It's not the full required semantics, but should handle the case
diff --git a/vendor/golang.org/x/sys/unix/syscall_darwin.go b/vendor/golang.org/x/sys/unix/syscall_darwin.go
index c5018a385..0a1cc74b3 100644
--- a/vendor/golang.org/x/sys/unix/syscall_darwin.go
+++ b/vendor/golang.org/x/sys/unix/syscall_darwin.go
@@ -339,6 +339,8 @@ func Kill(pid int, signum syscall.Signal) (err error) { return kill(pid, int(sig
//sys ioctl(fd int, req uint, arg uintptr) (err error)
+//sys sysctl(mib []_C_int, old *byte, oldlen *uintptr, new *byte, newlen uintptr) (err error) = SYS_SYSCTL
+
func Uname(uname *Utsname) error {
mib := []_C_int{CTL_KERN, KERN_OSTYPE}
n := unsafe.Sizeof(uname.Sysname)
diff --git a/vendor/golang.org/x/sys/unix/syscall_darwin_386.go b/vendor/golang.org/x/sys/unix/syscall_darwin_386.go
index dd756e708..707ba4f59 100644
--- a/vendor/golang.org/x/sys/unix/syscall_darwin_386.go
+++ b/vendor/golang.org/x/sys/unix/syscall_darwin_386.go
@@ -10,7 +10,6 @@ import (
"syscall"
)
-//sys sysctl(mib []_C_int, old *byte, oldlen *uintptr, new *byte, newlen uintptr) (err error) = SYS___SYSCTL
//sys ptrace(request int, pid int, addr uintptr, data uintptr) (err error)
func setTimespec(sec, nsec int64) Timespec {
diff --git a/vendor/golang.org/x/sys/unix/syscall_darwin_amd64.go b/vendor/golang.org/x/sys/unix/syscall_darwin_amd64.go
index 7f148c428..fdbfb5911 100644
--- a/vendor/golang.org/x/sys/unix/syscall_darwin_amd64.go
+++ b/vendor/golang.org/x/sys/unix/syscall_darwin_amd64.go
@@ -10,7 +10,6 @@ import (
"syscall"
)
-//sys sysctl(mib []_C_int, old *byte, oldlen *uintptr, new *byte, newlen uintptr) (err error) = SYS___SYSCTL
//sys ptrace(request int, pid int, addr uintptr, data uintptr) (err error)
func setTimespec(sec, nsec int64) Timespec {
diff --git a/vendor/golang.org/x/sys/unix/syscall_darwin_arm.go b/vendor/golang.org/x/sys/unix/syscall_darwin_arm.go
index 58be02e71..f8bc4cfb1 100644
--- a/vendor/golang.org/x/sys/unix/syscall_darwin_arm.go
+++ b/vendor/golang.org/x/sys/unix/syscall_darwin_arm.go
@@ -12,10 +12,6 @@ func ptrace(request int, pid int, addr uintptr, data uintptr) error {
return ENOTSUP
}
-func sysctl(mib []_C_int, old *byte, oldlen *uintptr, new *byte, newlen uintptr) error {
- return ENOTSUP
-}
-
func setTimespec(sec, nsec int64) Timespec {
return Timespec{Sec: int32(sec), Nsec: int32(nsec)}
}
diff --git a/vendor/golang.org/x/sys/unix/syscall_darwin_arm64.go b/vendor/golang.org/x/sys/unix/syscall_darwin_arm64.go
index 1ee931f97..5ede3ac31 100644
--- a/vendor/golang.org/x/sys/unix/syscall_darwin_arm64.go
+++ b/vendor/golang.org/x/sys/unix/syscall_darwin_arm64.go
@@ -14,10 +14,6 @@ func ptrace(request int, pid int, addr uintptr, data uintptr) error {
return ENOTSUP
}
-func sysctl(mib []_C_int, old *byte, oldlen *uintptr, new *byte, newlen uintptr) error {
- return ENOTSUP
-}
-
func setTimespec(sec, nsec int64) Timespec {
return Timespec{Sec: sec, Nsec: nsec}
}
diff --git a/vendor/golang.org/x/sys/unix/syscall_dragonfly.go b/vendor/golang.org/x/sys/unix/syscall_dragonfly.go
index 8c8d50297..8a195ae58 100644
--- a/vendor/golang.org/x/sys/unix/syscall_dragonfly.go
+++ b/vendor/golang.org/x/sys/unix/syscall_dragonfly.go
@@ -12,9 +12,25 @@
package unix
-import "unsafe"
-
-//sys sysctl(mib []_C_int, old *byte, oldlen *uintptr, new *byte, newlen uintptr) (err error) = SYS___SYSCTL
+import (
+ "sync"
+ "unsafe"
+)
+
+// See version list in https://github.com/DragonFlyBSD/DragonFlyBSD/blob/master/sys/sys/param.h
+var (
+ osreldateOnce sync.Once
+ osreldate uint32
+)
+
+// First __DragonFly_version after September 2019 ABI changes
+// http://lists.dragonflybsd.org/pipermail/users/2019-September/358280.html
+const _dragonflyABIChangeVersion = 500705
+
+func supportsABI(ver uint32) bool {
+ osreldateOnce.Do(func() { osreldate, _ = SysctlUint32("kern.osreldate") })
+ return osreldate >= ver
+}
// SockaddrDatalink implements the Sockaddr interface for AF_LINK type sockets.
type SockaddrDatalink struct {
@@ -152,6 +168,8 @@ func setattrlistTimes(path string, times []Timespec, flags int) error {
//sys ioctl(fd int, req uint, arg uintptr) (err error)
+//sys sysctl(mib []_C_int, old *byte, oldlen *uintptr, new *byte, newlen uintptr) (err error) = SYS___SYSCTL
+
func sysctlUname(mib []_C_int, old *byte, oldlen *uintptr) error {
err := sysctl(mib, old, oldlen, nil, 0)
if err != nil {
diff --git a/vendor/golang.org/x/sys/unix/syscall_freebsd.go b/vendor/golang.org/x/sys/unix/syscall_freebsd.go
index 25ac9340c..34918d8ed 100644
--- a/vendor/golang.org/x/sys/unix/syscall_freebsd.go
+++ b/vendor/golang.org/x/sys/unix/syscall_freebsd.go
@@ -36,8 +36,6 @@ var (
// INO64_FIRST from /usr/src/lib/libc/sys/compat-ino64.h
const _ino64First = 1200031
-//sys sysctl(mib []_C_int, old *byte, oldlen *uintptr, new *byte, newlen uintptr) (err error) = SYS___SYSCTL
-
func supportsABI(ver uint32) bool {
osreldateOnce.Do(func() { osreldate, _ = SysctlUint32("kern.osreldate") })
return osreldate >= ver
@@ -203,6 +201,8 @@ func setattrlistTimes(path string, times []Timespec, flags int) error {
//sys ioctl(fd int, req uint, arg uintptr) (err error)
+//sys sysctl(mib []_C_int, old *byte, oldlen *uintptr, new *byte, newlen uintptr) (err error) = SYS___SYSCTL
+
func Uname(uname *Utsname) error {
mib := []_C_int{CTL_KERN, KERN_OSTYPE}
n := unsafe.Sizeof(uname.Sysname)
@@ -462,8 +462,12 @@ func convertFromDirents11(buf []byte, old []byte) int {
dstPos := 0
srcPos := 0
for dstPos+fixedSize < len(buf) && srcPos+oldFixedSize < len(old) {
- dstDirent := (*Dirent)(unsafe.Pointer(&buf[dstPos]))
- srcDirent := (*dirent_freebsd11)(unsafe.Pointer(&old[srcPos]))
+ var dstDirent Dirent
+ var srcDirent dirent_freebsd11
+
+ // If multiple direntries are written, sometimes when we reach the final one,
+ // we may have cap of old less than size of dirent_freebsd11.
+ copy((*[unsafe.Sizeof(srcDirent)]byte)(unsafe.Poi