cmsghdr_unix.go 588 B

12345678910111213141516171819202122
  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. //go:build aix || darwin || dragonfly || freebsd || linux || netbsd || openbsd || solaris || zos
  5. // +build aix darwin dragonfly freebsd linux netbsd openbsd solaris zos
  6. package socket
  7. import "golang.org/x/sys/unix"
  8. func controlHeaderLen() int {
  9. return unix.CmsgLen(0)
  10. }
  11. func controlMessageLen(dataLen int) int {
  12. return unix.CmsgLen(dataLen)
  13. }
  14. func controlMessageSpace(dataLen int) int {
  15. return unix.CmsgSpace(dataLen)
  16. }