diff options
author | Péter Szilágyi <peterke@gmail.com> | 2019-02-15 00:14:28 +0800 |
---|---|---|
committer | Péter Szilágyi <peterke@gmail.com> | 2019-02-19 16:59:24 +0800 |
commit | d9be33766930b6978629a02643a8c83265a3006b (patch) | |
tree | 1245792f4e7bf63374148586f8c4ee612796a299 /vendor/golang.org/x/sys/unix/syscall.go | |
parent | 7bd6f39dc3eb174d5869613bc24f431ec96dabff (diff) | |
download | go-tangerine-d9be33766930b6978629a02643a8c83265a3006b.tar go-tangerine-d9be33766930b6978629a02643a8c83265a3006b.tar.gz go-tangerine-d9be33766930b6978629a02643a8c83265a3006b.tar.bz2 go-tangerine-d9be33766930b6978629a02643a8c83265a3006b.tar.lz go-tangerine-d9be33766930b6978629a02643a8c83265a3006b.tar.xz go-tangerine-d9be33766930b6978629a02643a8c83265a3006b.tar.zst go-tangerine-d9be33766930b6978629a02643a8c83265a3006b.zip |
vendor: update syscalls dependency
(cherry picked from commit dcc045f03c7c933dcdc7302f0338cbbfef7398ea)
Diffstat (limited to 'vendor/golang.org/x/sys/unix/syscall.go')
-rw-r--r-- | vendor/golang.org/x/sys/unix/syscall.go | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/vendor/golang.org/x/sys/unix/syscall.go b/vendor/golang.org/x/sys/unix/syscall.go index 857d2a42d..0d4b1d7a2 100644 --- a/vendor/golang.org/x/sys/unix/syscall.go +++ b/vendor/golang.org/x/sys/unix/syscall.go @@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. -// +build darwin dragonfly freebsd linux netbsd openbsd solaris +// +build aix darwin dragonfly freebsd linux netbsd openbsd solaris // Package unix contains an interface to the low-level operating system // primitives. OS details vary depending on the underlying system, and @@ -11,24 +11,27 @@ // system, set $GOOS and $GOARCH to the desired system. For example, if // you want to view documentation for freebsd/arm on linux/amd64, set $GOOS // to freebsd and $GOARCH to arm. +// // The primary use of this package is inside other packages that provide a more // portable interface to the system, such as "os", "time" and "net". Use // those packages rather than this one if you can. +// // For details of the functions and data types in this package consult // the manuals for the appropriate operating system. +// // These calls return err == nil to indicate success; otherwise // err represents an operating system error describing the failure and // holds a value of type syscall.Errno. package unix // import "golang.org/x/sys/unix" +import "strings" + // ByteSliceFromString returns a NUL-terminated slice of bytes // containing the text of s. If s contains a NUL byte at any // location, it returns (nil, EINVAL). func ByteSliceFromString(s string) ([]byte, error) { - for i := 0; i < len(s); i++ { - if s[i] == 0 { - return nil, EINVAL - } + if strings.IndexByte(s, 0) != -1 { + return nil, EINVAL } a := make([]byte, len(s)+1) copy(a, s) |