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_darwin.go 5.0KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250
  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 __DARWIN_UNIX03 0
  13. #define KERNEL
  14. #define _DARWIN_USE_64_BIT_INODE
  15. #include <dirent.h>
  16. #include <fcntl.h>
  17. #include <signal.h>
  18. #include <termios.h>
  19. #include <unistd.h>
  20. #include <mach/mach.h>
  21. #include <mach/message.h>
  22. #include <sys/event.h>
  23. #include <sys/mman.h>
  24. #include <sys/mount.h>
  25. #include <sys/param.h>
  26. #include <sys/ptrace.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/uio.h>
  35. #include <sys/un.h>
  36. #include <sys/wait.h>
  37. #include <net/bpf.h>
  38. #include <net/if.h>
  39. #include <net/if_dl.h>
  40. #include <net/if_var.h>
  41. #include <net/route.h>
  42. #include <netinet/in.h>
  43. #include <netinet/icmp6.h>
  44. #include <netinet/tcp.h>
  45. enum {
  46. sizeofPtr = sizeof(void*),
  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. struct sockaddr_any {
  56. struct sockaddr addr;
  57. char pad[sizeof(union sockaddr_all) - sizeof(struct sockaddr)];
  58. };
  59. */
  60. import "C"
  61. // Machine characteristics; for internal use.
  62. const (
  63. sizeofPtr = C.sizeofPtr
  64. sizeofShort = C.sizeof_short
  65. sizeofInt = C.sizeof_int
  66. sizeofLong = C.sizeof_long
  67. sizeofLongLong = C.sizeof_longlong
  68. )
  69. // Basic types
  70. type (
  71. _C_short C.short
  72. _C_int C.int
  73. _C_long C.long
  74. _C_long_long C.longlong
  75. )
  76. // Time
  77. type Timespec C.struct_timespec
  78. type Timeval C.struct_timeval
  79. type Timeval32 C.struct_timeval32
  80. // Processes
  81. type Rusage C.struct_rusage
  82. type Rlimit C.struct_rlimit
  83. type _Gid_t C.gid_t
  84. // Files
  85. type Stat_t C.struct_stat64
  86. type Statfs_t C.struct_statfs64
  87. type Flock_t C.struct_flock
  88. type Fstore_t C.struct_fstore
  89. type Radvisory_t C.struct_radvisory
  90. type Fbootstraptransfer_t C.struct_fbootstraptransfer
  91. type Log2phys_t C.struct_log2phys
  92. type Fsid C.struct_fsid
  93. type Dirent C.struct_dirent
  94. // Sockets
  95. type RawSockaddrInet4 C.struct_sockaddr_in
  96. type RawSockaddrInet6 C.struct_sockaddr_in6
  97. type RawSockaddrUnix C.struct_sockaddr_un
  98. type RawSockaddrDatalink C.struct_sockaddr_dl
  99. type RawSockaddr C.struct_sockaddr
  100. type RawSockaddrAny C.struct_sockaddr_any
  101. type _Socklen C.socklen_t
  102. type Linger C.struct_linger
  103. type Iovec C.struct_iovec
  104. type IPMreq C.struct_ip_mreq
  105. type IPv6Mreq C.struct_ipv6_mreq
  106. type Msghdr C.struct_msghdr
  107. type Cmsghdr C.struct_cmsghdr
  108. type Inet4Pktinfo C.struct_in_pktinfo
  109. type Inet6Pktinfo C.struct_in6_pktinfo
  110. type IPv6MTUInfo C.struct_ip6_mtuinfo
  111. type ICMPv6Filter C.struct_icmp6_filter
  112. const (
  113. SizeofSockaddrInet4 = C.sizeof_struct_sockaddr_in
  114. SizeofSockaddrInet6 = C.sizeof_struct_sockaddr_in6
  115. SizeofSockaddrAny = C.sizeof_struct_sockaddr_any
  116. SizeofSockaddrUnix = C.sizeof_struct_sockaddr_un
  117. SizeofSockaddrDatalink = C.sizeof_struct_sockaddr_dl
  118. SizeofLinger = C.sizeof_struct_linger
  119. SizeofIPMreq = C.sizeof_struct_ip_mreq
  120. SizeofIPv6Mreq = C.sizeof_struct_ipv6_mreq
  121. SizeofMsghdr = C.sizeof_struct_msghdr
  122. SizeofCmsghdr = C.sizeof_struct_cmsghdr
  123. SizeofInet4Pktinfo = C.sizeof_struct_in_pktinfo
  124. SizeofInet6Pktinfo = C.sizeof_struct_in6_pktinfo
  125. SizeofIPv6MTUInfo = C.sizeof_struct_ip6_mtuinfo
  126. SizeofICMPv6Filter = C.sizeof_struct_icmp6_filter
  127. )
  128. // Ptrace requests
  129. const (
  130. PTRACE_TRACEME = C.PT_TRACE_ME
  131. PTRACE_CONT = C.PT_CONTINUE
  132. PTRACE_KILL = C.PT_KILL
  133. )
  134. // Events (kqueue, kevent)
  135. type Kevent_t C.struct_kevent
  136. // Select
  137. type FdSet C.fd_set
  138. // Routing and interface messages
  139. const (
  140. SizeofIfMsghdr = C.sizeof_struct_if_msghdr
  141. SizeofIfData = C.sizeof_struct_if_data
  142. SizeofIfaMsghdr = C.sizeof_struct_ifa_msghdr
  143. SizeofIfmaMsghdr = C.sizeof_struct_ifma_msghdr
  144. SizeofIfmaMsghdr2 = C.sizeof_struct_ifma_msghdr2
  145. SizeofRtMsghdr = C.sizeof_struct_rt_msghdr
  146. SizeofRtMetrics = C.sizeof_struct_rt_metrics
  147. )
  148. type IfMsghdr C.struct_if_msghdr
  149. type IfData C.struct_if_data
  150. type IfaMsghdr C.struct_ifa_msghdr
  151. type IfmaMsghdr C.struct_ifma_msghdr
  152. type IfmaMsghdr2 C.struct_ifma_msghdr2
  153. type RtMsghdr C.struct_rt_msghdr
  154. type RtMetrics C.struct_rt_metrics
  155. // Berkeley packet filter
  156. const (
  157. SizeofBpfVersion = C.sizeof_struct_bpf_version
  158. SizeofBpfStat = C.sizeof_struct_bpf_stat
  159. SizeofBpfProgram = C.sizeof_struct_bpf_program
  160. SizeofBpfInsn = C.sizeof_struct_bpf_insn
  161. SizeofBpfHdr = C.sizeof_struct_bpf_hdr
  162. )
  163. type BpfVersion C.struct_bpf_version
  164. type BpfStat C.struct_bpf_stat
  165. type BpfProgram C.struct_bpf_program
  166. type BpfInsn C.struct_bpf_insn
  167. type BpfHdr C.struct_bpf_hdr
  168. // Terminal handling
  169. type Termios C.struct_termios
  170. // fchmodat-like syscalls.
  171. const (
  172. AT_FDCWD = C.AT_FDCWD
  173. AT_SYMLINK_NOFOLLOW = C.AT_SYMLINK_NOFOLLOW
  174. )