github.com/etecs-ru/go-sys-wineventlog@v0.0.0-20210227233244-4c3abb794018/unix/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  //go:build ignore
     6  // +build ignore
     7  
     8  /*
     9  Input to cgo -godefs.  See README.md
    10  */
    11  
    12  // +godefs map struct_in_addr [4]byte /* in_addr */
    13  // +godefs map struct_in6_addr [16]byte /* in6_addr */
    14  
    15  package unix
    16  
    17  /*
    18  #define KERNEL
    19  // These defines ensure that builds done on newer versions of Solaris are
    20  // backwards-compatible with older versions of Solaris and
    21  // OpenSolaris-based derivatives.
    22  #define __USE_SUNOS_SOCKETS__          // msghdr
    23  #define __USE_LEGACY_PROTOTYPES__      // iovec
    24  #include <dirent.h>
    25  #include <fcntl.h>
    26  #include <netdb.h>
    27  #include <limits.h>
    28  #include <poll.h>
    29  #include <signal.h>
    30  #include <termios.h>
    31  #include <termio.h>
    32  #include <stdio.h>
    33  #include <unistd.h>
    34  #include <sys/mman.h>
    35  #include <sys/mount.h>
    36  #include <sys/param.h>
    37  #include <sys/resource.h>
    38  #include <sys/select.h>
    39  #include <sys/signal.h>
    40  #include <sys/socket.h>
    41  #include <sys/stat.h>
    42  #include <sys/statvfs.h>
    43  #include <sys/time.h>
    44  #include <sys/times.h>
    45  #include <sys/types.h>
    46  #include <sys/utsname.h>
    47  #include <sys/un.h>
    48  #include <sys/wait.h>
    49  #include <net/bpf.h>
    50  #include <net/if.h>
    51  #include <net/if_dl.h>
    52  #include <net/route.h>
    53  #include <netinet/in.h>
    54  #include <netinet/icmp6.h>
    55  #include <netinet/tcp.h>
    56  #include <ustat.h>
    57  #include <utime.h>
    58  
    59  enum {
    60  	sizeofPtr = sizeof(void*),
    61  };
    62  
    63  union sockaddr_all {
    64  	struct sockaddr s1;	// this one gets used for fields
    65  	struct sockaddr_in s2;	// these pad it out
    66  	struct sockaddr_in6 s3;
    67  	struct sockaddr_un s4;
    68  	struct sockaddr_dl s5;
    69  };
    70  
    71  struct sockaddr_any {
    72  	struct sockaddr addr;
    73  	char pad[sizeof(union sockaddr_all) - sizeof(struct sockaddr)];
    74  };
    75  
    76  */
    77  import "C"
    78  
    79  // Machine characteristics
    80  
    81  const (
    82  	SizeofPtr      = C.sizeofPtr
    83  	SizeofShort    = C.sizeof_short
    84  	SizeofInt      = C.sizeof_int
    85  	SizeofLong     = C.sizeof_long
    86  	SizeofLongLong = C.sizeof_longlong
    87  	PathMax        = C.PATH_MAX
    88  	MaxHostNameLen = C.MAXHOSTNAMELEN
    89  )
    90  
    91  // Basic types
    92  
    93  type (
    94  	_C_short     C.short
    95  	_C_int       C.int
    96  	_C_long      C.long
    97  	_C_long_long C.longlong
    98  )
    99  
   100  // Time
   101  
   102  type Timespec C.struct_timespec
   103  
   104  type Timeval C.struct_timeval
   105  
   106  type Timeval32 C.struct_timeval32
   107  
   108  type Tms C.struct_tms
   109  
   110  type Utimbuf C.struct_utimbuf
   111  
   112  // Processes
   113  
   114  type Rusage C.struct_rusage
   115  
   116  type Rlimit C.struct_rlimit
   117  
   118  type _Gid_t C.gid_t
   119  
   120  // Files
   121  
   122  type Stat_t C.struct_stat
   123  
   124  type Flock_t C.struct_flock
   125  
   126  type Dirent C.struct_dirent
   127  
   128  // Filesystems
   129  
   130  type _Fsblkcnt_t C.fsblkcnt_t
   131  
   132  type Statvfs_t C.struct_statvfs
   133  
   134  // Sockets
   135  
   136  type RawSockaddrInet4 C.struct_sockaddr_in
   137  
   138  type RawSockaddrInet6 C.struct_sockaddr_in6
   139  
   140  type RawSockaddrUnix C.struct_sockaddr_un
   141  
   142  type RawSockaddrDatalink C.struct_sockaddr_dl
   143  
   144  type RawSockaddr C.struct_sockaddr
   145  
   146  type RawSockaddrAny C.struct_sockaddr_any
   147  
   148  type _Socklen C.socklen_t
   149  
   150  type Linger C.struct_linger
   151  
   152  type Iovec C.struct_iovec
   153  
   154  type IPMreq C.struct_ip_mreq
   155  
   156  type IPv6Mreq C.struct_ipv6_mreq
   157  
   158  type Msghdr C.struct_msghdr
   159  
   160  type Cmsghdr C.struct_cmsghdr
   161  
   162  type Inet4Pktinfo C.struct_in_pktinfo
   163  
   164  type Inet6Pktinfo C.struct_in6_pktinfo
   165  
   166  type IPv6MTUInfo C.struct_ip6_mtuinfo
   167  
   168  type ICMPv6Filter C.struct_icmp6_filter
   169  
   170  const (
   171  	SizeofSockaddrInet4    = C.sizeof_struct_sockaddr_in
   172  	SizeofSockaddrInet6    = C.sizeof_struct_sockaddr_in6
   173  	SizeofSockaddrAny      = C.sizeof_struct_sockaddr_any
   174  	SizeofSockaddrUnix     = C.sizeof_struct_sockaddr_un
   175  	SizeofSockaddrDatalink = C.sizeof_struct_sockaddr_dl
   176  	SizeofLinger           = C.sizeof_struct_linger
   177  	SizeofIovec            = C.sizeof_struct_iovec
   178  	SizeofIPMreq           = C.sizeof_struct_ip_mreq
   179  	SizeofIPv6Mreq         = C.sizeof_struct_ipv6_mreq
   180  	SizeofMsghdr           = C.sizeof_struct_msghdr
   181  	SizeofCmsghdr          = C.sizeof_struct_cmsghdr
   182  	SizeofInet4Pktinfo     = C.sizeof_struct_in_pktinfo
   183  	SizeofInet6Pktinfo     = C.sizeof_struct_in6_pktinfo
   184  	SizeofIPv6MTUInfo      = C.sizeof_struct_ip6_mtuinfo
   185  	SizeofICMPv6Filter     = C.sizeof_struct_icmp6_filter
   186  )
   187  
   188  // Select
   189  
   190  type FdSet C.fd_set
   191  
   192  // Misc
   193  
   194  type Utsname C.struct_utsname
   195  
   196  type Ustat_t C.struct_ustat
   197  
   198  const (
   199  	AT_FDCWD            = C.AT_FDCWD
   200  	AT_SYMLINK_NOFOLLOW = C.AT_SYMLINK_NOFOLLOW
   201  	AT_SYMLINK_FOLLOW   = C.AT_SYMLINK_FOLLOW
   202  	AT_REMOVEDIR        = C.AT_REMOVEDIR
   203  	AT_EACCESS          = C.AT_EACCESS
   204  )
   205  
   206  // Routing and interface messages
   207  
   208  const (
   209  	SizeofIfMsghdr  = C.sizeof_struct_if_msghdr
   210  	SizeofIfData    = C.sizeof_struct_if_data
   211  	SizeofIfaMsghdr = C.sizeof_struct_ifa_msghdr
   212  	SizeofRtMsghdr  = C.sizeof_struct_rt_msghdr
   213  	SizeofRtMetrics = C.sizeof_struct_rt_metrics
   214  )
   215  
   216  type IfMsghdr C.struct_if_msghdr
   217  
   218  type IfData C.struct_if_data
   219  
   220  type IfaMsghdr C.struct_ifa_msghdr
   221  
   222  type RtMsghdr C.struct_rt_msghdr
   223  
   224  type RtMetrics C.struct_rt_metrics
   225  
   226  // Berkeley packet filter
   227  
   228  const (
   229  	SizeofBpfVersion = C.sizeof_struct_bpf_version
   230  	SizeofBpfStat    = C.sizeof_struct_bpf_stat
   231  	SizeofBpfProgram = C.sizeof_struct_bpf_program
   232  	SizeofBpfInsn    = C.sizeof_struct_bpf_insn
   233  	SizeofBpfHdr     = C.sizeof_struct_bpf_hdr
   234  )
   235  
   236  type BpfVersion C.struct_bpf_version
   237  
   238  type BpfStat C.struct_bpf_stat
   239  
   240  type BpfProgram C.struct_bpf_program
   241  
   242  type BpfInsn C.struct_bpf_insn
   243  
   244  type BpfTimeval C.struct_bpf_timeval
   245  
   246  type BpfHdr C.struct_bpf_hdr
   247  
   248  // Terminal handling
   249  
   250  type Termios C.struct_termios
   251  
   252  type Termio C.struct_termio
   253  
   254  type Winsize C.struct_winsize
   255  
   256  // poll
   257  
   258  type PollFd C.struct_pollfd
   259  
   260  const (
   261  	POLLERR    = C.POLLERR
   262  	POLLHUP    = C.POLLHUP
   263  	POLLIN     = C.POLLIN
   264  	POLLNVAL   = C.POLLNVAL
   265  	POLLOUT    = C.POLLOUT
   266  	POLLPRI    = C.POLLPRI
   267  	POLLRDBAND = C.POLLRDBAND
   268  	POLLRDNORM = C.POLLRDNORM
   269  	POLLWRBAND = C.POLLWRBAND
   270  	POLLWRNORM = C.POLLWRNORM
   271  )