| ... | @@ -5,6 +5,7 @@ const arch = builtin.target.cpu.arch; | ... | @@ -5,6 +5,7 @@ const arch = builtin.target.cpu.arch; |
| 5 | | 5 | |
| 6 | comptime { | 6 | comptime { |
| 7 | std.debug.assert(builtin.target.os.tag == .linux); | 7 | std.debug.assert(builtin.target.os.tag == .linux); |
| | 8 | std.debug.assert(@bitSizeOf(usize) == 64); |
| 8 | } | 9 | } |
| 9 | | 10 | |
| 10 | pub const errno = struct { | 11 | pub const errno = struct { |
| ... | @@ -146,6 +147,7 @@ pub const errno = struct { | ... | @@ -146,6 +147,7 @@ pub const errno = struct { |
| 146 | | 147 | |
| 147 | pub const Enum = switch (builtin.target.cpu.arch) { | 148 | pub const Enum = switch (builtin.target.cpu.arch) { |
| 148 | .arc, | 149 | .arc, |
| | 150 | .arceb, |
| 149 | .arm, | 151 | .arm, |
| 150 | .armeb, | 152 | .armeb, |
| 151 | .aarch64, | 153 | .aarch64, |
| ... | @@ -156,13 +158,17 @@ pub const errno = struct { | ... | @@ -156,13 +158,17 @@ pub const errno = struct { |
| 156 | .loongarch64, | 158 | .loongarch64, |
| 157 | .m68k, | 159 | .m68k, |
| 158 | .riscv32, | 160 | .riscv32, |
| | 161 | .riscv32be, |
| 159 | .riscv64, | 162 | .riscv64, |
| | 163 | .riscv64be, |
| 160 | .s390x, | 164 | .s390x, |
| 161 | .sparc, | 165 | .sparc, |
| 162 | .sparc64, | 166 | .sparc64, |
| | 167 | .x86_16, |
| 163 | .x86, | 168 | .x86, |
| 164 | .x86_64, | 169 | .x86_64, |
| 165 | .xtensa, | 170 | .xtensa, |
| | 171 | .xtensaeb, |
| 166 | => enum(c_ushort) { | 172 | => enum(c_ushort) { |
| 167 | EPERM = 1, | 173 | EPERM = 1, |
| 168 | ENOENT = 2, | 174 | ENOENT = 2, |
| ... | @@ -856,12 +862,12 @@ pub const errno = struct { | ... | @@ -856,12 +862,12 @@ pub const errno = struct { |
| 856 | pub const EWOULDBLOCK: Enum = .EAGAIN; | 862 | pub const EWOULDBLOCK: Enum = .EAGAIN; |
| 857 | pub const ENOTSUP: Enum = .EOPNOTSUPP; | 863 | pub const ENOTSUP: Enum = .EOPNOTSUPP; |
| 858 | }, | 864 | }, |
| 859 | // alpha | 865 | .alpha => unreachable, |
| | 866 | .microblaze, .microblazeel => unreachable, |
| | 867 | .sh, .sheb => unreachable, |
| 860 | // nios2 | 868 | // nios2 |
| 861 | // microblaze | | |
| 862 | // openrisc | 869 | // openrisc |
| 863 | // parisc | 870 | // parisc |
| 864 | // sh | | |
| 865 | // um | 871 | // um |
| 866 | // @compileError("TODO: " ++ @tagName(v)), | 872 | // @compileError("TODO: " ++ @tagName(v)), |
| 867 | .avr, | 873 | .avr, |
| ... | @@ -883,6 +889,9 @@ pub const errno = struct { | ... | @@ -883,6 +889,9 @@ pub const errno = struct { |
| 883 | .wasm64, | 889 | .wasm64, |
| 884 | .ve, | 890 | .ve, |
| 885 | .or1k, | 891 | .or1k, |
| | 892 | .hppa, |
| | 893 | .hppa64, |
| | 894 | .kvx, |
| 886 | => unreachable, | 895 | => unreachable, |
| 887 | }; | 896 | }; |
| 888 | | 897 | |
| ... | @@ -2857,9 +2866,23 @@ pub const struct_timeval = linux.timeval; | ... | @@ -2857,9 +2866,23 @@ pub const struct_timeval = linux.timeval; |
| 2857 | pub const DIR = opaque {}; | 2866 | pub const DIR = opaque {}; |
| 2858 | pub const time_t = i64; | 2867 | pub const time_t = i64; |
| 2859 | pub const div_t = extern struct { quot: c_int, rem: c_int }; | 2868 | pub const div_t = extern struct { quot: c_int, rem: c_int }; |
| 2860 | pub const off_t = linux.off_t; | 2869 | pub const off_t = i64; |
| 2861 | pub const ino_t = linux.ino_t; | 2870 | pub const ino_t = u64; |
| 2862 | pub const struct_stat = linux.Stat; | 2871 | pub const dev_t = u64; |
| | 2872 | pub const nlink_t = c_ulong; |
| | 2873 | pub const blksize_t = c_long; |
| | 2874 | pub const blkcnt_t = i64; |
| | 2875 | pub const struct_stat = switch (arch) { |
| | 2876 | .mips64, .mips64el => extern struct { dev: dev_t, __pad1: [3]c_int, ino: ino_t, mode: mode_t, nlink: nlink_t, uid: uid_t, gid: gid_t, rdev: dev_t, __pad2: [2]c_uint, size: off_t, __pad3: c_int, atim: struct_timespec, mtim: struct_timespec, ctim: struct_timespec, blksize: blksize_t, __pad4: c_uint, blocks: blkcnt_t, __pad5: [14]c_int }, |
| | 2877 | .powerpc64, .powerpc64le => extern struct { dev: dev_t, ino: ino_t, nlink: nlink_t, mode: mode_t, uid: uid_t, gid: gid_t, rdev: dev_t, size: off_t, blksize: blksize_t, blocks: blkcnt_t, atim: struct_timespec, mtim: struct_timespec, ctim: struct_timespec, __unused: [3]c_ulong }, |
| | 2878 | .s390x => extern struct { dev: dev_t, ino: ino_t, nlink: nlink_t, mode: mode_t, uid: uid_t, gid: gid_t, rdev: dev_t, size: off_t, atim: struct_timespec, mtim: struct_timespec, ctim: struct_timespec, blksize: blksize_t, blocks: blkcnt_t, __unused: [3]c_ulong }, |
| | 2879 | .x86_64 => extern struct { dev: dev_t, ino: ino_t, nlink: nlink_t, mode: mode_t, uid: uid_t, gid: gid_t, __pad0: c_uint, rdev: dev_t, size: off_t, blksize: blksize_t, blocks: blkcnt_t, atim: struct_timespec, mtim: struct_timespec, ctim: struct_timespec, __unused: [3]c_long }, |
| | 2880 | // generic |
| | 2881 | .aarch64, |
| | 2882 | .riscv64, |
| | 2883 | => extern struct { dev: dev_t, ino: ino_t, mode: mode_t, nlink: nlink_t, uid: uid_t, gid: gid_t, rdev: dev_t, __pad: c_ulonglong, size: off_t, blksize: blksize_t, __pad2: c_int, blocks: blkcnt_t, atim: struct_timespec, mtim: struct_timespec, ctim: struct_timespec, __unused: [2]c_uint }, |
| | 2884 | else => unreachable, |
| | 2885 | }; |
| 2863 | pub const struct_iovec = extern struct { base: [*]u8, len: usize }; | 2886 | pub const struct_iovec = extern struct { base: [*]u8, len: usize }; |
| 2864 | pub const in_addr_t = u32; | 2887 | pub const in_addr_t = u32; |
| 2865 | pub const in_port_t = u16; | 2888 | pub const in_port_t = u16; |