aboutsummaryrefslogtreecommitdiff
path: root/vendor/golang.org/x/sys/unix/sysvshm_unix.go
diff options
context:
space:
mode:
authorGibheer <gibheer+git@zero-knowledge.org>2022-11-11 11:22:50 +0100
committerGibheer <gibheer+git@zero-knowledge.org>2022-11-11 11:22:50 +0100
commitfe6bd04947e26a962fab3cf7a354abd44333bda6 (patch)
treede4714364747c05d391ab665176413eb24938545 /vendor/golang.org/x/sys/unix/sysvshm_unix.go
parentdc9dfb76ff9375e6368e9e05a40e6dc07b325a8d (diff)
update dependencies
Diffstat (limited to 'vendor/golang.org/x/sys/unix/sysvshm_unix.go')
-rw-r--r--vendor/golang.org/x/sys/unix/sysvshm_unix.go13
1 files changed, 2 insertions, 11 deletions
diff --git a/vendor/golang.org/x/sys/unix/sysvshm_unix.go b/vendor/golang.org/x/sys/unix/sysvshm_unix.go
index 0bb4c8d..5bb41d1 100644
--- a/vendor/golang.org/x/sys/unix/sysvshm_unix.go
+++ b/vendor/golang.org/x/sys/unix/sysvshm_unix.go
@@ -7,11 +7,7 @@
package unix
-import (
- "unsafe"
-
- "golang.org/x/sys/internal/unsafeheader"
-)
+import "unsafe"
// SysvShmAttach attaches the Sysv shared memory segment associated with the
// shared memory identifier id.
@@ -34,12 +30,7 @@ func SysvShmAttach(id int, addr uintptr, flag int) ([]byte, error) {
}
// Use unsafe to convert addr into a []byte.
- // TODO: convert to unsafe.Slice once we can assume Go 1.17
- var b []byte
- hdr := (*unsafeheader.Slice)(unsafe.Pointer(&b))
- hdr.Data = unsafe.Pointer(addr)
- hdr.Cap = int(info.Segsz)
- hdr.Len = int(info.Segsz)
+ b := unsafe.Slice((*byte)(unsafe.Pointer(addr)), int(info.Segsz))
return b, nil
}