diff options
author | Gibheer <gibheer+git@zero-knowledge.org> | 2022-11-11 11:22:50 +0100 |
---|---|---|
committer | Gibheer <gibheer+git@zero-knowledge.org> | 2022-11-11 11:22:50 +0100 |
commit | fe6bd04947e26a962fab3cf7a354abd44333bda6 (patch) | |
tree | de4714364747c05d391ab665176413eb24938545 /vendor/golang.org/x/sys/unix/syscall_unix.go | |
parent | dc9dfb76ff9375e6368e9e05a40e6dc07b325a8d (diff) |
update dependencies
Diffstat (limited to 'vendor/golang.org/x/sys/unix/syscall_unix.go')
-rw-r--r-- | vendor/golang.org/x/sys/unix/syscall_unix.go | 20 |
1 files changed, 9 insertions, 11 deletions
diff --git a/vendor/golang.org/x/sys/unix/syscall_unix.go b/vendor/golang.org/x/sys/unix/syscall_unix.go index 1ff5060..00bafda 100644 --- a/vendor/golang.org/x/sys/unix/syscall_unix.go +++ b/vendor/golang.org/x/sys/unix/syscall_unix.go @@ -13,8 +13,6 @@ import ( "sync" "syscall" "unsafe" - - "golang.org/x/sys/internal/unsafeheader" ) var ( @@ -117,11 +115,7 @@ func (m *mmapper) Mmap(fd int, offset int64, length int, prot int, flags int) (d } // Use unsafe to convert addr into a []byte. - var b []byte - hdr := (*unsafeheader.Slice)(unsafe.Pointer(&b)) - hdr.Data = unsafe.Pointer(addr) - hdr.Cap = length - hdr.Len = length + b := unsafe.Slice((*byte)(unsafe.Pointer(addr)), length) // Register mapping in m and return it. p := &b[cap(b)-1] @@ -429,11 +423,15 @@ func Send(s int, buf []byte, flags int) (err error) { } func Sendto(fd int, p []byte, flags int, to Sockaddr) (err error) { - ptr, n, err := to.sockaddr() - if err != nil { - return err + var ptr unsafe.Pointer + var salen _Socklen + if to != nil { + ptr, salen, err = to.sockaddr() + if err != nil { + return err + } } - return sendto(fd, p, flags, ptr, n) + return sendto(fd, p, flags, ptr, salen) } func SetsockoptByte(fd, level, opt int, value byte) (err error) { |