diff vendor/golang.org/x/sys/unix/sysvshm_unix.go @ 68:4b79810863f6 draft

Ready to release 0.6.0 Signed-off-by: Izuru Yakumo <yakumo.izuru@chaotic.ninja>
author yakumo.izuru
date Wed, 13 Sep 2023 10:49:50 +0000
parents 787b5ee0289d
children
line wrap: on
line diff
--- a/vendor/golang.org/x/sys/unix/sysvshm_unix.go	Thu Sep 07 16:52:43 2023 +0000
+++ b/vendor/golang.org/x/sys/unix/sysvshm_unix.go	Wed Sep 13 10:49:50 2023 +0000
@@ -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 @@
 	}
 
 	// 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
 }