| 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 |
|
| 5 |
//go:build zos && s390x |
| 6 |
|
| 7 |
// Hand edited based on ztypes_linux_s390x.go |
| 8 |
// TODO: auto-generate. |
| 9 |
|
| 10 |
package unix |
| 11 |
|
| 12 |
const ( |
| 13 |
SizeofPtr = 0x8 |
| 14 |
SizeofShort = 0x2 |
| 15 |
SizeofInt = 0x4 |
| 16 |
SizeofLong = 0x8 |
| 17 |
SizeofLongLong = 0x8 |
| 18 |
PathMax = 0x1000 |
| 19 |
) |
| 20 |
|
| 21 |
const ( |
| 22 |
SizeofSockaddrAny = 128 |
| 23 |
SizeofCmsghdr = 12 |
| 24 |
SizeofIPMreq = 8 |
| 25 |
SizeofIPv6Mreq = 20 |
| 26 |
SizeofICMPv6Filter = 32 |
| 27 |
SizeofIPv6MTUInfo = 32 |
| 28 |
SizeofInet4Pktinfo = 8 |
| 29 |
SizeofInet6Pktinfo = 20 |
| 30 |
SizeofLinger = 8 |
| 31 |
SizeofSockaddrInet4 = 16 |
| 32 |
SizeofSockaddrInet6 = 28 |
| 33 |
SizeofTCPInfo = 0x68 |
| 34 |
SizeofUcred = 12 |
| 35 |
) |
| 36 |
|
| 37 |
type ( |
| 38 |
_C_short int16 |
| 39 |
_C_int int32 |
| 40 |
_C_long int64 |
| 41 |
_C_long_long int64 |
| 42 |
) |
| 43 |
|
| 44 |
type Timespec struct { |
| 45 |
Sec int64 |
| 46 |
Nsec int64 |
| 47 |
} |
| 48 |
|
| 49 |
type Timeval struct { |
| 50 |
Sec int64 |
| 51 |
Usec int64 |
| 52 |
} |
| 53 |
|
| 54 |
type timeval_zos struct { //correct (with padding and all) |
| 55 |
Sec int64 |
| 56 |
_ [4]byte // pad |
| 57 |
Usec int32 |
| 58 |
} |
| 59 |
|
| 60 |
type Tms struct { //clock_t is 4-byte unsigned int in zos |
| 61 |
Utime uint32 |
| 62 |
Stime uint32 |
| 63 |
Cutime uint32 |
| 64 |
Cstime uint32 |
| 65 |
} |
| 66 |
|
| 67 |
type Time_t int64 |
| 68 |
|
| 69 |
type Utimbuf struct { |
| 70 |
Actime int64 |
| 71 |
Modtime int64 |
| 72 |
} |
| 73 |
|
| 74 |
type Utsname struct { |
| 75 |
Sysname [16]byte |
| 76 |
Nodename [32]byte |
| 77 |
Release [8]byte |
| 78 |
Version [8]byte |
| 79 |
Machine [16]byte |
| 80 |
} |
| 81 |
|
| 82 |
type Ucred struct { |
| 83 |
Pid int32 |
| 84 |
Uid uint32 |
| 85 |
Gid uint32 |
| 86 |
} |
| 87 |
|
| 88 |
type RawSockaddrInet4 struct { |
| 89 |
Len uint8 |
| 90 |
Family uint8 |
| 91 |
Port uint16 |
| 92 |
Addr [4]byte /* in_addr */ |
| 93 |
Zero [8]uint8 |
| 94 |
} |
| 95 |
|
| 96 |
type RawSockaddrInet6 struct { |
| 97 |
Len uint8 |
| 98 |
Family uint8 |
| 99 |
Port uint16 |
| 100 |
Flowinfo uint32 |
| 101 |
Addr [16]byte /* in6_addr */ |
| 102 |
Scope_id uint32 |
| 103 |
} |
| 104 |
|
| 105 |
type RawSockaddrUnix struct { |
| 106 |
Len uint8 |
| 107 |
Family uint8 |
| 108 |
Path [108]int8 |
| 109 |
} |
| 110 |
|
| 111 |
type RawSockaddr struct { |
| 112 |
Len uint8 |
| 113 |
Family uint8 |
| 114 |
Data [14]uint8 |
| 115 |
} |
| 116 |
|
| 117 |
type RawSockaddrAny struct { |
| 118 |
Addr RawSockaddr |
| 119 |
_ [112]uint8 // pad |
| 120 |
} |
| 121 |
|
| 122 |
type _Socklen uint32 |
| 123 |
|
| 124 |
type Linger struct { |
| 125 |
Onoff int32 |
| 126 |
Linger int32 |
| 127 |
} |
| 128 |
|
| 129 |
type Iovec struct { |
| 130 |
Base *byte |
| 131 |
Len uint64 |
| 132 |
} |
| 133 |
|
| 134 |
type IPMreq struct { |
| 135 |
Multiaddr [4]byte /* in_addr */ |
| 136 |
Interface [4]byte /* in_addr */ |
| 137 |
} |
| 138 |
|
| 139 |
type IPv6Mreq struct { |
| 140 |
Multiaddr [16]byte /* in6_addr */ |
| 141 |
Interface uint32 |
| 142 |
} |
| 143 |
|
| 144 |
type Msghdr struct { |
| 145 |
Name *byte |
| 146 |
Iov *Iovec |
| 147 |
Control *byte |
| 148 |
Flags int32 |
| 149 |
Namelen int32 |
| 150 |
Iovlen int32 |
| 151 |
Controllen int32 |
| 152 |
} |
| 153 |
|
| 154 |
type Cmsghdr struct { |
| 155 |
Len int32 |
| 156 |
Level int32 |
| 157 |
Type int32 |
| 158 |
} |
| 159 |
|
| 160 |
type Inet4Pktinfo struct { |
| 161 |
Addr [4]byte /* in_addr */ |
| 162 |
Ifindex uint32 |
| 163 |
} |
| 164 |
|
| 165 |
type Inet6Pktinfo struct { |
| 166 |
Addr [16]byte /* in6_addr */ |
| 167 |
Ifindex uint32 |
| 168 |
} |
| 169 |
|
| 170 |
type IPv6MTUInfo struct { |
| 171 |
Addr RawSockaddrInet6 |
| 172 |
Mtu uint32 |
| 173 |
} |
| 174 |
|
| 175 |
type ICMPv6Filter struct { |
| 176 |
Data [8]uint32 |
| 177 |
} |
| 178 |
|
| 179 |
type TCPInfo struct { |
| 180 |
State uint8 |
| 181 |
Ca_state uint8 |
| 182 |
Retransmits uint8 |
| 183 |
Probes uint8 |
| 184 |
Backoff uint8 |
| 185 |
Options uint8 |
| 186 |
Rto uint32 |
| 187 |
Ato uint32 |
| 188 |
Snd_mss uint32 |
| 189 |
Rcv_mss uint32 |
| 190 |
Unacked uint32 |
| 191 |
Sacked uint32 |
| 192 |
Lost uint32 |
| 193 |
Retrans uint32 |
| 194 |
Fackets uint32 |
| 195 |
Last_data_sent uint32 |
| 196 |
Last_ack_sent uint32 |
| 197 |
Last_data_recv uint32 |
| 198 |
Last_ack_recv uint32 |
| 199 |
Pmtu uint32 |
| 200 |
Rcv_ssthresh uint32 |
| 201 |
Rtt uint32 |
| 202 |
Rttvar uint32 |
| 203 |
Snd_ssthresh uint32 |
| 204 |
Snd_cwnd uint32 |
| 205 |
Advmss uint32 |
| 206 |
Reordering uint32 |
| 207 |
Rcv_rtt uint32 |
| 208 |
Rcv_space uint32 |
| 209 |
Total_retrans uint32 |
| 210 |
} |
| 211 |
|
| 212 |
type _Gid_t uint32 |
| 213 |
|
| 214 |
type rusage_zos struct { |
| 215 |
Utime timeval_zos |
| 216 |
Stime timeval_zos |
| 217 |
} |
| 218 |
|
| 219 |
type Rusage struct { |
| 220 |
Utime Timeval |
| 221 |
Stime Timeval |
| 222 |
Maxrss int64 |
| 223 |
Ixrss int64 |
| 224 |
Idrss int64 |
| 225 |
Isrss int64 |
| 226 |
Minflt int64 |
| 227 |
Majflt int64 |
| 228 |
Nswap int64 |
| 229 |
Inblock int64 |
| 230 |
Oublock int64 |
| 231 |
Msgsnd int64 |
| 232 |
Msgrcv int64 |
| 233 |
Nsignals int64 |
| 234 |
Nvcsw int64 |
| 235 |
Nivcsw int64 |
| 236 |
} |
| 237 |
|
| 238 |
type Rlimit struct { |
| 239 |
Cur uint64 |
| 240 |
Max uint64 |
| 241 |
} |
| 242 |
|
| 243 |
// { int, short, short } in poll.h |
| 244 |
type PollFd struct { |
| 245 |
Fd int32 |
| 246 |
Events int16 |
| 247 |
Revents int16 |
| 248 |
} |
| 249 |
|
| 250 |
type Stat_t struct { //Linux Definition |
| 251 |
Dev uint64 |
| 252 |
Ino uint64 |
| 253 |
Nlink uint64 |
| 254 |
Mode uint32 |
| 255 |
Uid uint32 |
| 256 |
Gid uint32 |
| 257 |
_ int32 |
| 258 |
Rdev uint64 |
| 259 |
Size int64 |
| 260 |
Atim Timespec |
| 261 |
Mtim Timespec |
| 262 |
Ctim Timespec |
| 263 |
Blksize int64 |
| 264 |
Blocks int64 |
| 265 |
_ [3]int64 |
| 266 |
} |
| 267 |
|
| 268 |
type Stat_LE_t struct { |
| 269 |
_ [4]byte // eye catcher |
| 270 |
Length uint16 |
| 271 |
Version uint16 |
| 272 |
Mode int32 |
| 273 |
Ino uint32 |
| 274 |
Dev uint32 |
| 275 |
Nlink int32 |
| 276 |
Uid int32 |
| 277 |
Gid int32 |
| 278 |
Size int64 |
| 279 |
Atim31 [4]byte |
| 280 |
Mtim31 [4]byte |
| 281 |
Ctim31 [4]byte |
| 282 |
Rdev uint32 |
| 283 |
Auditoraudit uint32 |
| 284 |
Useraudit uint32 |
| 285 |
Blksize int32 |
| 286 |
Creatim31 [4]byte |
| 287 |
AuditID [16]byte |
| 288 |
_ [4]byte // rsrvd1 |
| 289 |
File_tag struct { |
| 290 |
Ccsid uint16 |
| 291 |
Txtflag uint16 // aggregating Txflag:1 deferred:1 rsvflags:14 |
| 292 |
} |
| 293 |
CharsetID [8]byte |
| 294 |
Blocks int64 |
| 295 |
Genvalue uint32 |
| 296 |
Reftim31 [4]byte |
| 297 |
Fid [8]byte |
| 298 |
Filefmt byte |
| 299 |
Fspflag2 byte |
| 300 |
_ [2]byte // rsrvd2 |
| 301 |
Ctimemsec int32 |
| 302 |
Seclabel [8]byte |
| 303 |
_ [4]byte // rsrvd3 |
| 304 |
_ [4]byte // rsrvd4 |
| 305 |
Atim Time_t |
| 306 |
Mtim Time_t |
| 307 |
Ctim Time_t |
| 308 |
Creatim Time_t |
| 309 |
Reftim Time_t |
| 310 |
_ [24]byte // rsrvd5 |
| 311 |
} |
| 312 |
|
| 313 |
type Statvfs_t struct { |
| 314 |
ID [4]byte |
| 315 |
Len int32 |
| 316 |
Bsize uint64 |
| 317 |
Blocks uint64 |
| 318 |
Usedspace uint64 |
| 319 |
Bavail uint64 |
| 320 |
Flag uint64 |
| 321 |
Maxfilesize int64 |
| 322 |
_ [16]byte |
| 323 |
Frsize uint64 |
| 324 |
Bfree uint64 |
| 325 |
Files uint32 |
| 326 |
Ffree uint32 |
| 327 |
Favail uint32 |
| 328 |
Namemax31 uint32 |
| 329 |
Invarsec uint32 |
| 330 |
_ [4]byte |
| 331 |
Fsid uint64 |
| 332 |
Namemax uint64 |
| 333 |
} |
| 334 |
|
| 335 |
type Statfs_t struct { |
| 336 |
Type uint64 |
| 337 |
Bsize uint64 |
| 338 |
Blocks uint64 |
| 339 |
Bfree uint64 |
| 340 |
Bavail uint64 |
| 341 |
Files uint32 |
| 342 |
Ffree uint32 |
| 343 |
Fsid uint64 |
| 344 |
Namelen uint64 |
| 345 |
Frsize uint64 |
| 346 |
Flags uint64 |
| 347 |
_ [4]uint64 |
| 348 |
} |
| 349 |
|
| 350 |
type direntLE struct { |
| 351 |
Reclen uint16 |
| 352 |
Namlen uint16 |
| 353 |
Ino uint32 |
| 354 |
Extra uintptr |
| 355 |
Name [256]byte |
| 356 |
} |
| 357 |
|
| 358 |
type Dirent struct { |
| 359 |
Ino uint64 |
| 360 |
Off int64 |
| 361 |
Reclen uint16 |
| 362 |
Type uint8 |
| 363 |
Name [256]uint8 |
| 364 |
_ [5]byte |
| 365 |
} |
| 366 |
|
| 367 |
type FdSet struct { |
| 368 |
Bits [64]int32 |
| 369 |
} |
| 370 |
|
| 371 |
// This struct is packed on z/OS so it can't be used directly. |
| 372 |
type Flock_t struct { |
| 373 |
Type int16 |
| 374 |
Whence int16 |
| 375 |
Start int64 |
| 376 |
Len int64 |
| 377 |
Pid int32 |
| 378 |
} |
| 379 |
|
| 380 |
type F_cnvrt struct { |
| 381 |
Cvtcmd int32 |
| 382 |
Pccsid int16 |
| 383 |
Fccsid int16 |
| 384 |
} |
| 385 |
|
| 386 |
type Termios struct { |
| 387 |
Cflag uint32 |
| 388 |
Iflag uint32 |
| 389 |
Lflag uint32 |
| 390 |
Oflag uint32 |
| 391 |
Cc [11]uint8 |
| 392 |
} |
| 393 |
|
| 394 |
type Winsize struct { |
| 395 |
Row uint16 |
| 396 |
Col uint16 |
| 397 |
Xpixel uint16 |
| 398 |
Ypixel uint16 |
| 399 |
} |
| 400 |
|
| 401 |
type W_Mnth struct { |
| 402 |
Hid [4]byte |
| 403 |
Size int32 |
| 404 |
Cur1 int32 //32bit pointer |
| 405 |
Cur2 int32 //^ |
| 406 |
Devno uint32 |
| 407 |
_ [4]byte |
| 408 |
} |
| 409 |
|
| 410 |
type W_Mntent struct { |
| 411 |
Fstype uint32 |
| 412 |
Mode uint32 |
| 413 |
Dev uint32 |
| 414 |
Parentdev uint32 |
| 415 |
Rootino uint32 |
| 416 |
Status byte |
| 417 |
Ddname [9]byte |
| 418 |
Fstname [9]byte |
| 419 |
Fsname [45]byte |
| 420 |
Pathlen uint32 |
| 421 |
Mountpoint [1024]byte |
| 422 |
Jobname [8]byte |
| 423 |
PID int32 |
| 424 |
Parmoffset int32 |
| 425 |
Parmlen int16 |
| 426 |
Owner [8]byte |
| 427 |
Quiesceowner [8]byte |
| 428 |
_ [38]byte |
| 429 |
} |
| 430 |
|
| 431 |
type EpollEvent struct { |
| 432 |
Events uint32 |
| 433 |
_ int32 |
| 434 |
Fd int32 |
| 435 |
Pad int32 |
| 436 |
} |
| 437 |
|
| 438 |
type InotifyEvent struct { |
| 439 |
Wd int32 |
| 440 |
Mask uint32 |
| 441 |
Cookie uint32 |
| 442 |
Len uint32 |
| 443 |
Name string |
| 444 |
} |
| 445 |
|
| 446 |
const ( |
| 447 |
SizeofInotifyEvent = 0x10 |
| 448 |
) |
| 449 |
|
| 450 |
type ConsMsg2 struct { |
| 451 |
Cm2Format uint16 |
| 452 |
Cm2R1 uint16 |
| 453 |
Cm2Msglength uint32 |
| 454 |
Cm2Msg *byte |
| 455 |
Cm2R2 [4]byte |
| 456 |
Cm2R3 [4]byte |
| 457 |
Cm2Routcde *uint32 |
| 458 |
Cm2Descr *uint32 |
| 459 |
Cm2Msgflag uint32 |
| 460 |
Cm2Token uint32 |
| 461 |
Cm2Msgid *uint32 |
| 462 |
Cm2R4 [4]byte |
| 463 |
Cm2DomToken uint32 |
| 464 |
Cm2DomMsgid *uint32 |
| 465 |
Cm2ModCartptr *byte |
| 466 |
Cm2ModConsidptr *byte |
| 467 |
Cm2MsgCart [8]byte |
| 468 |
Cm2MsgConsid [4]byte |
| 469 |
Cm2R5 [12]byte |
| 470 |
} |
| 471 |
|
| 472 |
const ( |
| 473 |
CC_modify = 1 |
| 474 |
CC_stop = 2 |
| 475 |
CONSOLE_FORMAT_2 = 2 |
| 476 |
CONSOLE_FORMAT_3 = 3 |
| 477 |
CONSOLE_HRDCPY = 0x80000000 |
| 478 |
) |
| 479 |
|
| 480 |
type OpenHow struct { |
| 481 |
Flags uint64 |
| 482 |
Mode uint64 |
| 483 |
Resolve uint64 |
| 484 |
} |
| 485 |
|
| 486 |
const SizeofOpenHow = 0x18 |
| 487 |
|
| 488 |
const ( |
| 489 |
RESOLVE_CACHED = 0x20 |
| 490 |
RESOLVE_BENEATH = 0x8 |
| 491 |
RESOLVE_IN_ROOT = 0x10 |
| 492 |
RESOLVE_NO_MAGICLINKS = 0x2 |
| 493 |
RESOLVE_NO_SYMLINKS = 0x4 |
| 494 |
RESOLVE_NO_XDEV = 0x1 |
| 495 |
) |
| 496 |
|
| 497 |
type Siginfo struct { |
| 498 |
Signo int32 |
| 499 |
Errno int32 |
| 500 |
Code int32 |
| 501 |
Pid int32 |
| 502 |
Uid uint32 |
| 503 |
_ [44]byte |
| 504 |
} |
| 505 |
|
| 506 |
type SysvIpcPerm struct { |
| 507 |
Uid uint32 |
| 508 |
Gid uint32 |
| 509 |
Cuid uint32 |
| 510 |
Cgid uint32 |
| 511 |
Mode int32 |
| 512 |
} |
| 513 |
|
| 514 |
type SysvShmDesc struct { |
| 515 |
Perm SysvIpcPerm |
| 516 |
_ [4]byte |
| 517 |
Lpid int32 |
| 518 |
Cpid int32 |
| 519 |
Nattch uint32 |
| 520 |
_ [4]byte |
| 521 |
_ [4]byte |
| 522 |
_ [4]byte |
| 523 |
_ int32 |
| 524 |
_ uint8 |
| 525 |
_ uint8 |
| 526 |
_ uint16 |
| 527 |
_ *byte |
| 528 |
Segsz uint64 |
| 529 |
Atime Time_t |
| 530 |
Dtime Time_t |
| 531 |
Ctime Time_t |
| 532 |
} |
| 533 |
|
| 534 |
type SysvShmDesc64 struct { |
| 535 |
Perm SysvIpcPerm |
| 536 |
_ [4]byte |
| 537 |
Lpid int32 |
| 538 |
Cpid int32 |
| 539 |
Nattch uint32 |
| 540 |
_ [4]byte |
| 541 |
_ [4]byte |
| 542 |
_ [4]byte |
| 543 |
_ int32 |
| 544 |
_ byte |
| 545 |
_ uint8 |
| 546 |
_ uint16 |
| 547 |
_ *byte |
| 548 |
Segsz uint64 |
| 549 |
Atime int64 |
| 550 |
Dtime int64 |
| 551 |
Ctime int64 |
| 552 |
} |