msghdr_helper_linux_64.go 580 B

12345678910111213141516171819202122232425
  1. //go:build linux && (amd64 || arm64 || ppc64 || ppc64le || mips64 || mips64le || s390x || riscv64 || loong64) && !android && !e2e_testing
  2. // +build linux
  3. // +build amd64 arm64 ppc64 ppc64le mips64 mips64le s390x riscv64 loong64
  4. // +build !android
  5. // +build !e2e_testing
  6. package udp
  7. import "golang.org/x/sys/unix"
  8. func controllen(n int) uint64 {
  9. return uint64(n)
  10. }
  11. func setCmsgLen(h *unix.Cmsghdr, n int) {
  12. h.Len = uint64(unix.CmsgLen(n))
  13. }
  14. func setIovecLen(v *unix.Iovec, n int) {
  15. v.Len = uint64(n)
  16. }
  17. func setMsghdrIovlen(m *unix.Msghdr, n int) {
  18. m.Iovlen = uint64(n)
  19. }