Commit c2b4b316 authored by Tobias Klauser's avatar Tobias Klauser Committed by Tobias Klauser

cmd/vendor/golang.org/x: pick up upstream fixes for broken android and iOS tests

Pick up the changes from CL 114395, CL 114396 and CL 114415.

By re-running govendor in the latest version, some files from
golang.org/x/sys/unix which are ignored for the build also got removed
from the vendored copy.

Updates #25528
Updates #25535

Change-Id: I5c0002fc3a37d6abaafed2e15cc3e2ade803ad7b
Reviewed-on: https://go-review.googlesource.com/114416
Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com>
Reviewed-by: 's avatarBrad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
parent 9eb2c434
......@@ -10,6 +10,7 @@ import (
"bytes"
"io"
"os"
"runtime"
"testing"
)
......@@ -326,6 +327,11 @@ func TestMakeRawState(t *testing.T) {
if err != nil {
t.Fatalf("failed to get terminal state from GetState: %s", err)
}
if runtime.GOOS == "darwin" && (runtime.GOARCH == "arm" || runtime.GOARCH == "arm64") {
t.Skip("MakeRaw not allowed on iOS; skipping test")
}
defer Restore(fd, st)
raw, err := MakeRaw(fd)
if err != nil {
......
// Copyright 2017 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 go1.7
package unix_test
import (
"fmt"
"testing"
"golang.org/x/sys/unix"
)
func TestDevices(t *testing.T) {
testCases := []struct {
path string
major uint32
minor uint32
}{
// Most of the device major/minor numbers on Darwin are
// dynamically generated by devfs. These are some well-known
// static numbers.
{"/dev/ttyp0", 4, 0},
{"/dev/ttys0", 4, 48},
{"/dev/ptyp0", 5, 0},
{"/dev/ptyr0", 5, 32},
}
for _, tc := range testCases {
t.Run(fmt.Sprintf("%s %v:%v", tc.path, tc.major, tc.minor), func(t *testing.T) {
var stat unix.Stat_t
err := unix.Stat(tc.path, &stat)
if err != nil {
t.Errorf("failed to stat device: %v", err)
return
}
dev := uint64(stat.Rdev)
if unix.Major(dev) != tc.major {
t.Errorf("for %s Major(%#x) == %d, want %d", tc.path, dev, unix.Major(dev), tc.major)
}
if unix.Minor(dev) != tc.minor {
t.Errorf("for %s Minor(%#x) == %d, want %d", tc.path, dev, unix.Minor(dev), tc.minor)
}
if unix.Mkdev(tc.major, tc.minor) != dev {
t.Errorf("for %s Mkdev(%d, %d) == %#x, want %#x", tc.path, tc.major, tc.minor, unix.Mkdev(tc.major, tc.minor), dev)
}
})
}
}
// Copyright 2017 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 go1.7
package unix_test
import (
"fmt"
"testing"
"golang.org/x/sys/unix"
)
func TestDevices(t *testing.T) {
testCases := []struct {
path string
major uint32
minor uint32
}{
// Minor is a cookie instead of an index on DragonFlyBSD
{"/dev/null", 10, 0x00000002},
{"/dev/random", 10, 0x00000003},
{"/dev/urandom", 10, 0x00000004},
{"/dev/zero", 10, 0x0000000c},
{"/dev/bpf", 15, 0xffff00ff},
}
for _, tc := range testCases {
t.Run(fmt.Sprintf("%s %v:%v", tc.path, tc.major, tc.minor), func(t *testing.T) {
var stat unix.Stat_t
err := unix.Stat(tc.path, &stat)
if err != nil {
t.Errorf("failed to stat device: %v", err)
return
}
dev := uint64(stat.Rdev)
if unix.Major(dev) != tc.major {
t.Errorf("for %s Major(%#x) == %d, want %d", tc.path, dev, unix.Major(dev), tc.major)
}
if unix.Minor(dev) != tc.minor {
t.Errorf("for %s Minor(%#x) == %d, want %d", tc.path, dev, unix.Minor(dev), tc.minor)
}
if unix.Mkdev(tc.major, tc.minor) != dev {
t.Errorf("for %s Mkdev(%d, %d) == %#x, want %#x", tc.path, tc.major, tc.minor, unix.Mkdev(tc.major, tc.minor), dev)
}
})
}
}
......@@ -33,6 +33,9 @@ func TestDevices(t *testing.T) {
var stat unix.Stat_t
err := unix.Stat(tc.path, &stat)
if err != nil {
if err == unix.EACCES {
t.Skip("no permission to stat device, skipping test")
}
t.Errorf("failed to stat device: %v", err)
return
}
......
// Copyright 2017 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 go1.7
package unix_test
import (
"fmt"
"testing"
"golang.org/x/sys/unix"
)
func TestDevices(t *testing.T) {
testCases := []struct {
path string
major uint32
minor uint32
}{
// well known major/minor numbers according to /dev/MAKEDEV on
// NetBSD 8.0
{"/dev/null", 2, 2},
{"/dev/zero", 2, 12},
{"/dev/random", 46, 0},
{"/dev/urandom", 46, 1},
}
for _, tc := range testCases {
t.Run(fmt.Sprintf("%s %v:%v", tc.path, tc.major, tc.minor), func(t *testing.T) {
var stat unix.Stat_t
err := unix.Stat(tc.path, &stat)
if err != nil {
t.Errorf("failed to stat device: %v", err)
return
}
dev := uint64(stat.Rdev)
if unix.Major(dev) != tc.major {
t.Errorf("for %s Major(%#x) == %d, want %d", tc.path, dev, unix.Major(dev), tc.major)
}
if unix.Minor(dev) != tc.minor {
t.Errorf("for %s Minor(%#x) == %d, want %d", tc.path, dev, unix.Minor(dev), tc.minor)
}
if unix.Mkdev(tc.major, tc.minor) != dev {
t.Errorf("for %s Mkdev(%d, %d) == %#x, want %#x", tc.path, tc.major, tc.minor, unix.Mkdev(tc.major, tc.minor), dev)
}
})
}
}
// Copyright 2017 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 go1.7
package unix_test
import (
"fmt"
"testing"
"golang.org/x/sys/unix"
)
func TestDevices(t *testing.T) {
testCases := []struct {
path string
major uint32
minor uint32
}{
// well known major/minor numbers according to /dev/MAKEDEV on
// OpenBSD 6.3
{"/dev/null", 2, 2},
{"/dev/zero", 2, 12},
{"/dev/ttyp0", 5, 0},
{"/dev/ttyp1", 5, 1},
{"/dev/random", 45, 0}, // symlink to /dev/urandom
}
for _, tc := range testCases {
t.Run(fmt.Sprintf("%s %v:%v", tc.path, tc.major, tc.minor), func(t *testing.T) {
var stat unix.Stat_t
err := unix.Stat(tc.path, &stat)
if err != nil {
t.Errorf("failed to stat device: %v", err)
return
}
dev := uint64(stat.Rdev)
if unix.Major(dev) != tc.major {
t.Errorf("for %s Major(%#x) == %d, want %d", tc.path, dev, unix.Major(dev), tc.major)
}
if unix.Minor(dev) != tc.minor {
t.Errorf("for %s Minor(%#x) == %d, want %d", tc.path, dev, unix.Minor(dev), tc.minor)
}
if unix.Mkdev(tc.major, tc.minor) != dev {
t.Errorf("for %s Mkdev(%d, %d) == %#x, want %#x", tc.path, tc.major, tc.minor, unix.Mkdev(tc.major, tc.minor), dev)
}
})
}
}
FROM ubuntu:17.10
# Dependencies to get the git sources and go binaries
RUN apt-get update && apt-get install -y --no-install-recommends \
ca-certificates \
curl \
git \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*
# Get the git sources. If not cached, this takes O(5 minutes).
WORKDIR /git
RUN git config --global advice.detachedHead false
# Linux Kernel: Released 01 Apr 2018
RUN git clone --branch v4.16 --depth 1 https://kernel.googlesource.com/pub/scm/linux/kernel/git/torvalds/linux
# GNU C library: Released 01 Feb 2018 (we should try to get a secure way to clone this)
RUN git clone --branch glibc-2.27 --depth 1 git://sourceware.org/git/glibc.git
# Get Go
ENV GOLANG_VERSION 1.10.1
ENV GOLANG_DOWNLOAD_URL https://golang.org/dl/go$GOLANG_VERSION.linux-amd64.tar.gz
ENV GOLANG_DOWNLOAD_SHA256 72d820dec546752e5a8303b33b009079c15c2390ce76d67cf514991646c6127b
RUN curl -fsSL "$GOLANG_DOWNLOAD_URL" -o golang.tar.gz \
&& echo "$GOLANG_DOWNLOAD_SHA256 golang.tar.gz" | sha256sum -c - \
&& tar -C /usr/local -xzf golang.tar.gz \
&& rm golang.tar.gz
ENV PATH /usr/local/go/bin:$PATH
# Linux and Glibc build dependencies and emulator
RUN apt-get update && apt-get install -y --no-install-recommends \
bison gawk make python \
gcc gcc-multilib \
gettext texinfo \
qemu \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*
# Cross compilers (install recommended packages to get cross libc-dev)
RUN apt-get update && apt-get install -y \
gcc-aarch64-linux-gnu gcc-arm-linux-gnueabi \
gcc-mips-linux-gnu gcc-mips64-linux-gnuabi64 \
gcc-mips64el-linux-gnuabi64 gcc-mipsel-linux-gnu \
gcc-powerpc64-linux-gnu gcc-powerpc64le-linux-gnu \
gcc-s390x-linux-gnu gcc-sparc64-linux-gnu \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*
# Let the scripts know they are in the docker environment
ENV GOLANG_SYS_BUILD docker
WORKDIR /build
ENTRYPOINT ["go", "run", "linux/mkall.go", "/git/linux", "/git/glibc"]
This diff is collapsed.
#!/usr/bin/env perl
# Copyright 2009 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.
use strict;
if($ENV{'GOARCH'} eq "" || $ENV{'GOOS'} eq "") {
print STDERR "GOARCH or GOOS not defined in environment\n";
exit 1;
}
# Check that we are using the new build system if we should
if($ENV{'GOLANG_SYS_BUILD'} ne "docker") {
print STDERR "In the new build system, mksysnum should not be called directly.\n";
print STDERR "See README.md\n";
exit 1;
}
my $command = "$0 ". join(' ', @ARGV);
print <<EOF;
// $command
// Code generated by the command above; see README.md. DO NOT EDIT.
// +build $ENV{'GOARCH'},$ENV{'GOOS'}
package unix
const(
EOF
my $offset = 0;
sub fmt {
my ($name, $num) = @_;
if($num > 999){
# ignore deprecated syscalls that are no longer implemented
# https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/tree/include/uapi/asm-generic/unistd.h?id=refs/heads/master#n716
return;
}
$name =~ y/a-z/A-Z/;
$num = $num + $offset;
print " SYS_$name = $num;\n";
}
my $prev;
open(CC, "$ENV{'CC'} -E -dD @ARGV |") || die "can't run $ENV{'CC'}";
while(<CC>){
if(/^#define __NR_Linux\s+([0-9]+)/){
# mips/mips64: extract offset
$offset = $1;
}
elsif(/^#define __NR(\w*)_SYSCALL_BASE\s+([0-9]+)/){
# arm: extract offset
$offset = $1;
}
elsif(/^#define __NR_syscalls\s+/) {
# ignore redefinitions of __NR_syscalls
}
elsif(/^#define __NR_(\w*)Linux_syscalls\s+/) {
# mips/mips64: ignore definitions about the number of syscalls
}
elsif(/^#define __NR_(\w+)\s+([0-9]+)/){
$prev = $2;
fmt($1, $2);
}
elsif(/^#define __NR3264_(\w+)\s+([0-9]+)/){
$prev = $2;
fmt($1, $2);
}
elsif(/^#define __NR_(\w+)\s+\(\w+\+\s*([0-9]+)\)/){
fmt($1, $prev+$2)
}
elsif(/^#define __NR_(\w+)\s+\(__NR_Linux \+ ([0-9]+)/){
fmt($1, $2);
}
elsif(/^#define __NR_(\w+)\s+\(__NR_SYSCALL_BASE \+ ([0-9]+)/){
fmt($1, $2);
}
}
print <<EOF;
)
EOF
This diff is collapsed.
......@@ -50,6 +50,7 @@ includes_Darwin='
#include <sys/mount.h>
#include <sys/utsname.h>
#include <sys/wait.h>
#include <sys/xattr.h>
#include <net/bpf.h>
#include <net/if.h>
#include <net/if_types.h>
......@@ -437,7 +438,7 @@ ccflags="$@"
$2 ~ /^GENL_/ ||
$2 ~ /^STATX_/ ||
$2 ~ /^UTIME_/ ||
$2 ~ /^XATTR_(CREATE|REPLACE)/ ||
$2 ~ /^XATTR_(CREATE|REPLACE|NO(DEFAULT|FOLLOW|SECURITY)|SHOWCOMPRESSION)/ ||
$2 ~ /^ATTR_(BIT_MAP_COUNT|(CMN|VOL|FILE)_)/ ||
$2 ~ /^FSOPT_/ ||
$2 ~ /^WDIOC_/ ||
......
......@@ -176,9 +176,7 @@ func Getfsstat(buf []Statfs_t, flags int) (n int, err error) {
return
}
//sys getxattr(path string, attr string, dest *byte, size int, position uint32, options int) (sz int, err error)
func Getxattr(path string, attr string, dest []byte) (sz int, err error) {
func xattrPointer(dest []byte) *byte {
// It's only when dest is set to NULL that the OS X implementations of
// getxattr() and listxattr() return the current sizes of the named attributes.
// An empty byte array is not sufficient. To maintain the same behaviour as the
......@@ -188,7 +186,17 @@ func Getxattr(path string, attr string, dest []byte) (sz int, err error) {
if len(dest) > 0 {
destp = &dest[0]
}
return getxattr(path, attr, destp, len(dest), 0, 0)
return destp
}
//sys getxattr(path string, attr string, dest *byte, size int, position uint32, options int) (sz int, err error)
func Getxattr(path string, attr string, dest []byte) (sz int, err error) {
return getxattr(path, attr, xattrPointer(dest), len(dest), 0, 0)
}
func Lgetxattr(link string, attr string, dest []byte) (sz int, err error) {
return getxattr(link, attr, xattrPointer(dest), len(dest), 0, XATTR_NOFOLLOW)
}
//sys setxattr(path string, attr string, data *byte, size int, position uint32, options int) (err error)
......@@ -220,11 +228,11 @@ func Setxattr(path string, attr string, data []byte, flags int) (err error) {
// current implementation, only the resource fork extended attribute makes
// use of this argument. For all others, position is reserved. We simply
// default to setting it to zero.
var datap *byte
if len(data) > 0 {
datap = &data[0]
}
return setxattr(path, attr, datap, len(data), 0, flags)
return setxattr(path, attr, xattrPointer(data), len(data), 0, flags)
}
func Lsetxattr(link string, attr string, data []byte, flags int) (err error) {
return setxattr(link, attr, xattrPointer(data), len(data), 0, flags|XATTR_NOFOLLOW)
}
//sys removexattr(path string, attr string, options int) (err error)
......@@ -236,15 +244,18 @@ func Removexattr(path string, attr string) (err error) {
return removexattr(path, attr, 0)
}
func Lremovexattr(link string, attr string) (err error) {
return removexattr(link, attr, XATTR_NOFOLLOW)
}
//sys listxattr(path string, dest *byte, size int, options int) (sz int, err error)
func Listxattr(path string, dest []byte) (sz int, err error) {
// See comment in Getxattr for as to why Listxattr is implemented as such.
var destp *byte
if len(dest) > 0 {
destp = &dest[0]
}
return listxattr(path, destp, len(dest), 0)
return listxattr(path, xattrPointer(dest), len(dest), 0)
}
func Llistxattr(link string, dest []byte) (sz int, err error) {
return listxattr(link, xattrPointer(dest), len(dest), XATTR_NOFOLLOW)
}
func setattrlistTimes(path string, times []Timespec, flags int) error {
......
......@@ -32,6 +32,10 @@ func TestIoctlGetInt(t *testing.T) {
}
func TestPpoll(t *testing.T) {
if runtime.GOOS == "android" {
t.Skip("mkfifo syscall is not available on android, skipping test")
}
f, cleanup := mktmpfifo(t)
defer cleanup()
......@@ -259,6 +263,9 @@ func TestSchedSetaffinity(t *testing.T) {
if runtime.NumCPU() < 2 {
t.Skip("skipping setaffinity tests on single CPU system")
}
if runtime.GOOS == "android" {
t.Skip("skipping setaffinity tests on android")
}
err = unix.SchedSetaffinity(0, &newMask)
if err != nil {
......
......@@ -125,6 +125,10 @@ func TestFcntlFlock(t *testing.T) {
// "-test.run=^TestPassFD$" and an environment variable used to signal
// that the test should become the child process instead.
func TestPassFD(t *testing.T) {
if runtime.GOOS == "darwin" && (runtime.GOARCH == "arm" || runtime.GOARCH == "arm64") {
t.Skip("cannot exec subprocess on iOS, skipping test")
}
if os.Getenv("GO_WANT_HELPER_PROCESS") == "1" {
passFDChild()
return
......@@ -390,6 +394,11 @@ func TestDup(t *testing.T) {
}
func TestPoll(t *testing.T) {
if runtime.GOOS == "android" ||
(runtime.GOOS == "darwin" && (runtime.GOARCH == "arm" || runtime.GOARCH == "arm64")) {
t.Skip("mkfifo syscall is not available on android and iOS, skipping test")
}
f, cleanup := mktmpfifo(t)
defer cleanup()
......@@ -426,7 +435,10 @@ func TestGetwd(t *testing.T) {
// These are chosen carefully not to be symlinks on a Mac
// (unlike, say, /var, /etc)
dirs := []string{"/", "/usr/bin"}
if runtime.GOOS == "darwin" {
switch runtime.GOOS {
case "android":
dirs = []string{"/", "/system/bin"}
case "darwin":
switch runtime.GOARCH {
case "arm", "arm64":
d1, err := ioutil.TempDir("", "d1")
......@@ -534,7 +546,7 @@ func TestFchmodat(t *testing.T) {
didChmodSymlink := true
err = unix.Fchmodat(unix.AT_FDCWD, "symlink1", uint32(mode), unix.AT_SYMLINK_NOFOLLOW)
if err != nil {
if (runtime.GOOS == "linux" || runtime.GOOS == "solaris") && err == unix.EOPNOTSUPP {
if (runtime.GOOS == "android" || runtime.GOOS == "linux" || runtime.GOOS == "solaris") && err == unix.EOPNOTSUPP {
// Linux and Illumos don't support flags != 0
didChmodSymlink = false
} else {
......@@ -560,6 +572,19 @@ func TestFchmodat(t *testing.T) {
}
}
func TestMkdev(t *testing.T) {
major := uint32(42)
minor := uint32(7)
dev := unix.Mkdev(major, minor)
if unix.Major(dev) != major {
t.Errorf("Major(%#x) == %d, want %d", dev, unix.Major(dev), major)
}
if unix.Minor(dev) != minor {
t.Errorf("Minor(%#x) == %d, want %d", dev, unix.Minor(dev), minor)
}
}
// mktmpfifo creates a temporary FIFO and provides a cleanup function.
func mktmpfifo(t *testing.T) (*os.File, func()) {
err := unix.Mkfifo("fifo", 0666)
......
......@@ -7,6 +7,7 @@
package unix_test
import (
"os"
"runtime"
"strings"
"testing"
......@@ -89,4 +90,29 @@ func TestXattr(t *testing.T) {
if err != nil {
t.Fatalf("Removexattr: %v", err)
}
n := "nonexistent"
err = unix.Lsetxattr(n, xattrName, []byte(xattrDataSet), 0)
if err != unix.ENOENT {
t.Errorf("Lsetxattr: expected %v on non-existent file, got %v", unix.ENOENT, err)
}
_, err = unix.Lgetxattr(n, xattrName, nil)
if err != unix.ENOENT {
t.Errorf("Lgetxattr: %v", err)
}
s := "symlink1"
err = os.Symlink(n, s)
if err != nil {
t.Fatal(err)
}
// Linux doesn't support xattrs on symlink according to xattr(7), so
// just test that we get the proper errors.
err = unix.Lsetxattr(s, xattrName, []byte(xattrDataSet), 0)
if err != nil && (runtime.GOOS != "linux" || err != unix.EPERM) {
t.Fatalf("Lsetxattr: %v", err)
}
}
......@@ -1473,6 +1473,12 @@ const (
WORDSIZE = 0x20
WSTOPPED = 0x8
WUNTRACED = 0x2
XATTR_CREATE = 0x2
XATTR_NODEFAULT = 0x10
XATTR_NOFOLLOW = 0x1
XATTR_NOSECURITY = 0x8
XATTR_REPLACE = 0x4
XATTR_SHOWCOMPRESSION = 0x20
)
// Errors
......
......@@ -1473,6 +1473,12 @@ const (
WORDSIZE = 0x40
WSTOPPED = 0x8
WUNTRACED = 0x2
XATTR_CREATE = 0x2
XATTR_NODEFAULT = 0x10
XATTR_NOFOLLOW = 0x1
XATTR_NOSECURITY = 0x8
XATTR_REPLACE = 0x4
XATTR_SHOWCOMPRESSION = 0x20
)
// Errors
......
......@@ -1473,6 +1473,12 @@ const (
WORDSIZE = 0x40
WSTOPPED = 0x8
WUNTRACED = 0x2
XATTR_CREATE = 0x2
XATTR_NODEFAULT = 0x10
XATTR_NOFOLLOW = 0x1
XATTR_NOSECURITY = 0x8
XATTR_REPLACE = 0x4
XATTR_SHOWCOMPRESSION = 0x20
)
// Errors
......
......@@ -1473,6 +1473,12 @@ const (
WORDSIZE = 0x40
WSTOPPED = 0x8
WUNTRACED = 0x2
XATTR_CREATE = 0x2
XATTR_NODEFAULT = 0x10
XATTR_NOFOLLOW = 0x1
XATTR_NOSECURITY = 0x8
XATTR_REPLACE = 0x4
XATTR_SHOWCOMPRESSION = 0x20
)
// Errors
......
......@@ -162,3 +162,4 @@ type ENUM_SERVICE_STATUS_PROCESS struct {
//sys ChangeServiceConfig2(service Handle, infoLevel uint32, info *byte) (err error) = advapi32.ChangeServiceConfig2W
//sys QueryServiceConfig2(service Handle, infoLevel uint32, buff *byte, buffSize uint32, bytesNeeded *uint32) (err error) = advapi32.QueryServiceConfig2W
//sys EnumServicesStatusEx(mgr Handle, infoLevel uint32, serviceType uint32, serviceState uint32, services *byte, bufSize uint32, bytesNeeded *uint32, servicesReturned *uint32, resumeHandle *uint32, groupName *uint16) (err error) = advapi32.EnumServicesStatusExW
//sys QueryServiceStatusEx(service Handle, infoLevel uint32, buff *byte, buffSize uint32, bytesNeeded *uint32) (err error) = advapi32.QueryServiceStatusEx
......@@ -65,6 +65,7 @@ var (
procChangeServiceConfig2W = modadvapi32.NewProc("ChangeServiceConfig2W")
procQueryServiceConfig2W = modadvapi32.NewProc("QueryServiceConfig2W")
procEnumServicesStatusExW = modadvapi32.NewProc("EnumServicesStatusExW")
procQueryServiceStatusEx = modadvapi32.NewProc("QueryServiceStatusEx")
procGetLastError = modkernel32.NewProc("GetLastError")
procLoadLibraryW = modkernel32.NewProc("LoadLibraryW")
procLoadLibraryExW = modkernel32.NewProc("LoadLibraryExW")
......@@ -472,6 +473,18 @@ func EnumServicesStatusEx(mgr Handle, infoLevel uint32, serviceType uint32, serv
return
}
func QueryServiceStatusEx(service Handle, infoLevel uint32, buff *byte, buffSize uint32, bytesNeeded *uint32) (err error) {
r1, _, e1 := syscall.Syscall6(procQueryServiceStatusEx.Addr(), 5, uintptr(service), uintptr(infoLevel), uintptr(unsafe.Pointer(buff)), uintptr(buffSize), uintptr(unsafe.Pointer(bytesNeeded)), 0)
if r1 == 0 {
if e1 != 0 {
err = errnoErr(e1)
} else {
err = syscall.EINVAL
}
}
return
}
func GetLastError() (lasterr error) {
r0, _, _ := syscall.Syscall(procGetLastError.Addr(), 0, 0, 0, 0)
if r0 != 0 {
......
......@@ -119,22 +119,22 @@
"revisionTime": "2018-04-06T10:28:20Z"
},
{
"checksumSHA1": "E18+MSOY6MlYvt0118eUPj9NsyQ=",
"checksumSHA1": "4nPV7YdyHiVRSWaxpy6jHt/MTq4=",
"path": "golang.org/x/crypto/ssh/terminal",
"revision": "1a580b3eff7814fc9b40602fd35256c63b50f491",
"revisionTime": "2018-05-14T23:55:10Z"
"revision": "159ae71589f303f9fbfd7528413e0fe944b9c1cb",
"revisionTime": "2018-05-24T11:38:20Z"
},
{
"checksumSHA1": "6dKfNPNpUf9n8ya24buuzpMFfjs=",
"checksumSHA1": "dFWZRPHQmh24everjam0u30KoIM=",
"path": "golang.org/x/sys/unix",
"revision": "f3b0f5faf591842dced5f027709e1706df17b749",
"revisionTime": "2018-05-23T20:41:33Z"
"revision": "04b83988a018ef3ebffe1485df79d6499b76a4b4",
"revisionTime": "2018-05-24T06:57:10Z"
},
{
"checksumSHA1": "oOO80EfXGcEl+tZoYAZVs6VRpE8=",
"checksumSHA1": "y0x0I9zDxnxn9nCxwP/MdPyq1E8=",
"path": "golang.org/x/sys/windows",
"revision": "f3b0f5faf591842dced5f027709e1706df17b749",
"revisionTime": "2018-05-23T20:41:33Z"
"revision": "04b83988a018ef3ebffe1485df79d6499b76a4b4",
"revisionTime": "2018-05-24T06:57:10Z"
},
{
"checksumSHA1": "BnZkq/3Ejb7961bDhybRraW6jzI=",
......@@ -145,14 +145,14 @@
{
"checksumSHA1": "dQbFeoiAxfB3WFFVcAdeSwSgeDk=",
"path": "golang.org/x/sys/windows/svc",
"revision": "f3b0f5faf591842dced5f027709e1706df17b749",
"revisionTime": "2018-05-23T20:41:33Z"
"revision": "04b83988a018ef3ebffe1485df79d6499b76a4b4",
"revisionTime": "2018-05-24T06:57:10Z"
},
{
"checksumSHA1": "e9KJPWrdqg5PMkbE2w60Io8rY4M=",
"path": "golang.org/x/sys/windows/svc/debug",
"revision": "f3b0f5faf591842dced5f027709e1706df17b749",
"revisionTime": "2018-05-23T20:41:33Z"
"revision": "04b83988a018ef3ebffe1485df79d6499b76a4b4",
"revisionTime": "2018-05-24T06:57:10Z"
},
{
"checksumSHA1": "dz53pQfqAnXG8HdJj+nazXN9YRw=",
......@@ -163,8 +163,8 @@
{
"checksumSHA1": "wz+0tf0Z7cVBaz/35P1m1cAiI7k=",
"path": "golang.org/x/sys/windows/svc/mgr",
"revision": "f3b0f5faf591842dced5f027709e1706df17b749",
"revisionTime": "2018-05-23T20:41:33Z"
"revision": "04b83988a018ef3ebffe1485df79d6499b76a4b4",
"revisionTime": "2018-05-24T06:57:10Z"
}
],
"rootPath": "/cmd"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment