You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

types_aix.go 4.2KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237
  1. // Copyright 2018 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. // +build aix
  6. /*
  7. Input to cgo -godefs. See also mkerrors.sh and mkall.sh
  8. */
  9. // +godefs map struct_in_addr [4]byte /* in_addr */
  10. // +godefs map struct_in6_addr [16]byte /* in6_addr */
  11. package unix
  12. /*
  13. #include <sys/types.h>
  14. #include <sys/time.h>
  15. #include <sys/limits.h>
  16. #include <sys/un.h>
  17. #include <utime.h>
  18. #include <sys/utsname.h>
  19. #include <sys/poll.h>
  20. #include <sys/resource.h>
  21. #include <sys/stat.h>
  22. #include <sys/statfs.h>
  23. #include <sys/termio.h>
  24. #include <sys/ioctl.h>
  25. #include <termios.h>
  26. #include <net/if.h>
  27. #include <net/if_dl.h>
  28. #include <netinet/in.h>
  29. #include <netinet/icmp6.h>
  30. #include <dirent.h>
  31. #include <fcntl.h>
  32. enum {
  33. sizeofPtr = sizeof(void*),
  34. };
  35. union sockaddr_all {
  36. struct sockaddr s1; // this one gets used for fields
  37. struct sockaddr_in s2; // these pad it out
  38. struct sockaddr_in6 s3;
  39. struct sockaddr_un s4;
  40. struct sockaddr_dl s5;
  41. };
  42. struct sockaddr_any {
  43. struct sockaddr addr;
  44. char pad[sizeof(union sockaddr_all) - sizeof(struct sockaddr)];
  45. };
  46. */
  47. import "C"
  48. // Machine characteristics
  49. const (
  50. SizeofPtr = C.sizeofPtr
  51. SizeofShort = C.sizeof_short
  52. SizeofInt = C.sizeof_int
  53. SizeofLong = C.sizeof_long
  54. SizeofLongLong = C.sizeof_longlong
  55. PathMax = C.PATH_MAX
  56. )
  57. // Basic types
  58. type (
  59. _C_short C.short
  60. _C_int C.int
  61. _C_long C.long
  62. _C_long_long C.longlong
  63. )
  64. type off64 C.off64_t
  65. type off C.off_t
  66. type Mode_t C.mode_t
  67. // Time
  68. type Timespec C.struct_timespec
  69. type Timeval C.struct_timeval
  70. type Timeval32 C.struct_timeval32
  71. type Timex C.struct_timex
  72. type Time_t C.time_t
  73. type Tms C.struct_tms
  74. type Utimbuf C.struct_utimbuf
  75. type Timezone C.struct_timezone
  76. // Processes
  77. type Rusage C.struct_rusage
  78. type Rlimit C.struct_rlimit64
  79. type Pid_t C.pid_t
  80. type _Gid_t C.gid_t
  81. type dev_t C.dev_t
  82. // Files
  83. type Stat_t C.struct_stat
  84. type StatxTimestamp C.struct_statx_timestamp
  85. type Statx_t C.struct_statx
  86. type Dirent C.struct_dirent
  87. // Sockets
  88. type RawSockaddrInet4 C.struct_sockaddr_in
  89. type RawSockaddrInet6 C.struct_sockaddr_in6
  90. type RawSockaddrUnix C.struct_sockaddr_un
  91. type RawSockaddrDatalink C.struct_sockaddr_dl
  92. type RawSockaddr C.struct_sockaddr
  93. type RawSockaddrAny C.struct_sockaddr_any
  94. type _Socklen C.socklen_t
  95. type Cmsghdr C.struct_cmsghdr
  96. type ICMPv6Filter C.struct_icmp6_filter
  97. type Iovec C.struct_iovec
  98. type IPMreq C.struct_ip_mreq
  99. type IPv6Mreq C.struct_ipv6_mreq
  100. type IPv6MTUInfo C.struct_ip6_mtuinfo
  101. type Linger C.struct_linger
  102. type Msghdr C.struct_msghdr
  103. const (
  104. SizeofSockaddrInet4 = C.sizeof_struct_sockaddr_in
  105. SizeofSockaddrInet6 = C.sizeof_struct_sockaddr_in6
  106. SizeofSockaddrAny = C.sizeof_struct_sockaddr_any
  107. SizeofSockaddrUnix = C.sizeof_struct_sockaddr_un
  108. SizeofSockaddrDatalink = C.sizeof_struct_sockaddr_dl
  109. SizeofLinger = C.sizeof_struct_linger
  110. SizeofIPMreq = C.sizeof_struct_ip_mreq
  111. SizeofIPv6Mreq = C.sizeof_struct_ipv6_mreq
  112. SizeofIPv6MTUInfo = C.sizeof_struct_ip6_mtuinfo
  113. SizeofMsghdr = C.sizeof_struct_msghdr
  114. SizeofCmsghdr = C.sizeof_struct_cmsghdr
  115. SizeofICMPv6Filter = C.sizeof_struct_icmp6_filter
  116. )
  117. // Routing and interface messages
  118. const (
  119. SizeofIfMsghdr = C.sizeof_struct_if_msghdr
  120. )
  121. type IfMsgHdr C.struct_if_msghdr
  122. // Misc
  123. type FdSet C.fd_set
  124. type Utsname C.struct_utsname
  125. type Ustat_t C.struct_ustat
  126. type Sigset_t C.sigset_t
  127. const (
  128. AT_FDCWD = C.AT_FDCWD
  129. AT_REMOVEDIR = C.AT_REMOVEDIR
  130. AT_SYMLINK_NOFOLLOW = C.AT_SYMLINK_NOFOLLOW
  131. )
  132. // Terminal handling
  133. type Termios C.struct_termios
  134. type Termio C.struct_termio
  135. type Winsize C.struct_winsize
  136. //poll
  137. type PollFd struct {
  138. Fd int32
  139. Events uint16
  140. Revents uint16
  141. }
  142. const (
  143. POLLERR = C.POLLERR
  144. POLLHUP = C.POLLHUP
  145. POLLIN = C.POLLIN
  146. POLLNVAL = C.POLLNVAL
  147. POLLOUT = C.POLLOUT
  148. POLLPRI = C.POLLPRI
  149. POLLRDBAND = C.POLLRDBAND
  150. POLLRDNORM = C.POLLRDNORM
  151. POLLWRBAND = C.POLLWRBAND
  152. POLLWRNORM = C.POLLWRNORM
  153. )
  154. //flock_t
  155. type Flock_t C.struct_flock64
  156. // Statfs
  157. type Fsid_t C.struct_fsid_t
  158. type Fsid64_t C.struct_fsid64_t
  159. type Statfs_t C.struct_statfs
  160. const RNDGETENTCNT = 0x80045200