iovec_32bit.go 441 B

123456789101112131415161718
  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. //go:build (arm || mips || mipsle || 386 || ppc) && (darwin || dragonfly || freebsd || linux || netbsd || openbsd)
  5. package socket
  6. import "unsafe"
  7. func (v *iovec) set(b []byte) {
  8. l := len(b)
  9. if l == 0 {
  10. return
  11. }
  12. v.Base = (*byte)(unsafe.Pointer(&b[0]))
  13. v.Len = uint32(l)
  14. }