A lightweight mechanism to provide an *instant kickstart* to a Go web server instance upon changing any Go source files under the project directory (and its subdirectories).

types_solaris.go 5.4KB

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