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.

ztypes_zos_s390x.go 6.7KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414
  1. // Copyright 2020 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. //go:build zos && s390x
  5. // Hand edited based on ztypes_linux_s390x.go
  6. // TODO: auto-generate.
  7. package unix
  8. const (
  9. SizeofPtr = 0x8
  10. SizeofShort = 0x2
  11. SizeofInt = 0x4
  12. SizeofLong = 0x8
  13. SizeofLongLong = 0x8
  14. PathMax = 0x1000
  15. )
  16. const (
  17. SizeofSockaddrAny = 128
  18. SizeofCmsghdr = 12
  19. SizeofIPMreq = 8
  20. SizeofIPv6Mreq = 20
  21. SizeofICMPv6Filter = 32
  22. SizeofIPv6MTUInfo = 32
  23. SizeofLinger = 8
  24. SizeofSockaddrInet4 = 16
  25. SizeofSockaddrInet6 = 28
  26. SizeofTCPInfo = 0x68
  27. )
  28. type (
  29. _C_short int16
  30. _C_int int32
  31. _C_long int64
  32. _C_long_long int64
  33. )
  34. type Timespec struct {
  35. Sec int64
  36. Nsec int64
  37. }
  38. type Timeval struct {
  39. Sec int64
  40. Usec int64
  41. }
  42. type timeval_zos struct { //correct (with padding and all)
  43. Sec int64
  44. _ [4]byte // pad
  45. Usec int32
  46. }
  47. type Tms struct { //clock_t is 4-byte unsigned int in zos
  48. Utime uint32
  49. Stime uint32
  50. Cutime uint32
  51. Cstime uint32
  52. }
  53. type Time_t int64
  54. type Utimbuf struct {
  55. Actime int64
  56. Modtime int64
  57. }
  58. type Utsname struct {
  59. Sysname [65]byte
  60. Nodename [65]byte
  61. Release [65]byte
  62. Version [65]byte
  63. Machine [65]byte
  64. Domainname [65]byte
  65. }
  66. type RawSockaddrInet4 struct {
  67. Len uint8
  68. Family uint8
  69. Port uint16
  70. Addr [4]byte /* in_addr */
  71. Zero [8]uint8
  72. }
  73. type RawSockaddrInet6 struct {
  74. Len uint8
  75. Family uint8
  76. Port uint16
  77. Flowinfo uint32
  78. Addr [16]byte /* in6_addr */
  79. Scope_id uint32
  80. }
  81. type RawSockaddrUnix struct {
  82. Len uint8
  83. Family uint8
  84. Path [108]int8
  85. }
  86. type RawSockaddr struct {
  87. Len uint8
  88. Family uint8
  89. Data [14]uint8
  90. }
  91. type RawSockaddrAny struct {
  92. Addr RawSockaddr
  93. _ [112]uint8 // pad
  94. }
  95. type _Socklen uint32
  96. type Linger struct {
  97. Onoff int32
  98. Linger int32
  99. }
  100. type Iovec struct {
  101. Base *byte
  102. Len uint64
  103. }
  104. type IPMreq struct {
  105. Multiaddr [4]byte /* in_addr */
  106. Interface [4]byte /* in_addr */
  107. }
  108. type IPv6Mreq struct {
  109. Multiaddr [16]byte /* in6_addr */
  110. Interface uint32
  111. }
  112. type Msghdr struct {
  113. Name *byte
  114. Iov *Iovec
  115. Control *byte
  116. Flags int32
  117. Namelen int32
  118. Iovlen int32
  119. Controllen int32
  120. }
  121. type Cmsghdr struct {
  122. Len int32
  123. Level int32
  124. Type int32
  125. }
  126. type Inet4Pktinfo struct {
  127. Addr [4]byte /* in_addr */
  128. Ifindex uint32
  129. }
  130. type Inet6Pktinfo struct {
  131. Addr [16]byte /* in6_addr */
  132. Ifindex uint32
  133. }
  134. type IPv6MTUInfo struct {
  135. Addr RawSockaddrInet6
  136. Mtu uint32
  137. }
  138. type ICMPv6Filter struct {
  139. Data [8]uint32
  140. }
  141. type TCPInfo struct {
  142. State uint8
  143. Ca_state uint8
  144. Retransmits uint8
  145. Probes uint8
  146. Backoff uint8
  147. Options uint8
  148. Rto uint32
  149. Ato uint32
  150. Snd_mss uint32
  151. Rcv_mss uint32
  152. Unacked uint32
  153. Sacked uint32
  154. Lost uint32
  155. Retrans uint32
  156. Fackets uint32
  157. Last_data_sent uint32
  158. Last_ack_sent uint32
  159. Last_data_recv uint32
  160. Last_ack_recv uint32
  161. Pmtu uint32
  162. Rcv_ssthresh uint32
  163. Rtt uint32
  164. Rttvar uint32
  165. Snd_ssthresh uint32
  166. Snd_cwnd uint32
  167. Advmss uint32
  168. Reordering uint32
  169. Rcv_rtt uint32
  170. Rcv_space uint32
  171. Total_retrans uint32
  172. }
  173. type _Gid_t uint32
  174. type rusage_zos struct {
  175. Utime timeval_zos
  176. Stime timeval_zos
  177. }
  178. type Rusage struct {
  179. Utime Timeval
  180. Stime Timeval
  181. Maxrss int64
  182. Ixrss int64
  183. Idrss int64
  184. Isrss int64
  185. Minflt int64
  186. Majflt int64
  187. Nswap int64
  188. Inblock int64
  189. Oublock int64
  190. Msgsnd int64
  191. Msgrcv int64
  192. Nsignals int64
  193. Nvcsw int64
  194. Nivcsw int64
  195. }
  196. type Rlimit struct {
  197. Cur uint64
  198. Max uint64
  199. }
  200. // { int, short, short } in poll.h
  201. type PollFd struct {
  202. Fd int32
  203. Events int16
  204. Revents int16
  205. }
  206. type Stat_t struct { //Linux Definition
  207. Dev uint64
  208. Ino uint64
  209. Nlink uint64
  210. Mode uint32
  211. Uid uint32
  212. Gid uint32
  213. _ int32
  214. Rdev uint64
  215. Size int64
  216. Atim Timespec
  217. Mtim Timespec
  218. Ctim Timespec
  219. Blksize int64
  220. Blocks int64
  221. _ [3]int64
  222. }
  223. type Stat_LE_t struct {
  224. _ [4]byte // eye catcher
  225. Length uint16
  226. Version uint16
  227. Mode int32
  228. Ino uint32
  229. Dev uint32
  230. Nlink int32
  231. Uid int32
  232. Gid int32
  233. Size int64
  234. Atim31 [4]byte
  235. Mtim31 [4]byte
  236. Ctim31 [4]byte
  237. Rdev uint32
  238. Auditoraudit uint32
  239. Useraudit uint32
  240. Blksize int32
  241. Creatim31 [4]byte
  242. AuditID [16]byte
  243. _ [4]byte // rsrvd1
  244. File_tag struct {
  245. Ccsid uint16
  246. Txtflag uint16 // aggregating Txflag:1 deferred:1 rsvflags:14
  247. }
  248. CharsetID [8]byte
  249. Blocks int64
  250. Genvalue uint32
  251. Reftim31 [4]byte
  252. Fid [8]byte
  253. Filefmt byte
  254. Fspflag2 byte
  255. _ [2]byte // rsrvd2
  256. Ctimemsec int32
  257. Seclabel [8]byte
  258. _ [4]byte // rsrvd3
  259. _ [4]byte // rsrvd4
  260. Atim Time_t
  261. Mtim Time_t
  262. Ctim Time_t
  263. Creatim Time_t
  264. Reftim Time_t
  265. _ [24]byte // rsrvd5
  266. }
  267. type Statvfs_t struct {
  268. ID [4]byte
  269. Len int32
  270. Bsize uint64
  271. Blocks uint64
  272. Usedspace uint64
  273. Bavail uint64
  274. Flag uint64
  275. Maxfilesize int64
  276. _ [16]byte
  277. Frsize uint64
  278. Bfree uint64
  279. Files uint32
  280. Ffree uint32
  281. Favail uint32
  282. Namemax31 uint32
  283. Invarsec uint32
  284. _ [4]byte
  285. Fsid uint64
  286. Namemax uint64
  287. }
  288. type Statfs_t struct {
  289. Type uint32
  290. Bsize uint64
  291. Blocks uint64
  292. Bfree uint64
  293. Bavail uint64
  294. Files uint32
  295. Ffree uint32
  296. Fsid uint64
  297. Namelen uint64
  298. Frsize uint64
  299. Flags uint64
  300. }
  301. type direntLE struct {
  302. Reclen uint16
  303. Namlen uint16
  304. Ino uint32
  305. Extra uintptr
  306. Name [256]byte
  307. }
  308. type Dirent struct {
  309. Ino uint64
  310. Off int64
  311. Reclen uint16
  312. Type uint8
  313. Name [256]uint8
  314. _ [5]byte
  315. }
  316. type FdSet struct {
  317. Bits [64]int32
  318. }
  319. // This struct is packed on z/OS so it can't be used directly.
  320. type Flock_t struct {
  321. Type int16
  322. Whence int16
  323. Start int64
  324. Len int64
  325. Pid int32
  326. }
  327. type Termios struct {
  328. Cflag uint32
  329. Iflag uint32
  330. Lflag uint32
  331. Oflag uint32
  332. Cc [11]uint8
  333. }
  334. type Winsize struct {
  335. Row uint16
  336. Col uint16
  337. Xpixel uint16
  338. Ypixel uint16
  339. }
  340. type W_Mnth struct {
  341. Hid [4]byte
  342. Size int32
  343. Cur1 int32 //32bit pointer
  344. Cur2 int32 //^
  345. Devno uint32
  346. _ [4]byte
  347. }
  348. type W_Mntent struct {
  349. Fstype uint32
  350. Mode uint32
  351. Dev uint32
  352. Parentdev uint32
  353. Rootino uint32
  354. Status byte
  355. Ddname [9]byte
  356. Fstname [9]byte
  357. Fsname [45]byte
  358. Pathlen uint32
  359. Mountpoint [1024]byte
  360. Jobname [8]byte
  361. PID int32
  362. Parmoffset int32
  363. Parmlen int16
  364. Owner [8]byte
  365. Quiesceowner [8]byte
  366. _ [38]byte
  367. }