msghdr_zos_s390x.go raw

   1  // Copyright 2020 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 s390x && zos
   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.Control = (*byte)(unsafe.Pointer(&oob[0]))
  21  		h.Controllen = uint32(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.Controllen)
  31  }
  32  
  33  func (h *msghdr) flags() int {
  34  	return int(h.Flags)
  35  }
  36