github.com/Andyfoo/golang/x/net@v0.0.0-20190901054642-57c1bf301704/internal/socket/defs_darwin.go (about)

     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  
     5  // +build ignore
     6  
     7  // +godefs map struct_in_addr [4]byte /* in_addr */
     8  // +godefs map struct_in6_addr [16]byte /* in6_addr */
     9  
    10  package socket
    11  
    12  /*
    13  #include <sys/socket.h>
    14  
    15  #include <netinet/in.h>
    16  */
    17  import "C"
    18  
    19  type iovec C.struct_iovec
    20  
    21  type msghdr C.struct_msghdr
    22  
    23  type cmsghdr C.struct_cmsghdr
    24  
    25  type sockaddrInet C.struct_sockaddr_in
    26  
    27  type sockaddrInet6 C.struct_sockaddr_in6
    28  
    29  const (
    30  	sizeofIovec   = C.sizeof_struct_iovec
    31  	sizeofMsghdr  = C.sizeof_struct_msghdr
    32  	sizeofCmsghdr = C.sizeof_struct_cmsghdr
    33  
    34  	sizeofSockaddrInet  = C.sizeof_struct_sockaddr_in
    35  	sizeofSockaddrInet6 = C.sizeof_struct_sockaddr_in6
    36  )