aboutsummaryrefslogtreecommitdiffhomepage
path: root/vendor/golang.org/x/sys/unix/syscall.go
diff options
context:
space:
mode:
authorAlex Pilon <apilon@hashicorp.com>2019-02-22 18:24:37 -0500
committerAlex Pilon <apilon@hashicorp.com>2019-02-22 18:24:37 -0500
commit15c0b25d011f37e7c20aeca9eaf461f78285b8d9 (patch)
tree255c250a5c9d4801c74092d33b7337d8c14438ff /vendor/golang.org/x/sys/unix/syscall.go
parent07971ca38143c5faf951d152fba370ddcbe26ad5 (diff)
downloadterraform-provider-statuscake-15c0b25d011f37e7c20aeca9eaf461f78285b8d9.tar.gz
terraform-provider-statuscake-15c0b25d011f37e7c20aeca9eaf461f78285b8d9.tar.zst
terraform-provider-statuscake-15c0b25d011f37e7c20aeca9eaf461f78285b8d9.zip
deps: github.com/hashicorp/terraform@sdk-v0.11-with-go-modules
Updated via: go get github.com/hashicorp/terraform@sdk-v0.11-with-go-modules and go mod tidy
Diffstat (limited to 'vendor/golang.org/x/sys/unix/syscall.go')
-rw-r--r--vendor/golang.org/x/sys/unix/syscall.go54
1 files changed, 54 insertions, 0 deletions
diff --git a/vendor/golang.org/x/sys/unix/syscall.go b/vendor/golang.org/x/sys/unix/syscall.go
new file mode 100644
index 0000000..0d4b1d7
--- /dev/null
+++ b/vendor/golang.org/x/sys/unix/syscall.go
@@ -0,0 +1,54 @@
1// Copyright 2009 The Go Authors. All rights reserved.
2// Use of this source code is governed by a BSD-style
3// license that can be found in the LICENSE file.
4
5// +build aix darwin dragonfly freebsd linux netbsd openbsd solaris
6
7// Package unix contains an interface to the low-level operating system
8// primitives. OS details vary depending on the underlying system, and
9// by default, godoc will display OS-specific documentation for the current
10// system. If you want godoc to display OS documentation for another
11// system, set $GOOS and $GOARCH to the desired system. For example, if
12// you want to view documentation for freebsd/arm on linux/amd64, set $GOOS
13// to freebsd and $GOARCH to arm.
14//
15// The primary use of this package is inside other packages that provide a more
16// portable interface to the system, such as "os", "time" and "net". Use
17// those packages rather than this one if you can.
18//
19// For details of the functions and data types in this package consult
20// the manuals for the appropriate operating system.
21//
22// These calls return err == nil to indicate success; otherwise
23// err represents an operating system error describing the failure and
24// holds a value of type syscall.Errno.
25package unix // import "golang.org/x/sys/unix"
26
27import "strings"
28
29// ByteSliceFromString returns a NUL-terminated slice of bytes
30// containing the text of s. If s contains a NUL byte at any
31// location, it returns (nil, EINVAL).
32func ByteSliceFromString(s string) ([]byte, error) {
33 if strings.IndexByte(s, 0) != -1 {
34 return nil, EINVAL
35 }
36 a := make([]byte, len(s)+1)
37 copy(a, s)
38 return a, nil
39}
40
41// BytePtrFromString returns a pointer to a NUL-terminated array of
42// bytes containing the text of s. If s contains a NUL byte at any
43// location, it returns (nil, EINVAL).
44func BytePtrFromString(s string) (*byte, error) {
45 a, err := ByteSliceFromString(s)
46 if err != nil {
47 return nil, err
48 }
49 return &a[0], nil
50}
51
52// Single-word zero for use when we need a valid pointer to 0 bytes.
53// See mkunix.pl.
54var _zero uintptr