@zigc/lib 0.17.0-dev.340 → 0.17.0-dev.387

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/std/os/linux.zig CHANGED
@@ -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;
@@ -31,6 +32,7 @@ test {
31
32
 
32
33
  const arch_bits = switch (native_arch) {
33
34
  .aarch64, .aarch64_be => @import("linux/aarch64.zig"),
35
+ .alpha => @import("linux/alpha.zig"),
34
36
  .arc, .arceb => @import("linux/arc.zig"),
35
37
  .arm, .armeb, .thumb, .thumbeb => @import("linux/arm.zig"),
36
38
  .hexagon => @import("linux/hexagon.zig"),
@@ -96,7 +98,6 @@ pub fn clone(
96
98
  }
97
99
 
98
100
  pub const ARCH = arch_bits.ARCH;
99
- pub const HWCAP = arch_bits.HWCAP;
100
101
  pub const SC = arch_bits.SC;
101
102
  pub const VDSO = arch_bits.VDSO;
102
103
  pub const user_desc = arch_bits.user_desc;
@@ -125,6 +126,7 @@ pub const syscalls = @import("linux/syscalls.zig");
125
126
  pub const SYS = switch (native_arch) {
126
127
  .arc, .arceb => syscalls.Arc,
127
128
  .aarch64, .aarch64_be => syscalls.Arm64,
129
+ .alpha => syscalls.Alpha,
128
130
  .arm, .armeb, .thumb, .thumbeb => syscalls.Arm,
129
131
  .csky => syscalls.CSky,
130
132
  .hexagon => syscalls.Hexagon,
@@ -312,6 +314,30 @@ pub const MAP = switch (native_arch) {
312
314
  UNINITIALIZED: bool = false,
313
315
  _: u5 = 0,
314
316
  },
317
+ .alpha => packed struct(u32) {
318
+ TYPE: MAP_TYPE,
319
+ ANONYMOUS: bool = false,
320
+ _3: u1 = 0,
321
+ _4: u1 = 0,
322
+ _5: u1 = 0,
323
+ FIXED: bool = false,
324
+ _7: u1 = 0,
325
+ _8: u1 = 0,
326
+ _9: u1 = 0,
327
+ GROWSDOWN: bool = false,
328
+ DENYWRITE: bool = false,
329
+ EXECUTABLE: bool = false,
330
+ LOCKED: bool = false,
331
+ NORESERVE: bool = false,
332
+ POPULATE: bool = false,
333
+ NONBLOCK: bool = false,
334
+ STACK: bool = false,
335
+ HUGHETLB: bool = false,
336
+ FIXED_NOREPLACE: bool = false,
337
+ _19: u4 = 0,
338
+ _20: u1 = 0,
339
+ _: u5 = 0,
340
+ },
315
341
  else => @compileError("missing std.os.linux.MAP constants for this architecture"),
316
342
  };
317
343
 
@@ -521,9 +547,79 @@ pub const O = switch (native_arch) {
521
547
  PATH: bool = false,
522
548
  _22: u10 = 0,
523
549
  },
550
+ .alpha => packed struct(u32) {
551
+ ACCMODE: ACCMODE = .RDONLY,
552
+ NONBLOCK: bool = false,
553
+ APPEND: bool = false,
554
+ _4: u5 = 0,
555
+ CREAT: bool = false,
556
+ TRUNC: bool = false,
557
+ EXCL: bool = false,
558
+ NOCTTY: bool = false,
559
+ _9: u1 = 0,
560
+ DSYNC: bool = false,
561
+ DIRECTORY: bool = false,
562
+ NOFOLLOW: bool = false,
563
+ LARGEFILE: bool = false,
564
+ _14: u1 = 0,
565
+ DIRECT: bool = false,
566
+ NOATIME: bool = false,
567
+ CLOEXEC: bool = false,
568
+ SYNC: bool = false,
569
+ PATH: bool = false,
570
+ TMPFILE: bool = false,
571
+ _: u7 = 0,
572
+ },
524
573
  else => @compileError("missing std.os.linux.O constants for this architecture"),
525
574
  };
526
575
 
576
+ pub const HWCAP = switch (native_arch) {
577
+ .arm, .armeb, .thumb, .thumbeb => struct {
578
+ pub const SWP = 1 << 0;
579
+ pub const HALF = 1 << 1;
580
+ pub const THUMB = 1 << 2;
581
+ pub const @"26BIT" = 1 << 3;
582
+ pub const FAST_MULT = 1 << 4;
583
+ pub const FPA = 1 << 5;
584
+ pub const VFP = 1 << 6;
585
+ pub const EDSP = 1 << 7;
586
+ pub const JAVA = 1 << 8;
587
+ pub const IWMMXT = 1 << 9;
588
+ pub const CRUNCH = 1 << 10;
589
+ pub const THUMBEE = 1 << 11;
590
+ pub const NEON = 1 << 12;
591
+ pub const VFPv3 = 1 << 13;
592
+ pub const VFPv3D16 = 1 << 14;
593
+ pub const TLS = 1 << 15;
594
+ pub const VFPv4 = 1 << 16;
595
+ pub const IDIVA = 1 << 17;
596
+ pub const IDIVT = 1 << 18;
597
+ pub const VFPD32 = 1 << 19;
598
+ pub const IDIV = IDIVA | IDIVT;
599
+ pub const LPAE = 1 << 20;
600
+ pub const EVTSTRM = 1 << 21;
601
+ },
602
+ .loongarch32, .loongarch64 => struct {
603
+ pub const CPUCFG = 1 << 0;
604
+ pub const LAM = 1 << 1;
605
+ pub const UAL = 1 << 2;
606
+ pub const FPU = 1 << 3;
607
+ pub const LSX = 1 << 4;
608
+ pub const LASX = 1 << 5;
609
+ pub const CRC32 = 1 << 6;
610
+ pub const COMPLEX = 1 << 7;
611
+ pub const CRYPTO = 1 << 8;
612
+ pub const LVZ = 1 << 9;
613
+ pub const LBT_X86 = 1 << 10;
614
+ pub const LBT_ARM = 1 << 11;
615
+ pub const LBT_MIPS = 1 << 12;
616
+ pub const PTW = 1 << 13;
617
+ pub const LSPW = 1 << 14;
618
+ pub const SCQ = 1 << 15;
619
+ },
620
+ else => struct {},
621
+ };
622
+
527
623
  pub const RENAME = packed struct(u32) {
528
624
  /// Cannot be set together with `EXCHANGE`.
529
625
  NOREPLACE: bool = false,
@@ -1848,23 +1944,68 @@ pub const F = struct {
1848
1944
  pub const SETLK = GET_SET_LK.SETLK;
1849
1945
  pub const SETLKW = GET_SET_LK.SETLKW;
1850
1946
 
1851
- const GET_SET_LK = if (@sizeOf(usize) == 64) extern struct {
1852
- pub const GETLK = if (is_mips) 14 else if (is_sparc) 7 else 5;
1853
- pub const SETLK = if (is_mips) 6 else if (is_sparc) 8 else 6;
1854
- pub const SETLKW = if (is_mips) 7 else if (is_sparc) 9 else 7;
1855
- } else extern struct {
1856
- // 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;
1857
1949
 
1858
- pub const GETLK = if (is_mips) 33 else 12;
1859
- pub const SETLK = if (is_mips) 34 else 13;
1860
- 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
+ },
1861
2005
  };
1862
2006
 
1863
- pub const SETOWN = if (is_mips) 24 else if (is_sparc) 6 else 8;
1864
- pub const GETOWN = if (is_mips) 23 else if (is_sparc) 5 else 9;
1865
-
1866
- pub const SETSIG = 10;
1867
- 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;
1868
2009
 
1869
2010
  pub const SETOWN_EX = 15;
1870
2011
  pub const GETOWN_EX = 16;
@@ -1877,7 +2018,7 @@ pub const F = struct {
1877
2018
 
1878
2019
  pub const RDLCK = if (is_sparc) 1 else 0;
1879
2020
  pub const WRLCK = if (is_sparc) 2 else 1;
1880
- 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;
1881
2022
 
1882
2023
  pub const LINUX_SPECIFIC_BASE = 1024;
1883
2024
 
@@ -3342,6 +3483,294 @@ pub const E = switch (native_arch) {
3342
3483
  HWPOISON = 135,
3343
3484
  _,
3344
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
+ },
3345
3774
  else => enum(u16) {
3346
3775
  /// No error occurred.
3347
3776
  /// Same code used for `NSROK`.
@@ -3913,6 +4342,14 @@ pub const SA = if (is_mips) struct {
3913
4342
  pub const RESETHAND = 0x80000000;
3914
4343
  pub const ONSTACK = 0x08000000;
3915
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;
3916
4353
  } else struct {
3917
4354
  pub const NOCLDSTOP = 1;
3918
4355
  pub const NOCLDWAIT = 2;
@@ -4015,6 +4452,95 @@ pub const SIG = if (is_mips) enum(u32) {
4015
4452
  USR1 = 30,
4016
4453
  USR2 = 31,
4017
4454
  _,
4455
+ } else if (native_arch == .alpha) enum(u32) {
4456
+ pub const BLOCK = 1;
4457
+ pub const UNBLOCK = 2;
4458
+ pub const SETMASK = 3;
4459
+
4460
+ pub const ERR: ?Sigaction.handler_fn = @ptrFromInt(maxInt(usize));
4461
+ pub const DFL: ?Sigaction.handler_fn = @ptrFromInt(0);
4462
+ pub const IGN: ?Sigaction.handler_fn = @ptrFromInt(1);
4463
+
4464
+ pub const POLL: SIG = .IO;
4465
+ pub const PWR: SIG = .INFO;
4466
+ pub const IOT: SIG = .ABRT;
4467
+
4468
+ HUP = 1,
4469
+ INT = 2,
4470
+ QUIT = 3,
4471
+ ILL = 4,
4472
+ TRAP = 5,
4473
+ ABRT = 6,
4474
+ EMT = 7,
4475
+ FPE = 8,
4476
+ KILL = 9,
4477
+ BUS = 10,
4478
+ SEGV = 11,
4479
+ SYS = 12,
4480
+ PIPE = 13,
4481
+ ALRM = 14,
4482
+ TERM = 15,
4483
+ URG = 16,
4484
+ STOP = 17,
4485
+ TSTP = 18,
4486
+ CONT = 19,
4487
+ CHLD = 20,
4488
+ TTIN = 21,
4489
+ TTOU = 22,
4490
+ IO = 23,
4491
+ XCPU = 24,
4492
+ XFSZ = 25,
4493
+ VTALRM = 26,
4494
+ PROF = 27,
4495
+ WINCH = 28,
4496
+ INFO = 29,
4497
+ USR1 = 30,
4498
+ USR2 = 31,
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
+ _,
4018
4544
  } else enum(u32) {
4019
4545
  pub const BLOCK = 0;
4020
4546
  pub const UNBLOCK = 1;
@@ -4091,8 +4617,20 @@ pub const SOCK = struct {
4091
4617
  pub const SEQPACKET = 5;
4092
4618
  pub const DCCP = 6;
4093
4619
  pub const PACKET = 10;
4094
- pub const CLOEXEC = if (is_sparc) 0o20000000 else 0o2000000;
4095
- 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;
4096
4634
  };
4097
4635
 
4098
4636
  pub const TCP = struct {
@@ -4506,6 +5044,77 @@ pub const SO = if (is_mips) struct {
4506
5044
  pub const RCVTIMEO_NEW = 68;
4507
5045
  pub const SNDTIMEO_NEW = 69;
4508
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;
4509
5118
  } else struct {
4510
5119
  pub const DEBUG = 1;
4511
5120
  pub const REUSEADDR = 2;
@@ -4591,7 +5200,10 @@ pub const SCM = struct {
4591
5200
  };
4592
5201
 
4593
5202
  pub const SOL = struct {
4594
- 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;
4595
5207
 
4596
5208
  pub const IP = 0;
4597
5209
  pub const IPV6 = 41;
@@ -5178,7 +5790,7 @@ pub const T = if (is_mips) struct {
5178
5790
  pub const IOCSERSETMULTI = 0x5490;
5179
5791
  pub const IOCMIWAIT = 0x5491;
5180
5792
  pub const IOCGICOUNT = 0x5492;
5181
- } else if (is_ppc) struct {
5793
+ } else if (is_ppc or native_arch == .alpha) struct {
5182
5794
  pub const FIOCLEX = IOCTL.IO('f', 1);
5183
5795
  pub const FIONCLEX = IOCTL.IO('f', 2);
5184
5796
  pub const FIOASYNC = IOCTL.IOW('f', 125, c_int);
@@ -5962,6 +6574,15 @@ pub const TFD = switch (native_arch) {
5962
6574
 
5963
6575
  pub const TIMER = TFD_TIMER;
5964
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
+ },
5965
6586
  else => packed struct(u32) {
5966
6587
  _0: u11 = 0,
5967
6588
  NONBLOCK: bool = false,
@@ -5991,6 +6612,11 @@ pub const k_sigaction = switch (native_arch) {
5991
6612
  flags: c_ulong,
5992
6613
  mask: sigset_t,
5993
6614
  },
6615
+ .alpha => extern struct {
6616
+ handler: k_sigaction_funcs.handler,
6617
+ mask: sigset_t,
6618
+ flags: c_int,
6619
+ },
5994
6620
  else => extern struct {
5995
6621
  handler: k_sigaction_funcs.handler,
5996
6622
  flags: c_ulong,
@@ -6015,6 +6641,7 @@ pub const Sigaction = struct {
6015
6641
  mask: sigset_t,
6016
6642
  flags: switch (native_arch) {
6017
6643
  .mips, .mipsel, .mips64, .mips64el => c_uint,
6644
+ .alpha => c_int,
6018
6645
  else => c_ulong,
6019
6646
  },
6020
6647
  };
@@ -7485,7 +8112,14 @@ pub const rusage = extern struct {
7485
8112
  };
7486
8113
 
7487
8114
  pub const NCC = if (is_ppc) 10 else 8;
7488
- 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;
7489
8123
 
7490
8124
  pub const speed_t = if (is_ppc) enum(c_uint) {
7491
8125
  B0 = 0x0000000,
@@ -7599,7 +8233,7 @@ pub const speed_t = if (is_ppc) enum(c_uint) {
7599
8233
 
7600
8234
  pub const tcflag_t = if (native_arch == .sparc) c_ulong else c_uint;
7601
8235
 
7602
- 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) {
7603
8237
  IGNBRK: bool = false,
7604
8238
  BRKINT: bool = false,
7605
8239
  IGNPAR: bool = false,
@@ -7635,7 +8269,7 @@ pub const tc_iflag_t = if (is_ppc) packed struct(tcflag_t) {
7635
8269
  _15: u17 = 0,
7636
8270
  };
7637
8271
 
7638
- pub const NLDLY = if (is_ppc) enum(u2) {
8272
+ pub const NLDLY = if (is_ppc or native_arch == .alpha) enum(u2) {
7639
8273
  NL0 = 0,
7640
8274
  NL1 = 1,
7641
8275
  NL2 = 2,
@@ -7676,7 +8310,7 @@ pub const FFDLY = enum(u1) {
7676
8310
  FF1 = 1,
7677
8311
  };
7678
8312
 
7679
- 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) {
7680
8314
  OPOST: bool = false,
7681
8315
  ONLCR: bool = false,
7682
8316
  OLCUC: bool = false,
@@ -7735,7 +8369,7 @@ pub const CSIZE = enum(u2) {
7735
8369
  CS8 = 3,
7736
8370
  };
7737
8371
 
7738
- 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) {
7739
8373
  _0: u8 = 0,
7740
8374
  CSIZE: CSIZE = .CS5,
7741
8375
  CSTOPB: bool = false,
@@ -7782,7 +8416,7 @@ pub const tc_lflag_t = if (is_mips) packed struct(tcflag_t) {
7782
8416
  TOSTOP: bool = false,
7783
8417
  EXTPROC: bool = false,
7784
8418
  _17: u15 = 0,
7785
- } else if (is_ppc) packed struct(tcflag_t) {
8419
+ } else if (is_ppc or native_arch == .alpha) packed struct(tcflag_t) {
7786
8420
  ECHOKE: bool = false,
7787
8421
  ECHOE: bool = false,
7788
8422
  ECHOK: bool = false,
@@ -7883,6 +8517,24 @@ pub const V = if (is_mips) enum(u32) {
7883
8517
  STOP = 14,
7884
8518
  LNEXT = 15,
7885
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,
7886
8538
  } else enum(u32) {
7887
8539
  INTR = 0,
7888
8540
  QUIT = 1,
@@ -7913,7 +8565,7 @@ pub const sgttyb = if (is_mips or is_ppc or is_sparc) extern struct {
7913
8565
  flags: if (is_mips) c_int else c_short,
7914
8566
  } else void;
7915
8567
 
7916
- 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 {
7917
8569
  intrc: c_char,
7918
8570
  quitc: c_char,
7919
8571
  startc: c_char,
@@ -7922,7 +8574,7 @@ pub const tchars = if (is_mips or is_ppc or is_sparc) extern struct {
7922
8574
  brkc: c_char,
7923
8575
  } else void;
7924
8576
 
7925
- 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 {
7926
8578
  suspc: c_char,
7927
8579
  dsuspc: c_char,
7928
8580
  rprntc: c_char,
@@ -7947,7 +8599,7 @@ pub const termios = if (is_mips or is_sparc) extern struct {
7947
8599
  lflag: tc_lflag_t,
7948
8600
  line: cc_t,
7949
8601
  cc: [NCCS]cc_t,
7950
- } else if (is_ppc) extern struct {
8602
+ } else if (is_ppc or native_arch == .alpha) extern struct {
7951
8603
  iflag: tc_iflag_t,
7952
8604
  oflag: tc_oflag_t,
7953
8605
  cflag: tc_cflag_t,
@@ -7967,7 +8619,7 @@ pub const termios = if (is_mips or is_sparc) extern struct {
7967
8619
  ospeed: speed_t,
7968
8620
  };
7969
8621
 
7970
- pub const termios2 = if (is_mips) extern struct {
8622
+ pub const termios2 = if (is_mips or native_arch == .alpha) extern struct {
7971
8623
  iflag: tc_iflag_t,
7972
8624
  oflag: tc_oflag_t,
7973
8625
  cflag: tc_cflag_t,
@@ -8546,6 +9198,49 @@ pub const rlimit_resource = if (native_arch.isMIPS()) enum(c_int) {
8546
9198
  /// call before being forcibly descheduled.
8547
9199
  RTTIME = 15,
8548
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
+
8549
9244
  _,
8550
9245
  } else enum(c_int) {
8551
9246
  /// Per-process CPU limit, in seconds.
@@ -8596,7 +9291,10 @@ pub const rlim_t = u64;
8596
9291
 
8597
9292
  pub const RLIM = struct {
8598
9293
  /// No limit
8599
- 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);
8600
9298
 
8601
9299
  pub const SAVED_MAX = INFINITY;
8602
9300
  pub const SAVED_CUR = INFINITY;