| 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 | 74 | pub const PROT_GROWSDOWN = 0x01000000; |
| 75 | 75 | pub const PROT_GROWSUP = 0x02000000; |
| 76 | 76 | |
| 77 | pub const MAP_FAILED = @intToPtr(*c_void, maxInt(usize)); | |
| 77 | /// Share changes | |
| 78 | 78 | pub const MAP_SHARED = 0x01; |
| 79 | ||
| 80 | /// Changes are private | |
| 79 | 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 | 87 | pub const MAP_TYPE = 0x0f; |
| 88 | ||
| 89 | /// Interpret addr exactly | |
| 81 | 90 | pub const MAP_FIXED = 0x10; |
| 91 | ||
| 92 | /// don't use a file | |
| 82 | 93 | pub const MAP_ANONYMOUS = 0x20; |
| 83 | pub const MAP_NORESERVE = 0x4000; | |
| 84 | pub const MAP_GROWSDOWN = 0x0100; | |
| 85 | pub const MAP_DENYWRITE = 0x0800; | |
| 86 | pub const MAP_EXECUTABLE = 0x1000; | |
| 87 | pub const MAP_LOCKED = 0x2000; | |
| 88 | pub const MAP_POPULATE = 0x8000; | |
| 89 | pub const MAP_NONBLOCK = 0x10000; | |
| 90 | pub const MAP_STACK = 0x20000; | |
| 91 | pub const MAP_HUGETLB = 0x40000; | |
| 92 | pub const MAP_FILE = 0; | |
| 94 | ||
| 95 | /// For anonymous mmap, memory could be uninitialized | |
| 96 | pub const MAP_UNINITIALIZED = 0x4000000; | |
| 97 | ||
| 98 | // MAP_ 0x0100 - 0x80000 flags are per architecture | |
| 99 | ||
| 100 | /// MAP_FIXED which doesn't unmap underlying mapping | |
| 101 | pub const MAP_FIXED_NOREPLACE = 0x100000; | |
| 93 | 102 | |
| 94 | 103 | pub const F_OK = 0; |
| 95 | 104 | pub const X_OK = 1; |
std/os/bits/linux/arm64.zig+30| ... | ... | @@ -331,6 +331,36 @@ pub const F_GETOWN_EX = 16; |
| 331 | 331 | |
| 332 | 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 | 364 | pub const VDSO_USEFUL = true; |
| 335 | 365 | pub const VDSO_CGT_SYM = "__kernel_clock_gettime"; |
| 336 | 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 | 394 | |
| 395 | 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 | 430 | pub const VDSO_USEFUL = true; |
| 398 | 431 | pub const VDSO_CGT_SYM = "__vdso_clock_gettime"; |
| 399 | 432 | pub const VDSO_CGT_VER = "LINUX_2.6"; |