| ... | ... | @@ -5,6 +5,7 @@ const arch = builtin.target.cpu.arch; |
| 5 | 5 | |
| 6 | 6 | comptime { |
| 7 | 7 | std.debug.assert(builtin.target.os.tag == .linux); |
| 8 | std.debug.assert(@bitSizeOf(usize) == 64); |
| 8 | 9 | } |
| 9 | 10 | |
| 10 | 11 | pub const errno = struct { |
| ... | ... | @@ -146,6 +147,7 @@ pub const errno = struct { |
| 146 | 147 | |
| 147 | 148 | pub const Enum = switch (builtin.target.cpu.arch) { |
| 148 | 149 | .arc, |
| 150 | .arceb, |
| 149 | 151 | .arm, |
| 150 | 152 | .armeb, |
| 151 | 153 | .aarch64, |
| ... | ... | @@ -156,13 +158,17 @@ pub const errno = struct { |
| 156 | 158 | .loongarch64, |
| 157 | 159 | .m68k, |
| 158 | 160 | .riscv32, |
| 161 | .riscv32be, |
| 159 | 162 | .riscv64, |
| 163 | .riscv64be, |
| 160 | 164 | .s390x, |
| 161 | 165 | .sparc, |
| 162 | 166 | .sparc64, |
| 167 | .x86_16, |
| 163 | 168 | .x86, |
| 164 | 169 | .x86_64, |
| 165 | 170 | .xtensa, |
| 171 | .xtensaeb, |
| 166 | 172 | => enum(c_ushort) { |
| 167 | 173 | EPERM = 1, |
| 168 | 174 | ENOENT = 2, |
| ... | ... | @@ -856,12 +862,12 @@ pub const errno = struct { |
| 856 | 862 | pub const EWOULDBLOCK: Enum = .EAGAIN; |
| 857 | 863 | pub const ENOTSUP: Enum = .EOPNOTSUPP; |
| 858 | 864 | }, |
| 859 | | // alpha |
| 865 | .alpha => unreachable, |
| 866 | .microblaze, .microblazeel => unreachable, |
| 867 | .sh, .sheb => unreachable, |
| 860 | 868 | // nios2 |
| 861 | | // microblaze |
| 862 | 869 | // openrisc |
| 863 | 870 | // parisc |
| 864 | | // sh |
| 865 | 871 | // um |
| 866 | 872 | // @compileError("TODO: " ++ @tagName(v)), |
| 867 | 873 | .avr, |
| ... | ... | @@ -883,6 +889,9 @@ pub const errno = struct { |
| 883 | 889 | .wasm64, |
| 884 | 890 | .ve, |
| 885 | 891 | .or1k, |
| 892 | .hppa, |
| 893 | .hppa64, |
| 894 | .kvx, |
| 886 | 895 | => unreachable, |
| 887 | 896 | }; |
| 888 | 897 | |
| ... | ... | @@ -2857,9 +2866,23 @@ pub const struct_timeval = linux.timeval; |
| 2857 | 2866 | pub const DIR = opaque {}; |
| 2858 | 2867 | pub const time_t = i64; |
| 2859 | 2868 | pub const div_t = extern struct { quot: c_int, rem: c_int }; |
| 2860 | | pub const off_t = linux.off_t; |
| 2861 | | pub const ino_t = linux.ino_t; |
| 2862 | | pub const struct_stat = linux.Stat; |
| 2869 | pub const off_t = i64; |
| 2870 | pub const ino_t = u64; |
| 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 | 2886 | pub const struct_iovec = extern struct { base: [*]u8, len: usize }; |
| 2864 | 2887 | pub const in_addr_t = u32; |
| 2865 | 2888 | pub const in_port_t = u16; |