msghdr_solaris_64bit.go raw
1 // Copyright 2017 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 //go:build amd64 && solaris
6
7 package socket
8
9 import "unsafe"
10
11 func (h *msghdr) pack(vs []iovec, bs [][]byte, oob []byte, sa []byte) {
12 for i := range vs {
13 vs[i].set(bs[i])
14 }
15 if len(vs) > 0 {
16 h.Iov = &vs[0]
17 h.Iovlen = int32(len(vs))
18 }
19 if len(oob) > 0 {
20 h.Accrights = (*int8)(unsafe.Pointer(&oob[0]))
21 h.Accrightslen = int32(len(oob))
22 }
23 if sa != nil {
24 h.Name = (*byte)(unsafe.Pointer(&sa[0]))
25 h.Namelen = uint32(len(sa))
26 }
27 }
28
29 func (h *msghdr) controllen() int {
30 return int(h.Accrightslen)
31 }
32
33 func (h *msghdr) flags() int {
34 return int(NativeEndian.Uint32(h.Pad_cgo_2[:]))
35 }
36