diff options
| author | Jakub Konka <kubkon@jakubkonka.com> | 2022-03-13 13:35:37 +0100 |
|---|---|---|
| committer | Jakub Konka <kubkon@jakubkonka.com> | 2022-03-13 13:35:39 +0100 |
| commit | 633c4a2a6094cd301648c2e2c6b5002917e0ef2c (patch) | |
| tree | fdad1685dde93d39af844d257440ddd42ba3046b /src | |
| parent | 2036af94e97f0ac16293556423c144ec9e1b8226 (diff) | |
| download | zig-633c4a2a6094cd301648c2e2c6b5002917e0ef2c.tar.gz zig-633c4a2a6094cd301648c2e2c6b5002917e0ef2c.zip | |
macos: add Mach task abstraction
`std.os.darwin.MachTask` wraps `mach_port_t` and can be used to issue
kernel calls tied to the wrapped Mach kernel port/task.
Diffstat (limited to 'src')
| -rw-r--r-- | src/link/MachO.zig | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/src/link/MachO.zig b/src/link/MachO.zig index a394ea703d..b5105782ff 100644 --- a/src/link/MachO.zig +++ b/src/link/MachO.zig @@ -4,6 +4,7 @@ const std = @import("std"); const build_options = @import("build_options"); const builtin = @import("builtin"); const assert = std.debug.assert; +const darwin = std.os.darwin; const fmt = std.fmt; const fs = std.fs; const log = std.log.scoped(.link); @@ -4382,8 +4383,8 @@ fn populateMissingMetadata(self: *MachO) !void { .vmaddr = pagezero_vmsize, .vmsize = needed_size, .filesize = needed_size, - .maxprot = macho.VM_PROT_READ | macho.VM_PROT_EXECUTE, - .initprot = macho.VM_PROT_READ | macho.VM_PROT_EXECUTE, + .maxprot = darwin.PROT.READ | darwin.PROT.EXEC, + .initprot = darwin.PROT.READ | darwin.PROT.EXEC, }, }, }); @@ -4487,8 +4488,8 @@ fn populateMissingMetadata(self: *MachO) !void { .vmsize = needed_size, .fileoff = fileoff, .filesize = needed_size, - .maxprot = macho.VM_PROT_READ | macho.VM_PROT_WRITE, - .initprot = macho.VM_PROT_READ | macho.VM_PROT_WRITE, + .maxprot = darwin.PROT.READ | darwin.PROT.WRITE, + .initprot = darwin.PROT.READ | darwin.PROT.WRITE, }, }, }); @@ -4536,8 +4537,8 @@ fn populateMissingMetadata(self: *MachO) !void { .vmsize = needed_size, .fileoff = fileoff, .filesize = needed_size, - .maxprot = macho.VM_PROT_READ | macho.VM_PROT_WRITE, - .initprot = macho.VM_PROT_READ | macho.VM_PROT_WRITE, + .maxprot = darwin.PROT.READ | darwin.PROT.WRITE, + .initprot = darwin.PROT.READ | darwin.PROT.WRITE, }, }, }); @@ -4645,8 +4646,8 @@ fn populateMissingMetadata(self: *MachO) !void { .segname = makeStaticString("__LINKEDIT"), .vmaddr = vmaddr, .fileoff = fileoff, - .maxprot = macho.VM_PROT_READ, - .initprot = macho.VM_PROT_READ, + .maxprot = darwin.PROT.READ, + .initprot = darwin.PROT.READ, }, }, }); |
