cmsghdr_unix.go 487 B

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