summaryrefslogtreecommitdiffstats
path: root/vendor/golang.org/x/sys/unix/syscall.go
diff options
context:
space:
mode:
authorJesse Duffield <jessedduffield@gmail.com>2022-09-09 21:11:05 -0700
committerJesse Duffield <jessedduffield@gmail.com>2022-09-16 08:42:39 -0700
commit7af7af27c6252b862989d11f930787e5b370b119 (patch)
treea12b68c82de17aafb3b3479e81aae363a4cdec4e /vendor/golang.org/x/sys/unix/syscall.go
parent7b757d1cfe88363aa52a660d53838478243eca00 (diff)
various changes to improve integration tests
Diffstat (limited to 'vendor/golang.org/x/sys/unix/syscall.go')
-rw-r--r--vendor/golang.org/x/sys/unix/syscall.go10
1 files changed, 1 insertions, 9 deletions
diff --git a/vendor/golang.org/x/sys/unix/syscall.go b/vendor/golang.org/x/sys/unix/syscall.go
index 649fa8740..63e8c8383 100644
--- a/vendor/golang.org/x/sys/unix/syscall.go
+++ b/vendor/golang.org/x/sys/unix/syscall.go
@@ -29,8 +29,6 @@ import (
"bytes"
"strings"
"unsafe"
-
- "golang.org/x/sys/internal/unsafeheader"
)
// ByteSliceFromString returns a NUL-terminated slice of bytes
@@ -82,13 +80,7 @@ func BytePtrToString(p *byte) string {
ptr = unsafe.Pointer(uintptr(ptr) + 1)
}
- var s []byte
- h := (*unsafeheader.Slice)(unsafe.Pointer(&s))
- h.Data = unsafe.Pointer(p)
- h.Len = n
- h.Cap = n
-
- return string(s)
+ return string(unsafe.Slice(p, n))
}
// Single-word zero for use when we need a valid pointer to 0 bytes.