| author | |
| committer | |
| log | e197968734b2a0c1dd77034611361a121ecfc5ab |
| tree | 38789c1665ee843606533aaba00d96af40a1ca1f |
| parent | 7610d39413d45b5d72c532b2128a81d080fe342f |
| signature |
3 files changed, 83 insertions(+), 11 deletions(-)
std/os/bits/linux.zig+20-11| ... | @@ -74,22 +74,31 @@ pub const PROT_EXEC = 4; | ... | @@ -74,22 +74,31 @@ pub const PROT_EXEC = 4; |
| 74 | pub const PROT_GROWSDOWN = 0x01000000; | 74 | pub const PROT_GROWSDOWN = 0x01000000; |
| 75 | pub const PROT_GROWSUP = 0x02000000; | 75 | pub const PROT_GROWSUP = 0x02000000; |
| 76 | 76 | ||
| 77 | pub const MAP_FAILED = @intToPtr(*c_void, maxInt(usize)); | 77 | /// Share changes |
| 78 | pub const MAP_SHARED = 0x01; | 78 | pub const MAP_SHARED = 0x01; |
| 79 | |||
| 80 | /// Changes are private | ||
| 79 | pub const MAP_PRIVATE = 0x02; | 81 | pub const MAP_PRIVATE = 0x02; |
| 82 | |||
| 83 | /// share + validate extension flags | ||
| 84 | pub const MAP_SHARED_VALIDATE = 0x03; | ||
| 85 | |||
| 86 | /// Mask for type of mapping | ||
| 80 | pub const MAP_TYPE = 0x0f; | 87 | pub const MAP_TYPE = 0x0f; |
| 88 | |||
| 89 | /// Interpret addr exactly | ||
| 81 | pub const MAP_FIXED = 0x10; | 90 | pub const MAP_FIXED = 0x10; |
| 91 | |||
| 92 | /// don't use a file | ||
| 82 | pub const MAP_ANONYMOUS = 0x20; | 93 | pub const MAP_ANONYMOUS = 0x20; |
| 83 | pub const MAP_NORESERVE = 0x4000; | 94 | |
| 84 | pub const MAP_GROWSDOWN = 0x0100; | 95 | /// For anonymous mmap, memory could be uninitialized |
| 85 | pub const MAP_DENYWRITE = 0x0800; | 96 | pub const MAP_UNINITIALIZED = 0x4000000; |
| 86 | pub const MAP_EXECUTABLE = 0x1000; | 97 | |
| 87 | pub const MAP_LOCKED = 0x2000; | 98 | // MAP_ 0x0100 - 0x80000 flags are per architecture |
| 88 | pub const MAP_POPULATE = 0x8000; | 99 | |
| 89 | pub const MAP_NONBLOCK = 0x10000; | 100 | /// MAP_FIXED which doesn't unmap underlying mapping |
| 90 | pub const MAP_STACK = 0x20000; | 101 | pub const MAP_FIXED_NOREPLACE = 0x100000; |
| 91 | pub const MAP_HUGETLB = 0x40000; | ||
| 92 | pub const MAP_FILE = 0; | ||
| 93 | 102 | ||
| 94 | pub const F_OK = 0; | 103 | pub const F_OK = 0; |
| 95 | pub const X_OK = 1; | 104 | pub const X_OK = 1; |
std/os/bits/linux/arm64.zig+30| ... | @@ -331,6 +331,36 @@ pub const F_GETOWN_EX = 16; | ... | @@ -331,6 +331,36 @@ pub const F_GETOWN_EX = 16; |
| 331 | 331 | ||
| 332 | pub const F_GETOWNER_UIDS = 17; | 332 | pub const F_GETOWNER_UIDS = 17; |
| 333 | 333 | ||
| 334 | /// stack-like segment | ||
| 335 | pub const MAP_GROWSDOWN = 0x0100; | ||
| 336 | |||
| 337 | /// ETXTBSY | ||
| 338 | pub const MAP_DENYWRITE = 0x0800; | ||
| 339 | |||
| 340 | /// mark it as an executable | ||
| 341 | pub const MAP_EXECUTABLE = 0x1000; | ||
| 342 | |||
| 343 | /// pages are locked | ||
| 344 | pub const MAP_LOCKED = 0x2000; | ||
| 345 | |||
| 346 | /// don't check for reservations | ||
| 347 | pub const MAP_NORESERVE = 0x4000; | ||
| 348 | |||
| 349 | /// populate (prefault) pagetables | ||
| 350 | pub const MAP_POPULATE = 0x8000; | ||
| 351 | |||
| 352 | /// do not block on IO | ||
| 353 | pub const MAP_NONBLOCK = 0x10000; | ||
| 354 | |||
| 355 | /// give out an address that is best suited for process/thread stacks | ||
| 356 | pub const MAP_STACK = 0x20000; | ||
| 357 | |||
| 358 | /// create a huge page mapping | ||
| 359 | pub const MAP_HUGETLB = 0x40000; | ||
| 360 | |||
| 361 | /// perform synchronous page faults for the mapping | ||
| 362 | pub const MAP_SYNC = 0x80000; | ||
| 363 | |||
| 334 | pub const VDSO_USEFUL = true; | 364 | pub const VDSO_USEFUL = true; |
| 335 | pub const VDSO_CGT_SYM = "__kernel_clock_gettime"; | 365 | pub const VDSO_CGT_SYM = "__kernel_clock_gettime"; |
| 336 | pub const VDSO_CGT_VER = "LINUX_2.6.39"; | 366 | pub const VDSO_CGT_VER = "LINUX_2.6.39"; |
std/os/bits/linux/x86_64.zig+33| ... | @@ -394,6 +394,39 @@ pub const F_GETOWN_EX = 16; | ... | @@ -394,6 +394,39 @@ pub const F_GETOWN_EX = 16; |
| 394 | 394 | ||
| 395 | pub const F_GETOWNER_UIDS = 17; | 395 | pub const F_GETOWNER_UIDS = 17; |
| 396 | 396 | ||
| 397 | /// only give out 32bit addresses | ||
| 398 | pub const MAP_32BIT = 0x40; | ||
| 399 | |||
| 400 | /// stack-like segment | ||
| 401 | pub const MAP_GROWSDOWN = 0x0100; | ||
| 402 | |||
| 403 | /// ETXTBSY | ||
| 404 | pub const MAP_DENYWRITE = 0x0800; | ||
| 405 | |||
| 406 | /// mark it as an executable | ||
| 407 | pub const MAP_EXECUTABLE = 0x1000; | ||
| 408 | |||
| 409 | /// pages are locked | ||
| 410 | pub const MAP_LOCKED = 0x2000; | ||
| 411 | |||
| 412 | /// don't check for reservations | ||
| 413 | pub const MAP_NORESERVE = 0x4000; | ||
| 414 | |||
| 415 | /// populate (prefault) pagetables | ||
| 416 | pub const MAP_POPULATE = 0x8000; | ||
| 417 | |||
| 418 | /// do not block on IO | ||
| 419 | pub const MAP_NONBLOCK = 0x10000; | ||
| 420 | |||
| 421 | /// give out an address that is best suited for process/thread stacks | ||
| 422 | pub const MAP_STACK = 0x20000; | ||
| 423 | |||
| 424 | /// create a huge page mapping | ||
| 425 | pub const MAP_HUGETLB = 0x40000; | ||
| 426 | |||
| 427 | /// perform synchronous page faults for the mapping | ||
| 428 | pub const MAP_SYNC = 0x80000; | ||
| 429 | |||
| 397 | pub const VDSO_USEFUL = true; | 430 | pub const VDSO_USEFUL = true; |
| 398 | pub const VDSO_CGT_SYM = "__vdso_clock_gettime"; | 431 | pub const VDSO_CGT_SYM = "__vdso_clock_gettime"; |
| 399 | pub const VDSO_CGT_VER = "LINUX_2.6"; | 432 | pub const VDSO_CGT_VER = "LINUX_2.6"; |