| author | |
| committer | |
| log | 9f3165540ed0e2b1fec0ab2eb16d4c06d899c86a |
| tree | c452568f46d251765d42d7db3d3b2d8471eae787 |
| parent | 3da6043e2c3fa657cc7261e8cffdf3564c02dda9 |
Introduces type safety to this constant. Eliminates one use of
`usingnamespace`.20 files changed, 147 insertions(+), 155 deletions(-)
lib/std/Thread.zig+1-1| ... | @@ -1237,7 +1237,7 @@ const LinuxThreadImpl = struct { | ... | @@ -1237,7 +1237,7 @@ const LinuxThreadImpl = struct { |
| 1237 | null, | 1237 | null, |
| 1238 | map_bytes, | 1238 | map_bytes, |
| 1239 | os.PROT.NONE, | 1239 | os.PROT.NONE, |
| 1240 | os.MAP.PRIVATE | os.MAP.ANONYMOUS, | 1240 | .{ .TYPE = .PRIVATE, .ANONYMOUS = true }, |
| 1241 | -1, | 1241 | -1, |
| 1242 | 0, | 1242 | 0, |
| 1243 | ) catch |err| switch (err) { | 1243 | ) catch |err| switch (err) { |
lib/std/crypto/tlcsprng.zig+1-1| ... | @@ -83,7 +83,7 @@ fn tlsCsprngFill(_: *anyopaque, buffer: []u8) void { | ... | @@ -83,7 +83,7 @@ fn tlsCsprngFill(_: *anyopaque, buffer: []u8) void { |
| 83 | null, | 83 | null, |
| 84 | @sizeOf(Context), | 84 | @sizeOf(Context), |
| 85 | os.PROT.READ | os.PROT.WRITE, | 85 | os.PROT.READ | os.PROT.WRITE, |
| 86 | os.MAP.PRIVATE | os.MAP.ANONYMOUS, | 86 | .{ .TYPE = .PRIVATE, .ANONYMOUS = true }, |
| 87 | -1, | 87 | -1, |
| 88 | 0, | 88 | 0, |
| 89 | ) catch { | 89 | ) catch { |
lib/std/debug.zig+1-1| ... | @@ -1652,7 +1652,7 @@ fn mapWholeFile(file: File) ![]align(mem.page_size) const u8 { | ... | @@ -1652,7 +1652,7 @@ fn mapWholeFile(file: File) ![]align(mem.page_size) const u8 { |
| 1652 | null, | 1652 | null, |
| 1653 | file_len, | 1653 | file_len, |
| 1654 | os.PROT.READ, | 1654 | os.PROT.READ, |
| 1655 | os.MAP.SHARED, | 1655 | .{ .TYPE = .SHARED }, |
| 1656 | file.handle, | 1656 | file.handle, |
| 1657 | 0, | 1657 | 0, |
| 1658 | ); | 1658 | ); |
lib/std/dynamic_library.zig+4-4| ... | @@ -127,7 +127,7 @@ pub const ElfDynLib = struct { | ... | @@ -127,7 +127,7 @@ pub const ElfDynLib = struct { |
| 127 | null, | 127 | null, |
| 128 | mem.alignForward(usize, size, mem.page_size), | 128 | mem.alignForward(usize, size, mem.page_size), |
| 129 | os.PROT.READ, | 129 | os.PROT.READ, |
| 130 | os.MAP.PRIVATE, | 130 | .{ .TYPE = .PRIVATE }, |
| 131 | fd, | 131 | fd, |
| 132 | 0, | 132 | 0, |
| 133 | ); | 133 | ); |
| ... | @@ -165,7 +165,7 @@ pub const ElfDynLib = struct { | ... | @@ -165,7 +165,7 @@ pub const ElfDynLib = struct { |
| 165 | null, | 165 | null, |
| 166 | virt_addr_end, | 166 | virt_addr_end, |
| 167 | os.PROT.NONE, | 167 | os.PROT.NONE, |
| 168 | os.MAP.PRIVATE | os.MAP.ANONYMOUS, | 168 | .{ .TYPE = .PRIVATE, .ANONYMOUS = true }, |
| 169 | -1, | 169 | -1, |
| 170 | 0, | 170 | 0, |
| 171 | ); | 171 | ); |
| ... | @@ -197,7 +197,7 @@ pub const ElfDynLib = struct { | ... | @@ -197,7 +197,7 @@ pub const ElfDynLib = struct { |
| 197 | ptr, | 197 | ptr, |
| 198 | extended_memsz, | 198 | extended_memsz, |
| 199 | prot, | 199 | prot, |
| 200 | os.MAP.PRIVATE | os.MAP.FIXED, | 200 | .{ .TYPE = .PRIVATE, .FIXED = true }, |
| 201 | fd, | 201 | fd, |
| 202 | ph.p_offset - extra_bytes, | 202 | ph.p_offset - extra_bytes, |
| 203 | ); | 203 | ); |
| ... | @@ -206,7 +206,7 @@ pub const ElfDynLib = struct { | ... | @@ -206,7 +206,7 @@ pub const ElfDynLib = struct { |
| 206 | ptr, | 206 | ptr, |
| 207 | extended_memsz, | 207 | extended_memsz, |
| 208 | prot, | 208 | prot, |
| 209 | os.MAP.PRIVATE | os.MAP.FIXED | os.MAP.ANONYMOUS, | 209 | .{ .TYPE = .PRIVATE, .FIXED = true, .ANONYMOUS = true }, |
| 210 | -1, | 210 | -1, |
| 211 | 0, | 211 | 0, |
| 212 | ); | 212 | ); |
lib/std/heap/PageAllocator.zig+1-1| ... | @@ -35,7 +35,7 @@ fn alloc(_: *anyopaque, n: usize, log2_align: u8, ra: usize) ?[*]u8 { | ... | @@ -35,7 +35,7 @@ fn alloc(_: *anyopaque, n: usize, log2_align: u8, ra: usize) ?[*]u8 { |
| 35 | hint, | 35 | hint, |
| 36 | aligned_len, | 36 | aligned_len, |
| 37 | os.PROT.READ | os.PROT.WRITE, | 37 | os.PROT.READ | os.PROT.WRITE, |
| 38 | os.MAP.PRIVATE | os.MAP.ANONYMOUS, | 38 | .{ .TYPE = .PRIVATE, .ANONYMOUS = true }, |
| 39 | -1, | 39 | -1, |
| 40 | 0, | 40 | 0, |
| 41 | ) catch return null; | 41 | ) catch return null; |
lib/std/os.zig+3-3| ... | @@ -4657,14 +4657,14 @@ pub fn mmap( | ... | @@ -4657,14 +4657,14 @@ pub fn mmap( |
| 4657 | ptr: ?[*]align(mem.page_size) u8, | 4657 | ptr: ?[*]align(mem.page_size) u8, |
| 4658 | length: usize, | 4658 | length: usize, |
| 4659 | prot: u32, | 4659 | prot: u32, |
| 4660 | flags: u32, | 4660 | flags: system.MAP, |
| 4661 | fd: fd_t, | 4661 | fd: fd_t, |
| 4662 | offset: u64, | 4662 | offset: u64, |
| 4663 | ) MMapError![]align(mem.page_size) u8 { | 4663 | ) MMapError![]align(mem.page_size) u8 { |
| 4664 | const mmap_sym = if (lfs64_abi) system.mmap64 else system.mmap; | 4664 | const mmap_sym = if (lfs64_abi) system.mmap64 else system.mmap; |
| 4665 | 4665 | ||
| 4666 | const ioffset = @as(i64, @bitCast(offset)); // the OS treats this as unsigned | 4666 | const ioffset: i64 = @bitCast(offset); // the OS treats this as unsigned |
| 4667 | const rc = mmap_sym(ptr, length, prot, flags, fd, ioffset); | 4667 | const rc = mmap_sym(ptr, length, prot, @bitCast(flags), fd, ioffset); |
| 4668 | const err = if (builtin.link_libc) blk: { | 4668 | const err = if (builtin.link_libc) blk: { |
| 4669 | if (rc != std.c.MAP.FAILED) return @as([*]align(mem.page_size) u8, @ptrCast(@alignCast(rc)))[0..length]; | 4669 | if (rc != std.c.MAP.FAILED) return @as([*]align(mem.page_size) u8, @ptrCast(@alignCast(rc)))[0..length]; |
| 4670 | break :blk @as(E, @enumFromInt(system._errno().*)); | 4670 | break :blk @as(E, @enumFromInt(system._errno().*)); |
lib/std/os/linux.zig+130-30| ... | @@ -109,36 +109,136 @@ pub const SYS = switch (@import("builtin").cpu.arch) { | ... | @@ -109,36 +109,136 @@ pub const SYS = switch (@import("builtin").cpu.arch) { |
| 109 | else => @compileError("The Zig Standard Library is missing syscall definitions for the target CPU architecture"), | 109 | else => @compileError("The Zig Standard Library is missing syscall definitions for the target CPU architecture"), |
| 110 | }; | 110 | }; |
| 111 | 111 | ||
| 112 | pub const MAP = struct { | 112 | pub const MAP_TYPE = enum(u4) { |
| 113 | pub usingnamespace arch_bits.MAP; | 113 | SHARED = 0x01, |
| 114 | 114 | PRIVATE = 0x02, | |
| 115 | /// Share changes | 115 | SHARED_VALIDATE = 0x03, |
| 116 | pub const SHARED = 0x01; | 116 | }; |
| 117 | /// Changes are private | 117 | |
| 118 | pub const PRIVATE = 0x02; | 118 | pub const MAP = switch (native_arch) { |
| 119 | /// share + validate extension flags | 119 | .x86_64, .x86 => packed struct(u32) { |
| 120 | pub const SHARED_VALIDATE = 0x03; | 120 | TYPE: MAP_TYPE, |
| 121 | /// Mask for type of mapping | 121 | FIXED: bool = false, |
| 122 | pub const TYPE = 0x0f; | 122 | ANONYMOUS: bool = false, |
| 123 | /// Interpret addr exactly | 123 | @"32BIT": bool = false, |
| 124 | pub const FIXED = 0x10; | 124 | _7: u1 = 0, |
| 125 | /// don't use a file | 125 | GROWSDOWN: bool = false, |
| 126 | pub const ANONYMOUS = if (is_mips) 0x800 else 0x20; | 126 | _9: u2 = 0, |
| 127 | // MAP_ 0x0100 - 0x4000 flags are per architecture | 127 | DENYWRITE: bool = false, |
| 128 | /// populate (prefault) pagetables | 128 | EXECUTABLE: bool = false, |
| 129 | pub const POPULATE = if (is_mips) 0x10000 else 0x8000; | 129 | LOCKED: bool = false, |
| 130 | /// do not block on IO | 130 | NORESERVE: bool = false, |
| 131 | pub const NONBLOCK = if (is_mips) 0x20000 else 0x10000; | 131 | POPULATE: bool = false, |
| 132 | /// give out an address that is best suited for process/thread stacks | 132 | NONBLOCK: bool = false, |
| 133 | pub const STACK = if (is_mips) 0x40000 else 0x20000; | 133 | STACK: bool = false, |
| 134 | /// create a huge page mapping | 134 | HUGETLB: bool = false, |
| 135 | pub const HUGETLB = if (is_mips) 0x80000 else 0x40000; | 135 | SYNC: bool = false, |
| 136 | /// perform synchronous page faults for the mapping | 136 | FIXED_NOREPLACE: bool = false, |
| 137 | pub const SYNC = 0x80000; | 137 | _21: u5 = 0, |
| 138 | /// MAP_FIXED which doesn't unmap underlying mapping | 138 | UNINITIALIZED: bool = false, |
| 139 | pub const FIXED_NOREPLACE = 0x100000; | 139 | _: u5 = 0, |
| 140 | /// For anonymous mmap, memory could be uninitialized | 140 | }, |
| 141 | pub const UNINITIALIZED = 0x4000000; | 141 | .aarch64, .aarch64_be, .arm, .thumb => packed struct(u32) { |
| 142 | TYPE: MAP_TYPE, | ||
| 143 | FIXED: bool = false, | ||
| 144 | ANONYMOUS: bool = false, | ||
| 145 | _6: u2 = 0, | ||
| 146 | GROWSDOWN: bool = false, | ||
| 147 | _9: u2 = 0, | ||
| 148 | DENYWRITE: bool = false, | ||
| 149 | EXECUTABLE: bool = false, | ||
| 150 | LOCKED: bool = false, | ||
| 151 | NORESERVE: bool = false, | ||
| 152 | POPULATE: bool = false, | ||
| 153 | NONBLOCK: bool = false, | ||
| 154 | STACK: bool = false, | ||
| 155 | HUGETLB: bool = false, | ||
| 156 | SYNC: bool = false, | ||
| 157 | FIXED_NOREPLACE: bool = false, | ||
| 158 | _21: u5 = 0, | ||
| 159 | UNINITIALIZED: bool = false, | ||
| 160 | _: u5 = 0, | ||
| 161 | }, | ||
| 162 | .riscv64 => packed struct(u32) { | ||
| 163 | TYPE: MAP_TYPE, | ||
| 164 | FIXED: bool = false, | ||
| 165 | ANONYMOUS: bool = false, | ||
| 166 | _6: u9 = 0, | ||
| 167 | POPULATE: bool = false, | ||
| 168 | NONBLOCK: bool = false, | ||
| 169 | STACK: bool = false, | ||
| 170 | HUGETLB: bool = false, | ||
| 171 | SYNC: bool = false, | ||
| 172 | FIXED_NOREPLACE: bool = false, | ||
| 173 | _21: u5 = 0, | ||
| 174 | UNINITIALIZED: bool = false, | ||
| 175 | _: u5 = 0, | ||
| 176 | }, | ||
| 177 | .sparc64 => packed struct(u32) { | ||
| 178 | TYPE: MAP_TYPE, | ||
| 179 | FIXED: bool = false, | ||
| 180 | ANONYMOUS: bool = false, | ||
| 181 | NORESERVE: bool = false, | ||
| 182 | _7: u1 = 0, | ||
| 183 | LOCKED: bool = false, | ||
| 184 | GROWSDOWN: bool = false, | ||
| 185 | _10: u1 = 0, | ||
| 186 | DENYWRITE: bool = false, | ||
| 187 | EXECUTABLE: bool = false, | ||
| 188 | _13: u2 = 0, | ||
| 189 | POPULATE: bool = false, | ||
| 190 | NONBLOCK: bool = false, | ||
| 191 | STACK: bool = false, | ||
| 192 | HUGETLB: bool = false, | ||
| 193 | SYNC: bool = false, | ||
| 194 | FIXED_NOREPLACE: bool = false, | ||
| 195 | _21: u5 = 0, | ||
| 196 | UNINITIALIZED: bool = false, | ||
| 197 | _: u5 = 0, | ||
| 198 | }, | ||
| 199 | .mips, .mipsel, .mips64, .mips64el => packed struct(u32) { | ||
| 200 | TYPE: MAP_TYPE, | ||
| 201 | FIXED: bool = false, | ||
| 202 | _5: u1 = 0, | ||
| 203 | @"32BIT": bool = false, | ||
| 204 | _7: u3 = 0, | ||
| 205 | NORESERVE: bool = false, | ||
| 206 | ANONYMOUS: bool = false, | ||
| 207 | GROWSDOWN: bool = false, | ||
| 208 | DENYWRITE: bool = false, | ||
| 209 | EXECUTABLE: bool = false, | ||
| 210 | LOCKED: bool = false, | ||
| 211 | POPULATE: bool = false, | ||
| 212 | NONBLOCK: bool = false, | ||
| 213 | STACK: bool = false, | ||
| 214 | HUGETLB: bool = false, | ||
| 215 | FIXED_NOREPLACE: bool = false, | ||
| 216 | _21: u5 = 0, | ||
| 217 | UNINITIALIZED: bool = false, | ||
| 218 | _: u5 = 0, | ||
| 219 | }, | ||
| 220 | .powerpc, .powerpcle, .powerpc64, .powerpc64le => packed struct(u32) { | ||
| 221 | TYPE: MAP_TYPE, | ||
| 222 | FIXED: bool = false, | ||
| 223 | ANONYMOUS: bool = false, | ||
| 224 | NORESERVE: bool = false, | ||
| 225 | LOCKED: bool = false, | ||
| 226 | GROWSDOWN: bool = false, | ||
| 227 | _9: u2 = 0, | ||
| 228 | DENYWRITE: bool = false, | ||
| 229 | EXECUTABLE: bool = false, | ||
| 230 | _13: u2 = 0, | ||
| 231 | POPULATE: bool = false, | ||
| 232 | NONBLOCK: bool = false, | ||
| 233 | STACK: bool = false, | ||
| 234 | HUGETLB: bool = false, | ||
| 235 | SYNC: bool = false, | ||
| 236 | FIXED_NOREPLACE: bool = false, | ||
| 237 | _21: u5 = 0, | ||
| 238 | UNINITIALIZED: bool = false, | ||
| 239 | _: u5 = 0, | ||
| 240 | }, | ||
| 241 | else => @compileError("missing std.os.linux.MAP constants for this architecture"), | ||
| 142 | }; | 242 | }; |
| 143 | 243 | ||
| 144 | pub const O = struct { | 244 | pub const O = struct { |
lib/std/os/linux/arm-eabi.zig-13| ... | @@ -197,19 +197,6 @@ pub const LOCK = struct { | ... | @@ -197,19 +197,6 @@ pub const LOCK = struct { |
| 197 | pub const NB = 4; | 197 | pub const NB = 4; |
| 198 | }; | 198 | }; |
| 199 | 199 | ||
| 200 | pub const MAP = struct { | ||
| 201 | /// stack-like segment | ||
| 202 | pub const GROWSDOWN = 0x0100; | ||
| 203 | /// ETXTBSY | ||
| 204 | pub const DENYWRITE = 0x0800; | ||
| 205 | /// mark it as an executable | ||
| 206 | pub const EXECUTABLE = 0x1000; | ||
| 207 | /// pages are locked | ||
| 208 | pub const LOCKED = 0x2000; | ||
| 209 | /// don't check for reservations | ||
| 210 | pub const NORESERVE = 0x4000; | ||
| 211 | }; | ||
| 212 | |||
| 213 | pub const VDSO = struct { | 200 | pub const VDSO = struct { |
| 214 | pub const CGT_SYM = "__vdso_clock_gettime"; | 201 | pub const CGT_SYM = "__vdso_clock_gettime"; |
| 215 | pub const CGT_VER = "LINUX_2.6"; | 202 | pub const CGT_VER = "LINUX_2.6"; |
lib/std/os/linux/arm64.zig-13| ... | @@ -179,19 +179,6 @@ pub const LOCK = struct { | ... | @@ -179,19 +179,6 @@ pub const LOCK = struct { |
| 179 | pub const NB = 4; | 179 | pub const NB = 4; |
| 180 | }; | 180 | }; |
| 181 | 181 | ||
| 182 | pub const MAP = struct { | ||
| 183 | /// stack-like segment | ||
| 184 | pub const GROWSDOWN = 0x0100; | ||
| 185 | /// ETXTBSY | ||
| 186 | pub const DENYWRITE = 0x0800; | ||
| 187 | /// mark it as an executable | ||
| 188 | pub const EXECUTABLE = 0x1000; | ||
| 189 | /// pages are locked | ||
| 190 | pub const LOCKED = 0x2000; | ||
| 191 | /// don't check for reservations | ||
| 192 | pub const NORESERVE = 0x4000; | ||
| 193 | }; | ||
| 194 | |||
| 195 | pub const VDSO = struct { | 182 | pub const VDSO = struct { |
| 196 | pub const CGT_SYM = "__kernel_clock_gettime"; | 183 | pub const CGT_SYM = "__kernel_clock_gettime"; |
| 197 | pub const CGT_VER = "LINUX_2.6.39"; | 184 | pub const CGT_VER = "LINUX_2.6.39"; |
lib/std/os/linux/io_uring.zig+2-2| ... | @@ -1344,7 +1344,7 @@ pub const SubmissionQueue = struct { | ... | @@ -1344,7 +1344,7 @@ pub const SubmissionQueue = struct { |
| 1344 | null, | 1344 | null, |
| 1345 | size, | 1345 | size, |
| 1346 | os.PROT.READ | os.PROT.WRITE, | 1346 | os.PROT.READ | os.PROT.WRITE, |
| 1347 | os.MAP.SHARED | os.MAP.POPULATE, | 1347 | .{ .TYPE = .SHARED, .POPULATE = true }, |
| 1348 | fd, | 1348 | fd, |
| 1349 | linux.IORING_OFF_SQ_RING, | 1349 | linux.IORING_OFF_SQ_RING, |
| 1350 | ); | 1350 | ); |
| ... | @@ -1358,7 +1358,7 @@ pub const SubmissionQueue = struct { | ... | @@ -1358,7 +1358,7 @@ pub const SubmissionQueue = struct { |
| 1358 | null, | 1358 | null, |
| 1359 | size_sqes, | 1359 | size_sqes, |
| 1360 | os.PROT.READ | os.PROT.WRITE, | 1360 | os.PROT.READ | os.PROT.WRITE, |
| 1361 | os.MAP.SHARED | os.MAP.POPULATE, | 1361 | .{ .TYPE = .SHARED, .POPULATE = true }, |
| 1362 | fd, | 1362 | fd, |
| 1363 | linux.IORING_OFF_SQES, | 1363 | linux.IORING_OFF_SQES, |
| 1364 | ); | 1364 | ); |
lib/std/os/linux/mips.zig-9| ... | @@ -271,15 +271,6 @@ pub const LOCK = struct { | ... | @@ -271,15 +271,6 @@ pub const LOCK = struct { |
| 271 | 271 | ||
| 272 | pub const MMAP2_UNIT = 4096; | 272 | pub const MMAP2_UNIT = 4096; |
| 273 | 273 | ||
| 274 | pub const MAP = struct { | ||
| 275 | pub const NORESERVE = 0x0400; | ||
| 276 | pub const GROWSDOWN = 0x1000; | ||
| 277 | pub const DENYWRITE = 0x2000; | ||
| 278 | pub const EXECUTABLE = 0x4000; | ||
| 279 | pub const LOCKED = 0x8000; | ||
| 280 | pub const @"32BIT" = 0x40; | ||
| 281 | }; | ||
| 282 | |||
| 283 | pub const VDSO = struct { | 274 | pub const VDSO = struct { |
| 284 | pub const CGT_SYM = "__kernel_clock_gettime"; | 275 | pub const CGT_SYM = "__kernel_clock_gettime"; |
| 285 | pub const CGT_VER = "LINUX_2.6.39"; | 276 | pub const CGT_VER = "LINUX_2.6.39"; |
lib/std/os/linux/mips64.zig-9| ... | @@ -256,15 +256,6 @@ pub const LOCK = struct { | ... | @@ -256,15 +256,6 @@ pub const LOCK = struct { |
| 256 | 256 | ||
| 257 | pub const MMAP2_UNIT = 4096; | 257 | pub const MMAP2_UNIT = 4096; |
| 258 | 258 | ||
| 259 | pub const MAP = struct { | ||
| 260 | pub const NORESERVE = 0x0400; | ||
| 261 | pub const GROWSDOWN = 0x1000; | ||
| 262 | pub const DENYWRITE = 0x2000; | ||
| 263 | pub const EXECUTABLE = 0x4000; | ||
| 264 | pub const LOCKED = 0x8000; | ||
| 265 | pub const @"32BIT" = 0x40; | ||
| 266 | }; | ||
| 267 | |||
| 268 | pub const VDSO = struct { | 259 | pub const VDSO = struct { |
| 269 | pub const CGT_SYM = "__kernel_clock_gettime"; | 260 | pub const CGT_SYM = "__kernel_clock_gettime"; |
| 270 | pub const CGT_VER = "LINUX_2.6.39"; | 261 | pub const CGT_VER = "LINUX_2.6.39"; |
lib/std/os/linux/powerpc.zig-13| ... | @@ -198,19 +198,6 @@ pub const LOCK = struct { | ... | @@ -198,19 +198,6 @@ pub const LOCK = struct { |
| 198 | pub const NB = 4; | 198 | pub const NB = 4; |
| 199 | }; | 199 | }; |
| 200 | 200 | ||
| 201 | pub const MAP = struct { | ||
| 202 | /// stack-like segment | ||
| 203 | pub const GROWSDOWN = 0x0100; | ||
| 204 | /// ETXTBSY | ||
| 205 | pub const DENYWRITE = 0x0800; | ||
| 206 | /// mark it as an executable | ||
| 207 | pub const EXECUTABLE = 0x1000; | ||
| 208 | /// pages are locked | ||
| 209 | pub const LOCKED = 0x0080; | ||
| 210 | /// don't check for reservations | ||
| 211 | pub const NORESERVE = 0x0040; | ||
| 212 | }; | ||
| 213 | |||
| 214 | pub const VDSO = struct { | 201 | pub const VDSO = struct { |
| 215 | pub const CGT_SYM = "__kernel_clock_gettime"; | 202 | pub const CGT_SYM = "__kernel_clock_gettime"; |
| 216 | pub const CGT_VER = "LINUX_2.6.15"; | 203 | pub const CGT_VER = "LINUX_2.6.15"; |
lib/std/os/linux/powerpc64.zig-13| ... | @@ -198,19 +198,6 @@ pub const LOCK = struct { | ... | @@ -198,19 +198,6 @@ pub const LOCK = struct { |
| 198 | pub const NB = 4; | 198 | pub const NB = 4; |
| 199 | }; | 199 | }; |
| 200 | 200 | ||
| 201 | pub const MAP = struct { | ||
| 202 | /// stack-like segment | ||
| 203 | pub const GROWSDOWN = 0x0100; | ||
| 204 | /// ETXTBSY | ||
| 205 | pub const DENYWRITE = 0x0800; | ||
| 206 | /// mark it as an executable | ||
| 207 | pub const EXECUTABLE = 0x1000; | ||
| 208 | /// pages are locked | ||
| 209 | pub const LOCKED = 0x0080; | ||
| 210 | /// don't check for reservations | ||
| 211 | pub const NORESERVE = 0x0040; | ||
| 212 | }; | ||
| 213 | |||
| 214 | pub const VDSO = struct { | 201 | pub const VDSO = struct { |
| 215 | pub const CGT_SYM = "__kernel_clock_gettime"; | 202 | pub const CGT_SYM = "__kernel_clock_gettime"; |
| 216 | pub const CGT_VER = "LINUX_2.6.15"; | 203 | pub const CGT_VER = "LINUX_2.6.15"; |
lib/std/os/linux/riscv64.zig-1| ... | @@ -246,4 +246,3 @@ pub const Stat = extern struct { | ... | @@ -246,4 +246,3 @@ pub const Stat = extern struct { |
| 246 | pub const Elf_Symndx = u32; | 246 | pub const Elf_Symndx = u32; |
| 247 | 247 | ||
| 248 | pub const VDSO = struct {}; | 248 | pub const VDSO = struct {}; |
| 249 | pub const MAP = struct {}; |
lib/std/os/linux/sparc64.zig-13| ... | @@ -248,19 +248,6 @@ pub const LOCK = struct { | ... | @@ -248,19 +248,6 @@ pub const LOCK = struct { |
| 248 | pub const UN = 8; | 248 | pub const UN = 8; |
| 249 | }; | 249 | }; |
| 250 | 250 | ||
| 251 | pub const MAP = struct { | ||
| 252 | /// stack-like segment | ||
| 253 | pub const GROWSDOWN = 0x0200; | ||
| 254 | /// ETXTBSY | ||
| 255 | pub const DENYWRITE = 0x0800; | ||
| 256 | /// mark it as an executable | ||
| 257 | pub const EXECUTABLE = 0x1000; | ||
| 258 | /// pages are locked | ||
| 259 | pub const LOCKED = 0x0100; | ||
| 260 | /// don't check for reservations | ||
| 261 | pub const NORESERVE = 0x0040; | ||
| 262 | }; | ||
| 263 | |||
| 264 | pub const VDSO = struct { | 251 | pub const VDSO = struct { |
| 265 | pub const CGT_SYM = "__vdso_clock_gettime"; | 252 | pub const CGT_SYM = "__vdso_clock_gettime"; |
| 266 | pub const CGT_VER = "LINUX_2.6"; | 253 | pub const CGT_VER = "LINUX_2.6"; |
lib/std/os/linux/tls.zig+1-1| ... | @@ -324,7 +324,7 @@ pub fn initStaticTLS(phdrs: []elf.Phdr) void { | ... | @@ -324,7 +324,7 @@ pub fn initStaticTLS(phdrs: []elf.Phdr) void { |
| 324 | null, | 324 | null, |
| 325 | tls_image.alloc_size + tls_image.alloc_align - 1, | 325 | tls_image.alloc_size + tls_image.alloc_align - 1, |
| 326 | os.PROT.READ | os.PROT.WRITE, | 326 | os.PROT.READ | os.PROT.WRITE, |
| 327 | os.MAP.PRIVATE | os.MAP.ANONYMOUS, | 327 | .{ .TYPE = .PRIVATE, .ANONYMOUS = true }, |
| 328 | -1, | 328 | -1, |
| 329 | 0, | 329 | 0, |
| 330 | ) catch os.abort(); | 330 | ) catch os.abort(); |
lib/std/os/linux/x86.zig-9| ... | @@ -211,15 +211,6 @@ pub const LOCK = struct { | ... | @@ -211,15 +211,6 @@ pub const LOCK = struct { |
| 211 | pub const UN = 8; | 211 | pub const UN = 8; |
| 212 | }; | 212 | }; |
| 213 | 213 | ||
| 214 | pub const MAP = struct { | ||
| 215 | pub const NORESERVE = 0x4000; | ||
| 216 | pub const GROWSDOWN = 0x0100; | ||
| 217 | pub const DENYWRITE = 0x0800; | ||
| 218 | pub const EXECUTABLE = 0x1000; | ||
| 219 | pub const LOCKED = 0x2000; | ||
| 220 | pub const @"32BIT" = 0x40; | ||
| 221 | }; | ||
| 222 | |||
| 223 | pub const MMAP2_UNIT = 4096; | 214 | pub const MMAP2_UNIT = 4096; |
| 224 | 215 | ||
| 225 | pub const VDSO = struct { | 216 | pub const VDSO = struct { |
lib/std/os/linux/x86_64.zig-15| ... | @@ -177,21 +177,6 @@ pub const F = struct { | ... | @@ -177,21 +177,6 @@ pub const F = struct { |
| 177 | pub const UNLCK = 2; | 177 | pub const UNLCK = 2; |
| 178 | }; | 178 | }; |
| 179 | 179 | ||
| 180 | pub const MAP = struct { | ||
| 181 | /// only give out 32bit addresses | ||
| 182 | pub const @"32BIT" = 0x40; | ||
| 183 | /// stack-like segment | ||
| 184 | pub const GROWSDOWN = 0x0100; | ||
| 185 | /// ETXTBSY | ||
| 186 | pub const DENYWRITE = 0x0800; | ||
| 187 | /// mark it as an executable | ||
| 188 | pub const EXECUTABLE = 0x1000; | ||
| 189 | /// pages are locked | ||
| 190 | pub const LOCKED = 0x2000; | ||
| 191 | /// don't check for reservations | ||
| 192 | pub const NORESERVE = 0x4000; | ||
| 193 | }; | ||
| 194 | |||
| 195 | pub const VDSO = struct { | 180 | pub const VDSO = struct { |
| 196 | pub const CGT_SYM = "__vdso_clock_gettime"; | 181 | pub const CGT_SYM = "__vdso_clock_gettime"; |
| 197 | pub const CGT_VER = "LINUX_2.6"; | 182 | pub const CGT_VER = "LINUX_2.6"; |
lib/std/os/test.zig+3-3| ... | @@ -576,7 +576,7 @@ test "mmap" { | ... | @@ -576,7 +576,7 @@ test "mmap" { |
| 576 | null, | 576 | null, |
| 577 | 1234, | 577 | 1234, |
| 578 | os.PROT.READ | os.PROT.WRITE, | 578 | os.PROT.READ | os.PROT.WRITE, |
| 579 | os.MAP.ANONYMOUS | os.MAP.PRIVATE, | 579 | .{ .TYPE = .PRIVATE, .ANONYMOUS = true }, |
| 580 | -1, | 580 | -1, |
| 581 | 0, | 581 | 0, |
| 582 | ); | 582 | ); |
| ... | @@ -618,7 +618,7 @@ test "mmap" { | ... | @@ -618,7 +618,7 @@ test "mmap" { |
| 618 | null, | 618 | null, |
| 619 | alloc_size, | 619 | alloc_size, |
| 620 | os.PROT.READ, | 620 | os.PROT.READ, |
| 621 | os.MAP.PRIVATE, | 621 | .{ .TYPE = .PRIVATE }, |
| 622 | file.handle, | 622 | file.handle, |
| 623 | 0, | 623 | 0, |
| 624 | ); | 624 | ); |
| ... | @@ -642,7 +642,7 @@ test "mmap" { | ... | @@ -642,7 +642,7 @@ test "mmap" { |
| 642 | null, | 642 | null, |
| 643 | alloc_size / 2, | 643 | alloc_size / 2, |
| 644 | os.PROT.READ, | 644 | os.PROT.READ, |
| 645 | os.MAP.PRIVATE, | 645 | .{ .TYPE = .PRIVATE }, |
| 646 | file.handle, | 646 | file.handle, |
| 647 | alloc_size / 2, | 647 | alloc_size / 2, |
| 648 | ); | 648 | ); |