github.com/tcnksm/go@v0.0.0-20141208075154-439b32936367/src/syscall/types_solaris.go (about)

     1  // Copyright 2009 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  /*
     8  Input to cgo -godefs.  See also mkerrors.sh and mkall.sh
     9  */
    10  
    11  // +godefs map struct_in_addr [4]byte /* in_addr */
    12  // +godefs map struct_in6_addr [16]byte /* in6_addr */
    13  
    14  package syscall
    15  
    16  /*
    17  #define KERNEL
    18  #include <dirent.h>
    19  #include <fcntl.h>
    20  #include <signal.h>
    21  #include <termios.h>
    22  #include <stdio.h>
    23  #include <unistd.h>
    24  #include <sys/mman.h>
    25  #include <sys/mount.h>
    26  #include <sys/param.h>
    27  #include <sys/resource.h>
    28  #include <sys/select.h>
    29  #include <sys/signal.h>
    30  #include <sys/socket.h>
    31  #include <sys/stat.h>
    32  #include <sys/time.h>
    33  #include <sys/types.h>
    34  #include <sys/un.h>
    35  #include <sys/wait.h>
    36  #include <net/bpf.h>
    37  #include <net/if.h>
    38  #include <net/if_dl.h>
    39  #include <net/route.h>
    40  #include <netinet/in.h>
    41  #include <netinet/icmp6.h>
    42  #include <netinet/tcp.h>
    43  
    44  enum {
    45  	sizeofPtr = sizeof(void*),
    46  };
    47  
    48  union sockaddr_all {
    49  	struct sockaddr s1;	// this one gets used for fields
    50  	struct sockaddr_in s2;	// these pad it out
    51  	struct sockaddr_in6 s3;
    52  	struct sockaddr_un s4;
    53  	struct sockaddr_dl s5;
    54  };
    55  
    56  struct sockaddr_any {
    57  	struct sockaddr addr;
    58  	char pad[sizeof(union sockaddr_all) - sizeof(struct sockaddr)];
    59  };
    60  
    61  */
    62  import "C"
    63  
    64  // Machine characteristics; for internal use.
    65  
    66  const (
    67  	sizeofPtr      = C.sizeofPtr
    68  	sizeofShort    = C.sizeof_short
    69  	sizeofInt      = C.sizeof_int
    70  	sizeofLong     = C.sizeof_long
    71  	sizeofLongLong = C.sizeof_longlong
    72  )
    73  
    74  // Basic types
    75  
    76  type (
    77  	_C_short     C.short
    78  	_C_int       C.int
    79  	_C_long      C.long
    80  	_C_long_long C.longlong
    81  )
    82  
    83  // Time
    84  
    85  type Timespec C.struct_timespec
    86  
    87  type Timeval C.struct_timeval
    88  
    89  type Timeval32 C.struct_timeval32
    90  
    91  // Processes
    92  
    93  type Rusage C.struct_rusage
    94  
    95  type Rlimit C.struct_rlimit
    96  
    97  type _Gid_t C.gid_t
    98  
    99  // Files
   100  
   101  const ( // Directory mode bits
   102  	S_IFMT   = C.S_IFMT
   103  	S_IFIFO  = C.S_IFIFO
   104  	S_IFCHR  = C.S_IFCHR
   105  	S_IFDIR  = C.S_IFDIR
   106  	S_IFBLK  = C.S_IFBLK
   107  	S_IFREG  = C.S_IFREG
   108  	S_IFLNK  = C.S_IFLNK
   109  	S_IFSOCK = C.S_IFSOCK
   110  	S_ISUID  = C.S_ISUID
   111  	S_ISGID  = C.S_ISGID
   112  	S_ISVTX  = C.S_ISVTX
   113  	S_IRUSR  = C.S_IRUSR
   114  	S_IWUSR  = C.S_IWUSR
   115  	S_IXUSR  = C.S_IXUSR
   116  )
   117  
   118  type Stat_t C.struct_stat
   119  
   120  type Flock_t C.struct_flock
   121  
   122  type Dirent C.struct_dirent
   123  
   124  // Sockets
   125  
   126  type RawSockaddrInet4 C.struct_sockaddr_in
   127  
   128  type RawSockaddrInet6 C.struct_sockaddr_in6
   129  
   130  type RawSockaddrUnix C.struct_sockaddr_un
   131  
   132  type RawSockaddrDatalink C.struct_sockaddr_dl
   133  
   134  type RawSockaddr C.struct_sockaddr
   135  
   136  type RawSockaddrAny C.struct_sockaddr_any
   137  
   138  type _Socklen C.socklen_t
   139  
   140  type Linger C.struct_linger
   141  
   142  type Iovec C.struct_iovec
   143  
   144  type IPMreq C.struct_ip_mreq
   145  
   146  type IPv6Mreq C.struct_ipv6_mreq
   147  
   148  type Msghdr C.struct_msghdr
   149  
   150  type Cmsghdr C.struct_cmsghdr
   151  
   152  type Inet6Pktinfo C.struct_in6_pktinfo
   153  
   154  type IPv6MTUInfo C.struct_ip6_mtuinfo
   155  
   156  type ICMPv6Filter C.struct_icmp6_filter
   157  
   158  const (
   159  	SizeofSockaddrInet4    = C.sizeof_struct_sockaddr_in
   160  	SizeofSockaddrInet6    = C.sizeof_struct_sockaddr_in6
   161  	SizeofSockaddrAny      = C.sizeof_struct_sockaddr_any
   162  	SizeofSockaddrUnix     = C.sizeof_struct_sockaddr_un
   163  	SizeofSockaddrDatalink = C.sizeof_struct_sockaddr_dl
   164  	SizeofLinger           = C.sizeof_struct_linger
   165  	SizeofIPMreq           = C.sizeof_struct_ip_mreq
   166  	SizeofIPv6Mreq         = C.sizeof_struct_ipv6_mreq
   167  	SizeofMsghdr           = C.sizeof_struct_msghdr
   168  	SizeofCmsghdr          = C.sizeof_struct_cmsghdr
   169  	SizeofInet6Pktinfo     = C.sizeof_struct_in6_pktinfo
   170  	SizeofIPv6MTUInfo      = C.sizeof_struct_ip6_mtuinfo
   171  	SizeofICMPv6Filter     = C.sizeof_struct_icmp6_filter
   172  )
   173  
   174  // Select
   175  
   176  type FdSet C.fd_set
   177  
   178  // Routing and interface messages
   179  
   180  const (
   181  	SizeofIfMsghdr  = C.sizeof_struct_if_msghdr
   182  	SizeofIfData    = C.sizeof_struct_if_data
   183  	SizeofIfaMsghdr = C.sizeof_struct_ifa_msghdr
   184  	SizeofRtMsghdr  = C.sizeof_struct_rt_msghdr
   185  	SizeofRtMetrics = C.sizeof_struct_rt_metrics
   186  )
   187  
   188  type IfMsghdr C.struct_if_msghdr
   189  
   190  type IfData C.struct_if_data
   191  
   192  type IfaMsghdr C.struct_ifa_msghdr
   193  
   194  type RtMsghdr C.struct_rt_msghdr
   195  
   196  type RtMetrics C.struct_rt_metrics
   197  
   198  // Berkeley packet filter
   199  
   200  const (
   201  	SizeofBpfVersion = C.sizeof_struct_bpf_version
   202  	SizeofBpfStat    = C.sizeof_struct_bpf_stat
   203  	SizeofBpfProgram = C.sizeof_struct_bpf_program
   204  	SizeofBpfInsn    = C.sizeof_struct_bpf_insn
   205  	SizeofBpfHdr     = C.sizeof_struct_bpf_hdr
   206  )
   207  
   208  type BpfVersion C.struct_bpf_version
   209  
   210  type BpfStat C.struct_bpf_stat
   211  
   212  type BpfProgram C.struct_bpf_program
   213  
   214  type BpfInsn C.struct_bpf_insn
   215  
   216  type BpfTimeval C.struct_bpf_timeval
   217  
   218  type BpfHdr C.struct_bpf_hdr
   219  
   220  // Terminal handling
   221  
   222  type Termios C.struct_termios