Non puoi selezionare più di 25 argomenti Gli argomenti devono iniziare con una lettera o un numero, possono includere trattini ('-') e possono essere lunghi fino a 35 caratteri.

416 righe
6.7 KiB

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