| ... | ... | @@ -18,6 +18,7 @@ const is_mips = native_arch.isMIPS(); |
| 18 | 18 | const is_ppc = native_arch.isPowerPC(); |
| 19 | 19 | const is_riscv = native_arch.isRISCV(); |
| 20 | 20 | const is_sparc = native_arch.isSPARC(); |
| 21 | const is_hppa = native_arch.isHppa(); |
| 21 | 22 | const iovec = std.posix.iovec; |
| 22 | 23 | const iovec_const = std.posix.iovec_const; |
| 23 | 24 | const winsize = std.posix.winsize; |
| ... | ... | @@ -1943,23 +1944,68 @@ pub const F = struct { |
| 1943 | 1944 | pub const SETLK = GET_SET_LK.SETLK; |
| 1944 | 1945 | pub const SETLKW = GET_SET_LK.SETLKW; |
| 1945 | 1946 | |
| 1946 | | const GET_SET_LK = if (@sizeOf(usize) == 64) extern struct { |
| 1947 | | pub const GETLK = if (is_mips) 14 else if (is_sparc) 7 else 5; |
| 1948 | | pub const SETLK = if (is_mips) 6 else if (is_sparc) 8 else 6; |
| 1949 | | pub const SETLKW = if (is_mips) 7 else if (is_sparc) 9 else 7; |
| 1950 | | } else extern struct { |
| 1951 | | // Ensure that 32-bit code uses the large-file variants (GETLK64, etc). |
| 1947 | pub const SETOWN = GET_SET_OWN.SETOWN; |
| 1948 | pub const GETOWN = GET_SET_OWN.GETOWN; |
| 1952 | 1949 | |
| 1953 | | pub const GETLK = if (is_mips) 33 else 12; |
| 1954 | | pub const SETLK = if (is_mips) 34 else 13; |
| 1955 | | pub const SETLKW = if (is_mips) 35 else 14; |
| 1950 | const GET_SET_LK = switch (native_arch) { |
| 1951 | .mips, .mipsel => struct { |
| 1952 | const GETLK = 33; |
| 1953 | const SETLK = 34; |
| 1954 | const SETLKW = 35; |
| 1955 | }, |
| 1956 | .mips64, .mips64el => switch (native_abi) { |
| 1957 | .gnuabin32, .muslabin32 => struct { |
| 1958 | const GETLK = 33; |
| 1959 | const SETLK = 34; |
| 1960 | const SETLKW = 35; |
| 1961 | }, |
| 1962 | else => struct { |
| 1963 | const GETLK = 14; |
| 1964 | const SETLK = 6; |
| 1965 | const SETLKW = 7; |
| 1966 | }, |
| 1967 | }, |
| 1968 | .alpha, .sparc64 => struct { |
| 1969 | const GETLK = 7; |
| 1970 | const SETLK = 8; |
| 1971 | const SETLKW = 9; |
| 1972 | }, |
| 1973 | .hppa, .hppa64 => struct { |
| 1974 | const GETLK = 8; |
| 1975 | const SETLK = 9; |
| 1976 | const SETLKW = 10; |
| 1977 | }, |
| 1978 | else => if (@sizeOf(usize) == 8) struct { |
| 1979 | const GETLK = 5; |
| 1980 | const SETLK = 6; |
| 1981 | const SETLKW = 7; |
| 1982 | } else struct { |
| 1983 | const GETLK = 12; |
| 1984 | const SETLK = 13; |
| 1985 | const SETLKW = 14; |
| 1986 | }, |
| 1987 | }; |
| 1988 | const GET_SET_OWN = switch (native_arch) { |
| 1989 | .mips, .mipsel, .mips64, .mips64el => struct { |
| 1990 | const GETOWN = 23; |
| 1991 | const SETOWN = 24; |
| 1992 | }, |
| 1993 | .alpha, .sparc, .sparc64 => struct { |
| 1994 | const GETOWN = 5; |
| 1995 | const SETOWN = 6; |
| 1996 | }, |
| 1997 | .hppa, .hppa64 => struct { |
| 1998 | const GETOWN = 11; |
| 1999 | const SETOWN = 12; |
| 2000 | }, |
| 2001 | else => struct { |
| 2002 | const GETOWN = 8; |
| 2003 | const SETOWN = 9; |
| 2004 | }, |
| 1956 | 2005 | }; |
| 1957 | 2006 | |
| 1958 | | pub const SETOWN = if (is_mips) 24 else if (is_sparc) 6 else 8; |
| 1959 | | pub const GETOWN = if (is_mips) 23 else if (is_sparc) 5 else 9; |
| 1960 | | |
| 1961 | | pub const SETSIG = 10; |
| 1962 | | pub const GETSIG = 11; |
| 2007 | pub const SETSIG = if (is_hppa or native_arch == .alpha) 13 else 11; |
| 2008 | pub const GETSIG = if (is_hppa or native_arch == .alpha) 14 else 12; |
| 1963 | 2009 | |
| 1964 | 2010 | pub const SETOWN_EX = 15; |
| 1965 | 2011 | pub const GETOWN_EX = 16; |
| ... | ... | @@ -1972,7 +2018,7 @@ pub const F = struct { |
| 1972 | 2018 | |
| 1973 | 2019 | pub const RDLCK = if (is_sparc) 1 else 0; |
| 1974 | 2020 | pub const WRLCK = if (is_sparc) 2 else 1; |
| 1975 | | pub const UNLCK = if (is_sparc) 3 else 2; |
| 2021 | pub const UNLCK = if (is_sparc) 3 else if (native_arch == .alpha) 8 else 2; |
| 1976 | 2022 | |
| 1977 | 2023 | pub const LINUX_SPECIFIC_BASE = 1024; |
| 1978 | 2024 | |
| ... | ... | @@ -3437,6 +3483,294 @@ pub const E = switch (native_arch) { |
| 3437 | 3483 | HWPOISON = 135, |
| 3438 | 3484 | _, |
| 3439 | 3485 | }, |
| 3486 | .alpha => enum(u16) { |
| 3487 | /// No error occurred. |
| 3488 | SUCCESS = 0, |
| 3489 | |
| 3490 | /// Operation not permitted |
| 3491 | PERM = 1, |
| 3492 | /// No such file or directory |
| 3493 | NOENT = 2, |
| 3494 | /// No such process |
| 3495 | SRCH = 3, |
| 3496 | /// Interrupted system call |
| 3497 | INTR = 4, |
| 3498 | /// I/O error |
| 3499 | IO = 5, |
| 3500 | /// No such device or address |
| 3501 | NXIO = 6, |
| 3502 | /// Argument list too long |
| 3503 | @"2BIG" = 7, |
| 3504 | /// Exec format error |
| 3505 | NOEXEC = 8, |
| 3506 | /// Bad file number |
| 3507 | BADF = 9, |
| 3508 | /// No child processes |
| 3509 | CHILD = 10, |
| 3510 | /// Out of memory |
| 3511 | NOMEM = 12, |
| 3512 | /// Permission denied |
| 3513 | ACCES = 13, |
| 3514 | /// Bad address |
| 3515 | FAULT = 14, |
| 3516 | /// Block device required |
| 3517 | NOTBLK = 15, |
| 3518 | /// Device or resource busy |
| 3519 | BUSY = 16, |
| 3520 | /// File exists |
| 3521 | EXIST = 17, |
| 3522 | /// Cross-device link |
| 3523 | XDEV = 18, |
| 3524 | /// No such device |
| 3525 | NODEV = 19, |
| 3526 | /// Not a directory |
| 3527 | NOTDIR = 20, |
| 3528 | /// Is a directory |
| 3529 | ISDIR = 21, |
| 3530 | /// Invalid argument |
| 3531 | INVAL = 22, |
| 3532 | /// File table overflow |
| 3533 | NFILE = 23, |
| 3534 | /// Too many open files |
| 3535 | MFILE = 24, |
| 3536 | /// Not a typewriter |
| 3537 | NOTTY = 25, |
| 3538 | /// Text file busy |
| 3539 | TXTBSY = 26, |
| 3540 | /// File too large |
| 3541 | FBIG = 27, |
| 3542 | /// No space left on device |
| 3543 | NOSPC = 28, |
| 3544 | /// Illegal seek |
| 3545 | SPIPE = 29, |
| 3546 | /// Read-only file system |
| 3547 | ROFS = 30, |
| 3548 | /// Too many links |
| 3549 | MLINK = 31, |
| 3550 | /// Broken pipe |
| 3551 | PIPE = 32, |
| 3552 | /// Math argument out of domain of func |
| 3553 | DOM = 33, |
| 3554 | /// Math result not representable |
| 3555 | RANGE = 34, |
| 3556 | |
| 3557 | /// Resource deadlock would occur |
| 3558 | DEADLK = 11, |
| 3559 | |
| 3560 | /// Try again. |
| 3561 | /// Also used for WOULDBLOCK. |
| 3562 | AGAIN = 35, |
| 3563 | /// Operation now in progress |
| 3564 | INPROGRESS = 36, |
| 3565 | /// Operation already in progress |
| 3566 | ALREADY = 37, |
| 3567 | /// Socket operation on non-socket |
| 3568 | NOTSOCK = 38, |
| 3569 | /// Destination address required |
| 3570 | DESTADDRREQ = 39, |
| 3571 | /// Message too long |
| 3572 | MSGSIZE = 40, |
| 3573 | /// Protocol wrong type for socket |
| 3574 | PROTOTYPE = 41, |
| 3575 | /// Protocol not available |
| 3576 | NOPROTOOPT = 42, |
| 3577 | /// Protocol not supported |
| 3578 | PROTONOSUPPORT = 43, |
| 3579 | /// Socket type not supported |
| 3580 | SOCKTNOSUPPORT = 44, |
| 3581 | /// Operation not supported on transport endpoint |
| 3582 | OPNOTSUPP = 45, |
| 3583 | /// Protocol family not supported |
| 3584 | PFNOSUPPORT = 46, |
| 3585 | /// Address family not supported by protocol |
| 3586 | AFNOSUPPORT = 47, |
| 3587 | /// Address already in use |
| 3588 | ADDRINUSE = 48, |
| 3589 | /// Cannot assign requested address |
| 3590 | ADDRNOTAVAIL = 49, |
| 3591 | /// Network is down |
| 3592 | NETDOWN = 50, |
| 3593 | /// Network is unreachable |
| 3594 | NETUNREACH = 51, |
| 3595 | /// Network dropped connection because of reset |
| 3596 | NETRESET = 52, |
| 3597 | /// Software caused connection abort |
| 3598 | CONNABORTED = 53, |
| 3599 | /// Connection reset by peer |
| 3600 | CONNRESET = 54, |
| 3601 | /// No buffer space available |
| 3602 | NOBUFS = 55, |
| 3603 | /// Transport endpoint is already connected |
| 3604 | ISCONN = 56, |
| 3605 | /// Transport endpoint is not connected |
| 3606 | NOTCONN = 57, |
| 3607 | /// Cannot send after transport endpoint shutdown |
| 3608 | SHUTDOWN = 58, |
| 3609 | /// Too many references: cannot splice |
| 3610 | TOOMANYREFS = 59, |
| 3611 | /// Connection timed out |
| 3612 | TIMEDOUT = 60, |
| 3613 | /// Connection refused |
| 3614 | CONNREFUSED = 61, |
| 3615 | /// Too many symbolic links encountered |
| 3616 | LOOP = 62, |
| 3617 | /// File name too long |
| 3618 | NAMETOOLONG = 63, |
| 3619 | /// Host is down |
| 3620 | HOSTDOWN = 64, |
| 3621 | /// No route to host |
| 3622 | HOSTUNREACH = 65, |
| 3623 | /// Directory not empty |
| 3624 | NOTEMPTY = 66, |
| 3625 | |
| 3626 | /// Too many users |
| 3627 | USERS = 68, |
| 3628 | /// Quota exceeded |
| 3629 | DQUOT = 69, |
| 3630 | /// Stale file handle |
| 3631 | STALE = 70, |
| 3632 | /// Object is remote |
| 3633 | REMOTE = 71, |
| 3634 | |
| 3635 | /// No record locks available |
| 3636 | NOLCK = 77, |
| 3637 | /// Function not implemented |
| 3638 | NOSYS = 78, |
| 3639 | |
| 3640 | /// No message of desired type |
| 3641 | NOMSG = 80, |
| 3642 | /// Identifier removed |
| 3643 | IDRM = 81, |
| 3644 | /// Out of streams resources |
| 3645 | NOSR = 82, |
| 3646 | /// Timer expired |
| 3647 | TIME = 83, |
| 3648 | /// Not a data message |
| 3649 | /// Also used for FSBADCRC. |
| 3650 | BADMSG = 84, |
| 3651 | /// Protocol error |
| 3652 | PROTO = 85, |
| 3653 | /// No data available |
| 3654 | NODATA = 86, |
| 3655 | /// Device not a stream |
| 3656 | NOSTR = 87, |
| 3657 | |
| 3658 | /// Package not installed |
| 3659 | NOPKG = 92, |
| 3660 | |
| 3661 | /// Illegal byte sequence |
| 3662 | ILSEQ = 116, |
| 3663 | |
| 3664 | // The following are designated "random noise" by the kernel sources. |
| 3665 | /// Channel number out of range |
| 3666 | CHRNG = 88, |
| 3667 | /// Level 2 not synchronized |
| 3668 | L2NSYNC = 89, |
| 3669 | /// Level 3 halted |
| 3670 | L3HLT = 90, |
| 3671 | /// Level 3 reset |
| 3672 | L3RST = 91, |
| 3673 | |
| 3674 | /// Link number out of range |
| 3675 | LNRNG = 93, |
| 3676 | /// Protocol driver not attached |
| 3677 | UNATCH = 94, |
| 3678 | /// No CSI structure available |
| 3679 | NOCSI = 95, |
| 3680 | /// Level 2 halted |
| 3681 | L2HLT = 96, |
| 3682 | /// Invalid exchange |
| 3683 | BADE = 97, |
| 3684 | /// Invalid request descriptor |
| 3685 | BADR = 98, |
| 3686 | /// Exchange full |
| 3687 | XFULL = 99, |
| 3688 | /// No anode |
| 3689 | NOANO = 100, |
| 3690 | /// Invalid request code |
| 3691 | BADRQC = 101, |
| 3692 | /// Invalid slot |
| 3693 | BADSLT = 102, |
| 3694 | |
| 3695 | /// Bad font file format |
| 3696 | BFONT = 104, |
| 3697 | /// Machine is not on the network |
| 3698 | NONET = 105, |
| 3699 | /// Link has been severed |
| 3700 | NOLINK = 106, |
| 3701 | /// Advertise error |
| 3702 | ADV = 107, |
| 3703 | /// Srmount error |
| 3704 | SRMNT = 108, |
| 3705 | /// Communication error on send |
| 3706 | COMM = 109, |
| 3707 | /// Multihop attempted |
| 3708 | MULTIHOP = 110, |
| 3709 | /// RFS specific error |
| 3710 | DOTDOT = 111, |
| 3711 | /// Value too large for defined data type |
| 3712 | OVERFLOW = 112, |
| 3713 | /// Name not unique on network |
| 3714 | NOTUNIQ = 113, |
| 3715 | /// File descriptor in bad state |
| 3716 | BADFD = 114, |
| 3717 | /// Remote address changed |
| 3718 | REMCHG = 115, |
| 3719 | |
| 3720 | /// Structure needs cleaning |
| 3721 | /// Also used for FSCORRUPTED. |
| 3722 | UCLEAN = 117, |
| 3723 | /// Not a XENIX named type file |
| 3724 | NOTNAM = 118, |
| 3725 | /// No XENIX semaphores available |
| 3726 | NAVAIL = 119, |
| 3727 | /// Is a named type file |
| 3728 | ISNAM = 120, |
| 3729 | /// Remote I/O error |
| 3730 | REMOTEIO = 121, |
| 3731 | |
| 3732 | /// Can not access a needed shared library |
| 3733 | LIBACC = 122, |
| 3734 | /// Accessing a corrupted shared library |
| 3735 | LIBBAD = 123, |
| 3736 | /// .lib section in a.out corrupted |
| 3737 | LIBSCN = 124, |
| 3738 | /// Attempting to link in too many shared libraries |
| 3739 | LIBMAX = 125, |
| 3740 | /// Cannot exec a shared library directly |
| 3741 | LIBEXEC = 126, |
| 3742 | /// Interrupted system call should be restarted |
| 3743 | RESTART = 127, |
| 3744 | /// Streams pipe error |
| 3745 | STRPIPE = 128, |
| 3746 | |
| 3747 | /// No medium found |
| 3748 | NOMEDIUM = 129, |
| 3749 | /// Wrong medium type |
| 3750 | MEDIUMTYPE = 130, |
| 3751 | /// Operation Cancelled |
| 3752 | CANCELED = 131, |
| 3753 | /// Required key not available |
| 3754 | NOKEY = 132, |
| 3755 | /// Key has expired |
| 3756 | KEYEXPIRED = 133, |
| 3757 | /// Key has been revoked |
| 3758 | KEYREVOKED = 134, |
| 3759 | /// Key was rejected by service |
| 3760 | KEYREJECTED = 135, |
| 3761 | |
| 3762 | // For robust mutexes |
| 3763 | /// Owner died |
| 3764 | OWNERDEAD = 136, |
| 3765 | /// State not recoverable |
| 3766 | NOTRECOVERABLE = 137, |
| 3767 | |
| 3768 | /// Operation not possible due to RF-kill |
| 3769 | RFKILL = 138, |
| 3770 | /// Memory page has hardware error |
| 3771 | HWPOISON = 139, |
| 3772 | _, |
| 3773 | }, |
| 3440 | 3774 | else => enum(u16) { |
| 3441 | 3775 | /// No error occurred. |
| 3442 | 3776 | /// Same code used for `NSROK`. |
| ... | ... | @@ -4008,6 +4342,14 @@ pub const SA = if (is_mips) struct { |
| 4008 | 4342 | pub const RESETHAND = 0x80000000; |
| 4009 | 4343 | pub const ONSTACK = 0x08000000; |
| 4010 | 4344 | pub const NODEFER = 0x40000000; |
| 4345 | } else if (native_arch == .alpha) struct { |
| 4346 | pub const ONSTACK = 0x00000001; |
| 4347 | pub const RESTART = 0x00000002; |
| 4348 | pub const NOCLDSTOP = 0x00000004; |
| 4349 | pub const NODEFER = 0x00000008; |
| 4350 | pub const RESETHAND = 0x00000010; |
| 4351 | pub const NOCLDWAIT = 0x00000020; |
| 4352 | pub const SIGINFO = 0x00000040; |
| 4011 | 4353 | } else struct { |
| 4012 | 4354 | pub const NOCLDSTOP = 1; |
| 4013 | 4355 | pub const NOCLDWAIT = 2; |
| ... | ... | @@ -4155,6 +4497,50 @@ pub const SIG = if (is_mips) enum(u32) { |
| 4155 | 4497 | USR1 = 30, |
| 4156 | 4498 | USR2 = 31, |
| 4157 | 4499 | _, |
| 4500 | } else if (is_hppa) enum(u32) { |
| 4501 | pub const BLOCK = 0; |
| 4502 | pub const UNBLOCK = 1; |
| 4503 | pub const SETMASK = 2; |
| 4504 | |
| 4505 | pub const ERR: ?Sigaction.handler_fn = @ptrFromInt(maxInt(usize)); |
| 4506 | pub const DFL: ?Sigaction.handler_fn = @ptrFromInt(0); |
| 4507 | pub const IGN: ?Sigaction.handler_fn = @ptrFromInt(1); |
| 4508 | |
| 4509 | pub const POLL: SIG = .IO; |
| 4510 | pub const IOT: SIG = .ABRT; |
| 4511 | |
| 4512 | HUP = 1, |
| 4513 | INT = 2, |
| 4514 | QUIT = 3, |
| 4515 | ILL = 4, |
| 4516 | TRAP = 5, |
| 4517 | ABRT = 6, |
| 4518 | STKFLT = 7, |
| 4519 | FPE = 8, |
| 4520 | KILL = 9, |
| 4521 | BUS = 10, |
| 4522 | SEGV = 11, |
| 4523 | XCPU = 12, |
| 4524 | PIPE = 13, |
| 4525 | ALRM = 14, |
| 4526 | TERM = 15, |
| 4527 | USR1 = 16, |
| 4528 | USR2 = 17, |
| 4529 | CHLD = 18, |
| 4530 | PWR = 19, |
| 4531 | VTALRM = 20, |
| 4532 | PROF = 21, |
| 4533 | IO = 22, |
| 4534 | WINCH = 23, |
| 4535 | STOP = 24, |
| 4536 | TSTP = 25, |
| 4537 | CONT = 26, |
| 4538 | TTIN = 27, |
| 4539 | TTOU = 28, |
| 4540 | URG = 29, |
| 4541 | XFSZ = 30, |
| 4542 | SYS = 31, |
| 4543 | _, |
| 4158 | 4544 | } else enum(u32) { |
| 4159 | 4545 | pub const BLOCK = 0; |
| 4160 | 4546 | pub const UNBLOCK = 1; |
| ... | ... | @@ -4231,8 +4617,20 @@ pub const SOCK = struct { |
| 4231 | 4617 | pub const SEQPACKET = 5; |
| 4232 | 4618 | pub const DCCP = 6; |
| 4233 | 4619 | pub const PACKET = 10; |
| 4234 | | pub const CLOEXEC = if (is_sparc) 0o20000000 else 0o2000000; |
| 4235 | | pub const NONBLOCK = if (is_mips) 0o200 else if (is_sparc) 0o40000 else 0o4000; |
| 4620 | pub const CLOEXEC = if (is_sparc) |
| 4621 | 0o20000000 |
| 4622 | else if (native_arch == .alpha) |
| 4623 | 0o10000000 |
| 4624 | else |
| 4625 | 0o2000000; |
| 4626 | pub const NONBLOCK = if (is_mips) |
| 4627 | 0o200 |
| 4628 | else if (is_sparc) |
| 4629 | 0o40000 |
| 4630 | else if (is_hppa or native_arch == .alpha) |
| 4631 | 0x40000000 |
| 4632 | else |
| 4633 | 0o4000; |
| 4236 | 4634 | }; |
| 4237 | 4635 | |
| 4238 | 4636 | pub const TCP = struct { |
| ... | ... | @@ -4646,6 +5044,77 @@ pub const SO = if (is_mips) struct { |
| 4646 | 5044 | pub const RCVTIMEO_NEW = 68; |
| 4647 | 5045 | pub const SNDTIMEO_NEW = 69; |
| 4648 | 5046 | pub const DETACH_REUSEPORT_BPF = 71; |
| 5047 | } else if (native_arch == .alpha) struct { |
| 5048 | pub const DEBUG = 1; |
| 5049 | pub const REUSEADDR = 0x0004; |
| 5050 | pub const KEEPALIVE = 0x0008; |
| 5051 | pub const DONTROUTE = 0x0010; |
| 5052 | pub const BROADCAST = 0x0020; |
| 5053 | pub const LINGER = 0x0080; |
| 5054 | pub const OOBINLINE = 0x0100; |
| 5055 | pub const REUSEPORT = 0x0200; |
| 5056 | |
| 5057 | pub const SNDBUF = 0x1001; |
| 5058 | pub const RCVBUF = 0x1002; |
| 5059 | pub const SNDLOWAT = 0x1011; |
| 5060 | pub const RCVLOWAT = 0x1010; |
| 5061 | pub const RCVTIMEO = 0x1012; |
| 5062 | pub const SNDTIMEO = 0x1013; |
| 5063 | pub const ERROR = 0x1007; |
| 5064 | pub const TYPE = 0x1008; |
| 5065 | pub const ACCEPTCONN = 0x1014; |
| 5066 | pub const PROTOCOL = 0x1028; |
| 5067 | pub const DOMAIN = 0x1029; |
| 5068 | |
| 5069 | pub const NO_CHECK = 11; |
| 5070 | pub const PRIORITY = 12; |
| 5071 | pub const BSDCOMPAT = 14; |
| 5072 | pub const PASSCRED = 17; |
| 5073 | pub const PEERCRED = 18; |
| 5074 | pub const PEERSEC = 30; |
| 5075 | pub const SNDBUFFORCE = 0x100a; |
| 5076 | pub const RCVBUFFORCE = 0x100b; |
| 5077 | pub const SECURITY_AUTHENTICATION = 19; |
| 5078 | pub const SECURITY_ENCRYPTION_TRANSPORT = 20; |
| 5079 | pub const SECURITY_ENCRYPTION_NETWORK = 21; |
| 5080 | pub const BINDTODEVICE = 25; |
| 5081 | pub const ATTACH_FILTER = 26; |
| 5082 | pub const DETACH_FILTER = 27; |
| 5083 | pub const GET_FILTER = ATTACH_FILTER; |
| 5084 | pub const PEERNAME = 28; |
| 5085 | pub const TIMESTAMP_OLD = 29; |
| 5086 | pub const PASSSEC = 34; |
| 5087 | pub const TIMESTAMPNS_OLD = 35; |
| 5088 | pub const MARK = 36; |
| 5089 | pub const TIMESTAMPING_OLD = 37; |
| 5090 | pub const RXQ_OVFL = 40; |
| 5091 | pub const WIFI_STATUS = 41; |
| 5092 | pub const PEEK_OFF = 42; |
| 5093 | pub const NOFCS = 43; |
| 5094 | pub const LOCK_FILTER = 44; |
| 5095 | pub const SELECT_ERR_QUEUE = 45; |
| 5096 | pub const BUSY_POLL = 46; |
| 5097 | pub const MAX_PACING_RATE = 47; |
| 5098 | pub const BPF_EXTENSIONS = 48; |
| 5099 | pub const INCOMING_CPU = 49; |
| 5100 | pub const ATTACH_BPF = 50; |
| 5101 | pub const DETACH_BPF = DETACH_FILTER; |
| 5102 | pub const ATTACH_REUSEPORT_CBPF = 51; |
| 5103 | pub const ATTACH_REUSEPORT_EBPF = 52; |
| 5104 | pub const CNX_ADVICE = 53; |
| 5105 | pub const MEMINFO = 55; |
| 5106 | pub const INCOMING_NAPI_ID = 56; |
| 5107 | pub const COOKIE = 57; |
| 5108 | pub const PEERGROUPS = 59; |
| 5109 | pub const ZEROCOPY = 60; |
| 5110 | pub const TXTIME = 61; |
| 5111 | pub const BINDTOIFINDEX = 62; |
| 5112 | pub const TIMESTAMP_NEW = 63; |
| 5113 | pub const TIMESTAMPNS_NEW = 64; |
| 5114 | pub const TIMESTAMPING_NEW = 65; |
| 5115 | pub const RCVTIMEO_NEW = 66; |
| 5116 | pub const SNDTIMEO_NEW = 67; |
| 5117 | pub const DETACH_REUSEPORT_BPF = 68; |
| 4649 | 5118 | } else struct { |
| 4650 | 5119 | pub const DEBUG = 1; |
| 4651 | 5120 | pub const REUSEADDR = 2; |
| ... | ... | @@ -4731,7 +5200,10 @@ pub const SCM = struct { |
| 4731 | 5200 | }; |
| 4732 | 5201 | |
| 4733 | 5202 | pub const SOL = struct { |
| 4734 | | pub const SOCKET = if (is_mips or is_sparc) 65535 else 1; |
| 5203 | pub const SOCKET = if (is_mips or is_sparc or native_arch == .alpha) |
| 5204 | 0xffff |
| 5205 | else |
| 5206 | 1; |
| 4735 | 5207 | |
| 4736 | 5208 | pub const IP = 0; |
| 4737 | 5209 | pub const IPV6 = 41; |
| ... | ... | @@ -5318,7 +5790,7 @@ pub const T = if (is_mips) struct { |
| 5318 | 5790 | pub const IOCSERSETMULTI = 0x5490; |
| 5319 | 5791 | pub const IOCMIWAIT = 0x5491; |
| 5320 | 5792 | pub const IOCGICOUNT = 0x5492; |
| 5321 | | } else if (is_ppc) struct { |
| 5793 | } else if (is_ppc or native_arch == .alpha) struct { |
| 5322 | 5794 | pub const FIOCLEX = IOCTL.IO('f', 1); |
| 5323 | 5795 | pub const FIONCLEX = IOCTL.IO('f', 2); |
| 5324 | 5796 | pub const FIOASYNC = IOCTL.IOW('f', 125, c_int); |
| ... | ... | @@ -6102,6 +6574,15 @@ pub const TFD = switch (native_arch) { |
| 6102 | 6574 | |
| 6103 | 6575 | pub const TIMER = TFD_TIMER; |
| 6104 | 6576 | }, |
| 6577 | .alpha => packed struct(u32) { |
| 6578 | _0: u2 = 0, |
| 6579 | NONBLOCK: bool = false, |
| 6580 | _3: u18 = 0, |
| 6581 | CLOEXEC: bool = false, |
| 6582 | _: u10 = 0, |
| 6583 | |
| 6584 | pub const TIMER = TFD_TIMER; |
| 6585 | }, |
| 6105 | 6586 | else => packed struct(u32) { |
| 6106 | 6587 | _0: u11 = 0, |
| 6107 | 6588 | NONBLOCK: bool = false, |
| ... | ... | @@ -6131,6 +6612,11 @@ pub const k_sigaction = switch (native_arch) { |
| 6131 | 6612 | flags: c_ulong, |
| 6132 | 6613 | mask: sigset_t, |
| 6133 | 6614 | }, |
| 6615 | .alpha => extern struct { |
| 6616 | handler: k_sigaction_funcs.handler, |
| 6617 | mask: sigset_t, |
| 6618 | flags: c_int, |
| 6619 | }, |
| 6134 | 6620 | else => extern struct { |
| 6135 | 6621 | handler: k_sigaction_funcs.handler, |
| 6136 | 6622 | flags: c_ulong, |
| ... | ... | @@ -6155,6 +6641,7 @@ pub const Sigaction = struct { |
| 6155 | 6641 | mask: sigset_t, |
| 6156 | 6642 | flags: switch (native_arch) { |
| 6157 | 6643 | .mips, .mipsel, .mips64, .mips64el => c_uint, |
| 6644 | .alpha => c_int, |
| 6158 | 6645 | else => c_ulong, |
| 6159 | 6646 | }, |
| 6160 | 6647 | }; |
| ... | ... | @@ -7625,7 +8112,14 @@ pub const rusage = extern struct { |
| 7625 | 8112 | }; |
| 7626 | 8113 | |
| 7627 | 8114 | pub const NCC = if (is_ppc) 10 else 8; |
| 7628 | | pub const NCCS = if (is_mips) 32 else if (is_ppc) 19 else if (is_sparc) 17 else 32; |
| 8115 | pub const NCCS = if (is_mips) |
| 8116 | 32 |
| 8117 | else if (is_ppc or native_arch == .alpha) |
| 8118 | 19 |
| 8119 | else if (is_sparc) |
| 8120 | 17 |
| 8121 | else |
| 8122 | 32; |
| 7629 | 8123 | |
| 7630 | 8124 | pub const speed_t = if (is_ppc) enum(c_uint) { |
| 7631 | 8125 | B0 = 0x0000000, |
| ... | ... | @@ -7739,7 +8233,7 @@ pub const speed_t = if (is_ppc) enum(c_uint) { |
| 7739 | 8233 | |
| 7740 | 8234 | pub const tcflag_t = if (native_arch == .sparc) c_ulong else c_uint; |
| 7741 | 8235 | |
| 7742 | | pub const tc_iflag_t = if (is_ppc) packed struct(tcflag_t) { |
| 8236 | pub const tc_iflag_t = if (is_ppc or native_arch == .alpha) packed struct(tcflag_t) { |
| 7743 | 8237 | IGNBRK: bool = false, |
| 7744 | 8238 | BRKINT: bool = false, |
| 7745 | 8239 | IGNPAR: bool = false, |
| ... | ... | @@ -7775,7 +8269,7 @@ pub const tc_iflag_t = if (is_ppc) packed struct(tcflag_t) { |
| 7775 | 8269 | _15: u17 = 0, |
| 7776 | 8270 | }; |
| 7777 | 8271 | |
| 7778 | | pub const NLDLY = if (is_ppc) enum(u2) { |
| 8272 | pub const NLDLY = if (is_ppc or native_arch == .alpha) enum(u2) { |
| 7779 | 8273 | NL0 = 0, |
| 7780 | 8274 | NL1 = 1, |
| 7781 | 8275 | NL2 = 2, |
| ... | ... | @@ -7816,7 +8310,7 @@ pub const FFDLY = enum(u1) { |
| 7816 | 8310 | FF1 = 1, |
| 7817 | 8311 | }; |
| 7818 | 8312 | |
| 7819 | | pub const tc_oflag_t = if (is_ppc) packed struct(tcflag_t) { |
| 8313 | pub const tc_oflag_t = if (is_ppc or native_arch == .alpha) packed struct(tcflag_t) { |
| 7820 | 8314 | OPOST: bool = false, |
| 7821 | 8315 | ONLCR: bool = false, |
| 7822 | 8316 | OLCUC: bool = false, |
| ... | ... | @@ -7875,7 +8369,7 @@ pub const CSIZE = enum(u2) { |
| 7875 | 8369 | CS8 = 3, |
| 7876 | 8370 | }; |
| 7877 | 8371 | |
| 7878 | | pub const tc_cflag_t = if (is_ppc) packed struct(tcflag_t) { |
| 8372 | pub const tc_cflag_t = if (is_ppc or native_arch == .alpha) packed struct(tcflag_t) { |
| 7879 | 8373 | _0: u8 = 0, |
| 7880 | 8374 | CSIZE: CSIZE = .CS5, |
| 7881 | 8375 | CSTOPB: bool = false, |
| ... | ... | @@ -7922,7 +8416,7 @@ pub const tc_lflag_t = if (is_mips) packed struct(tcflag_t) { |
| 7922 | 8416 | TOSTOP: bool = false, |
| 7923 | 8417 | EXTPROC: bool = false, |
| 7924 | 8418 | _17: u15 = 0, |
| 7925 | | } else if (is_ppc) packed struct(tcflag_t) { |
| 8419 | } else if (is_ppc or native_arch == .alpha) packed struct(tcflag_t) { |
| 7926 | 8420 | ECHOKE: bool = false, |
| 7927 | 8421 | ECHOE: bool = false, |
| 7928 | 8422 | ECHOK: bool = false, |
| ... | ... | @@ -8023,6 +8517,24 @@ pub const V = if (is_mips) enum(u32) { |
| 8023 | 8517 | STOP = 14, |
| 8024 | 8518 | LNEXT = 15, |
| 8025 | 8519 | DISCARD = 16, |
| 8520 | } else if (arch_bits == .alpha) enum(u32) { |
| 8521 | EOF = 0, |
| 8522 | EOL = 1, |
| 8523 | EOL2 = 2, |
| 8524 | ERASE = 3, |
| 8525 | WERASE = 4, |
| 8526 | KILL = 5, |
| 8527 | REPRINT = 6, |
| 8528 | SWTC = 7, |
| 8529 | INTR = 8, |
| 8530 | QUIT = 9, |
| 8531 | SUSP = 10, |
| 8532 | START = 12, |
| 8533 | STOP = 13, |
| 8534 | LNEXT = 14, |
| 8535 | DISCARD = 15, |
| 8536 | MIN = 16, |
| 8537 | TIME = 17, |
| 8026 | 8538 | } else enum(u32) { |
| 8027 | 8539 | INTR = 0, |
| 8028 | 8540 | QUIT = 1, |
| ... | ... | @@ -8053,7 +8565,7 @@ pub const sgttyb = if (is_mips or is_ppc or is_sparc) extern struct { |
| 8053 | 8565 | flags: if (is_mips) c_int else c_short, |
| 8054 | 8566 | } else void; |
| 8055 | 8567 | |
| 8056 | | pub const tchars = if (is_mips or is_ppc or is_sparc) extern struct { |
| 8568 | pub const tchars = if (is_mips or is_ppc or is_sparc or native_arch == .alpha) extern struct { |
| 8057 | 8569 | intrc: c_char, |
| 8058 | 8570 | quitc: c_char, |
| 8059 | 8571 | startc: c_char, |
| ... | ... | @@ -8062,7 +8574,7 @@ pub const tchars = if (is_mips or is_ppc or is_sparc) extern struct { |
| 8062 | 8574 | brkc: c_char, |
| 8063 | 8575 | } else void; |
| 8064 | 8576 | |
| 8065 | | pub const ltchars = if (is_mips or is_ppc or is_sparc) extern struct { |
| 8577 | pub const ltchars = if (is_mips or is_ppc or is_sparc or native_arch == .alpha) extern struct { |
| 8066 | 8578 | suspc: c_char, |
| 8067 | 8579 | dsuspc: c_char, |
| 8068 | 8580 | rprntc: c_char, |
| ... | ... | @@ -8087,7 +8599,7 @@ pub const termios = if (is_mips or is_sparc) extern struct { |
| 8087 | 8599 | lflag: tc_lflag_t, |
| 8088 | 8600 | line: cc_t, |
| 8089 | 8601 | cc: [NCCS]cc_t, |
| 8090 | | } else if (is_ppc) extern struct { |
| 8602 | } else if (is_ppc or native_arch == .alpha) extern struct { |
| 8091 | 8603 | iflag: tc_iflag_t, |
| 8092 | 8604 | oflag: tc_oflag_t, |
| 8093 | 8605 | cflag: tc_cflag_t, |
| ... | ... | @@ -8107,7 +8619,7 @@ pub const termios = if (is_mips or is_sparc) extern struct { |
| 8107 | 8619 | ospeed: speed_t, |
| 8108 | 8620 | }; |
| 8109 | 8621 | |
| 8110 | | pub const termios2 = if (is_mips) extern struct { |
| 8622 | pub const termios2 = if (is_mips or native_arch == .alpha) extern struct { |
| 8111 | 8623 | iflag: tc_iflag_t, |
| 8112 | 8624 | oflag: tc_oflag_t, |
| 8113 | 8625 | cflag: tc_cflag_t, |
| ... | ... | @@ -8686,6 +9198,49 @@ pub const rlimit_resource = if (native_arch.isMIPS()) enum(c_int) { |
| 8686 | 9198 | /// call before being forcibly descheduled. |
| 8687 | 9199 | RTTIME = 15, |
| 8688 | 9200 | |
| 9201 | _, |
| 9202 | } else if (native_arch == .alpha) enum(c_int) { |
| 9203 | /// Per-process CPU limit, in seconds. |
| 9204 | CPU = 0, |
| 9205 | /// Largest file that can be created, in bytes. |
| 9206 | FSIZE = 1, |
| 9207 | /// Maximum size of data segment, in bytes. |
| 9208 | DATA = 2, |
| 9209 | /// Maximum size of stack segment, in bytes. |
| 9210 | STACK = 3, |
| 9211 | /// Largest core file that can be created, in bytes. |
| 9212 | CORE = 4, |
| 9213 | /// Largest resident set size, in bytes. |
| 9214 | /// This affects swapping; processes that are exceeding their |
| 9215 | /// resident set size will be more likely to have physical memory |
| 9216 | /// taken from them. |
| 9217 | RSS = 5, |
| 9218 | /// Number of open files. |
| 9219 | NOFILE = 6, |
| 9220 | /// Address space limit. |
| 9221 | AS = 7, |
| 9222 | /// Number of processes. |
| 9223 | NPROC = 8, |
| 9224 | /// Locked-in-memory address space. |
| 9225 | MEMLOCK = 9, |
| 9226 | /// Maximum number of file locks. |
| 9227 | LOCKS = 10, |
| 9228 | /// Maximum number of pending signals. |
| 9229 | SIGPENDING = 11, |
| 9230 | /// Maximum bytes in POSIX message queues. |
| 9231 | MSGQUEUE = 12, |
| 9232 | /// Maximum nice priority allowed to raise to. |
| 9233 | /// Nice levels 19 .. -20 correspond to 0 .. 39 |
| 9234 | /// values of this resource limit. |
| 9235 | NICE = 13, |
| 9236 | /// Maximum realtime priority allowed for non-privileged |
| 9237 | /// processes. |
| 9238 | RTPRIO = 14, |
| 9239 | /// Maximum CPU time in µs that a process scheduled under a real-time |
| 9240 | /// scheduling policy may consume without making a blocking system |
| 9241 | /// call before being forcibly descheduled. |
| 9242 | RTTIME = 15, |
| 9243 | |
| 8689 | 9244 | _, |
| 8690 | 9245 | } else enum(c_int) { |
| 8691 | 9246 | /// Per-process CPU limit, in seconds. |
| ... | ... | @@ -8736,7 +9291,10 @@ pub const rlim_t = u64; |
| 8736 | 9291 | |
| 8737 | 9292 | pub const RLIM = struct { |
| 8738 | 9293 | /// No limit |
| 8739 | | pub const INFINITY = ~@as(rlim_t, 0); |
| 9294 | pub const INFINITY: rlim_t = if (native_arch == .alpha) |
| 9295 | ~@as(u63, 0) |
| 9296 | else |
| 9297 | ~@as(rlim_t, 0); |
| 8740 | 9298 | |
| 8741 | 9299 | pub const SAVED_MAX = INFINITY; |
| 8742 | 9300 | pub const SAVED_CUR = INFINITY; |