iovec_32bit.go 531 B

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