diff --git a/build.zig b/build.zig
index 40e1b36e71..449c6a7f1a 100644
--- a/build.zig
+++ b/build.zig
@@ -61,6 +61,7 @@ pub fn build(b: *Builder) !void {
const omit_stage2 = b.option(bool, "omit-stage2", "Do not include stage2 behind a feature flag inside stage1") orelse false;
const static_llvm = b.option(bool, "static-llvm", "Disable integration with system-installed LLVM, Clang, LLD, and libc++") orelse false;
const enable_llvm = b.option(bool, "enable-llvm", "Build self-hosted compiler with LLVM backend enabled") orelse (is_stage1 or static_llvm);
+ const enable_macos_sdk = b.option(bool, "enable-macos-sdk", "Run tests requiring presence of macOS SDK and frameworks") orelse false;
const config_h_path_option = b.option([]const u8, "config_h", "Path to the generated config.h");
if (!skip_install_lib_files) {
@@ -186,7 +187,7 @@ pub fn build(b: *Builder) !void {
},
2 => {
// Untagged development build (e.g. 0.8.0-684-gbbe2cca1a).
- var it = mem.split(git_describe, "-");
+ var it = mem.split(u8, git_describe, "-");
const tagged_ancestor = it.next() orelse unreachable;
const commit_height = it.next() orelse unreachable;
const commit_id = it.next() orelse unreachable;
@@ -340,7 +341,7 @@ pub fn build(b: *Builder) !void {
));
toolchain_step.dependOn(tests.addCompareOutputTests(b, test_filter, modes));
- toolchain_step.dependOn(tests.addStandaloneTests(b, test_filter, modes, skip_non_native, target));
+ toolchain_step.dependOn(tests.addStandaloneTests(b, test_filter, modes, skip_non_native, enable_macos_sdk, target));
toolchain_step.dependOn(tests.addStackTraceTests(b, test_filter, modes));
toolchain_step.dependOn(tests.addCliTests(b, test_filter, modes));
toolchain_step.dependOn(tests.addAssembleAndLinkTests(b, test_filter, modes));
@@ -478,7 +479,7 @@ fn addCxxKnownPath(
ctx.cxx_compiler,
b.fmt("-print-file-name={s}", .{objname}),
});
- const path_unpadded = mem.tokenize(path_padded, "\r\n").next().?;
+ const path_unpadded = mem.tokenize(u8, path_padded, "\r\n").next().?;
if (mem.eql(u8, path_unpadded, objname)) {
if (errtxt) |msg| {
warn("{s}", .{msg});
@@ -501,7 +502,7 @@ fn addCxxKnownPath(
}
fn addCMakeLibraryList(exe: *std.build.LibExeObjStep, list: []const u8) void {
- var it = mem.tokenize(list, ";");
+ var it = mem.tokenize(u8, list, ";");
while (it.next()) |lib| {
if (mem.startsWith(u8, lib, "-l")) {
exe.linkSystemLibrary(lib["-l".len..]);
@@ -595,11 +596,11 @@ fn findAndParseConfigH(b: *Builder, config_h_path_option: ?[]const u8) ?CMakeCon
},
};
- var lines_it = mem.tokenize(config_h_text, "\r\n");
+ var lines_it = mem.tokenize(u8, config_h_text, "\r\n");
while (lines_it.next()) |line| {
inline for (mappings) |mapping| {
if (mem.startsWith(u8, line, mapping.prefix)) {
- var it = mem.split(line, "\"");
+ var it = mem.split(u8, line, "\"");
_ = it.next().?; // skip the stuff before the quote
const quoted = it.next().?; // the stuff inside the quote
@field(ctx, mapping.field) = toNativePathSep(b, quoted);
diff --git a/ci/azure/linux_script b/ci/azure/linux_script
index 33ad349044..dac7bac614 100755
--- a/ci/azure/linux_script
+++ b/ci/azure/linux_script
@@ -69,9 +69,11 @@ release/bin/zig fmt --check ..
cmake .. -DZIG_EXECUTABLE="$(pwd)/release/bin/zig"
make $JOBS install
-for step in test-toolchain test-std docs; do
- release/bin/zig build $step -Denable-qemu -Denable-wasmtime
-done
+release/bin/zig test ../test/behavior.zig -fno-stage1 -fLLVM -I ../test
+
+release/bin/zig build test-toolchain -Denable-qemu -Denable-wasmtime
+release/bin/zig build test-std -Denable-qemu -Denable-wasmtime
+release/bin/zig build docs -Denable-qemu -Denable-wasmtime
# Look for HTML errors.
tidy -qe ../zig-cache/langref.html
diff --git a/ci/azure/macos_script b/ci/azure/macos_script
index 4afaedfa12..d56ba63b6b 100755
--- a/ci/azure/macos_script
+++ b/ci/azure/macos_script
@@ -54,9 +54,12 @@ make $JOBS install
cmake .. -DZIG_EXECUTABLE="$(pwd)/release/bin/zig"
make $JOBS install
-for step in test-toolchain test-std docs; do
- release/bin/zig build $step
-done
+# TODO figure out why this causes a segmentation fault
+# release/bin/zig test ../test/behavior.zig -fno-stage1 -fLLVM -I ../test
+
+release/bin/zig build test-toolchain -Denable-macos-sdk
+release/bin/zig build test-std
+release/bin/zig build docs
if [ "${BUILD_REASON}" != "PullRequest" ]; then
mv ../LICENSE release/
diff --git a/ci/azure/windows_msvc_script.bat b/ci/azure/windows_msvc_script.bat
index df1b63b485..a073650717 100644
--- a/ci/azure/windows_msvc_script.bat
+++ b/ci/azure/windows_msvc_script.bat
@@ -26,6 +26,10 @@ cd %ZIGBUILDDIR%
cmake.exe .. -Thost=x64 -G"Visual Studio 16 2019" -A x64 "-DCMAKE_INSTALL_PREFIX=%ZIGINSTALLDIR%" "-DCMAKE_PREFIX_PATH=%ZIGPREFIXPATH%" -DCMAKE_BUILD_TYPE=Release -DZIG_OMIT_STAGE2=ON || exit /b
msbuild /maxcpucount /p:Configuration=Release INSTALL.vcxproj || exit /b
+REM Sadly, stage2 is omitted from this build to save memory on the CI server. Once self-hosted is
+REM built with itself and does not gobble as much memory, we can enable these tests.
+REM "%ZIGINSTALLDIR%\bin\zig.exe" test "..\test\behavior.zig" -fno-stage1 -fLLVM -I "..\test" || exit /b
+
"%ZIGINSTALLDIR%\bin\zig.exe" build test-toolchain -Dskip-non-native -Dskip-stage2-tests || exit /b
"%ZIGINSTALLDIR%\bin\zig.exe" build test-std -Dskip-non-native || exit /b
"%ZIGINSTALLDIR%\bin\zig.exe" build docs || exit /b
diff --git a/ci/azure/windows_upload b/ci/azure/windows_upload
index 1f47359dd9..9c5e07e5f9 100755
--- a/ci/azure/windows_upload
+++ b/ci/azure/windows_upload
@@ -11,6 +11,11 @@ if [ "${BUILD_REASON}" != "PullRequest" ]; then
mv dist/bin/zig.exe dist/
rmdir dist/bin
+ # Remove the unnecessary zig dir in $prefix/lib/zig/std/std.zig
+ mv dist/lib/zig dist/lib2
+ rmdir dist/lib
+ mv dist/lib2 dist/lib
+
VERSION=$(dist/zig.exe version)
DIRNAME="zig-windows-x86_64-$VERSION"
TARBALL="$DIRNAME.zip"
diff --git a/ci/srht/freebsd_script b/ci/srht/freebsd_script
index 44b0330542..27c7df4933 100755
--- a/ci/srht/freebsd_script
+++ b/ci/srht/freebsd_script
@@ -38,6 +38,11 @@ cmake .. \
-GNinja
samu install
+# TODO ld.lld: error: undefined symbol: main
+# >>> referenced by crt1_c.c:75 (/usr/src/lib/csu/amd64/crt1_c.c:75)
+# >>> /usr/lib/crt1.o:(_start)
+#release/bin/zig test ../test/behavior.zig -fno-stage1 -fLLVM -I ../test
+
# Here we skip some tests to save time.
release/bin/zig build test -Dskip-compile-errors -Dskip-non-native
diff --git a/ci/srht/netbsd_script b/ci/srht/netbsd_script
index 508da4b324..f2d2f09467 100755
--- a/ci/srht/netbsd_script
+++ b/ci/srht/netbsd_script
@@ -51,6 +51,11 @@ samu install
unset CC
unset CXX
+# TODO ld.lld: error: undefined symbol: main
+#>>> referenced by crt0-common.c
+#>>> /usr/lib/crt0.o:(___start)
+#release/bin/zig test ../test/behavior.zig -fno-stage1 -fLLVM -I ../test
+
# Here we skip some tests to save time.
release/bin/zig build test -Dskip-compile-errors -Dskip-non-native
diff --git a/doc/langref.html.in b/doc/langref.html.in
index 9e98bb0114..386fe9f41a 100644
--- a/doc/langref.html.in
+++ b/doc/langref.html.in
@@ -2846,7 +2846,7 @@ test "pointer to non-bit-aligned field" {
Zig should correctly understand the alignment of fields. However there is
a bug:
- {#code_begin|test_err#}
+ {#code_begin|test_err|expected type '*u32', found '*align(1) u32'#}
const S = packed struct {
a: u32,
b: u32,
@@ -2855,6 +2855,7 @@ test "overaligned pointer to packed struct" {
var foo: S align(4) = undefined;
const ptr: *align(4) S = &foo;
const ptr_to_b: *u32 = &ptr.b;
+ _ = ptr_to_b;
}
{#code_end#}
When this bug is fixed, the above test in the documentation will unexpectedly pass, which will
@@ -3422,10 +3423,11 @@ test "call foo" {
Blocks are used to limit the scope of variable declarations:
- {#code_begin|test_err|unused local variable#}
+ {#code_begin|test_err|use of undeclared identifier 'x'#}
test "access variable after block scope" {
{
var x: i32 = 1;
+ _ = x;
}
x += 1;
}
@@ -7125,6 +7127,7 @@ fn func(y: *i32) void {
an integer or an enum.
{#header_close#}
+
{#header_open|@bitCast#}
{#syntax#}@bitCast(comptime DestType: type, value: anytype) DestType{#endsyntax#}
@@ -7164,8 +7167,8 @@ fn func(y: *i32) void {
{#header_open|@boolToInt#}
{#syntax#}@boolToInt(value: bool) u1{#endsyntax#}
- Converts {#syntax#}true{#endsyntax#} to {#syntax#}u1(1){#endsyntax#} and {#syntax#}false{#endsyntax#} to
- {#syntax#}u1(0){#endsyntax#}.
+ Converts {#syntax#}true{#endsyntax#} to {#syntax#}@as(u1, 1){#endsyntax#} and {#syntax#}false{#endsyntax#} to
+ {#syntax#}@as(u1, 0){#endsyntax#}.
If the value is known at compile-time, the return type is {#syntax#}comptime_int{#endsyntax#}
@@ -7987,6 +7990,17 @@ test "@hasDecl" {
{#header_close#}
+ {#header_open|@maximum#}
+ {#syntax#}@maximum(a: T, b: T) T{#endsyntax#}
+
+ Returns the maximum value of {#syntax#}a{#endsyntax#} and {#syntax#}b{#endsyntax#}. This builtin accepts integers, floats, and vectors of either. In the latter case, the operation is performed element wise.
+
+
+ NaNs are handled as follows: if one of the operands of a (pairwise) operation is NaN, the other operand is returned. If both operands are NaN, NaN is returned.
+
+ {#see_also|@minimum|SIMD|Vectors#}
+ {#header_close#}
+
{#header_open|@memcpy#}
{#syntax#}@memcpy(noalias dest: [*]u8, noalias source: [*]const u8, byte_count: usize){#endsyntax#}
@@ -8024,6 +8038,17 @@ mem.copy(u8, dest[0..byte_count], source[0..byte_count]);{#endsyntax#}
mem.set(u8, dest, c);{#endsyntax#}
{#header_close#}
+ {#header_open|@minimum#}
+
{#syntax#}@minimum(a: T, b: T) T{#endsyntax#}
+
+ Returns the minimum value of {#syntax#}a{#endsyntax#} and {#syntax#}b{#endsyntax#}. This builtin accepts integers, floats, and vectors of either. In the latter case, the operation is performed element wise.
+
+
+ NaNs are handled as follows: if one of the operands of a (pairwise) operation is NaN, the other operand is returned. If both operands are NaN, NaN is returned.
+
+ {#see_also|@maximum|SIMD|Vectors#}
+ {#header_close#}
+
{#header_open|@wasmMemorySize#}
{#syntax#}@wasmMemorySize(index: u32) u32{#endsyntax#}
@@ -8177,6 +8202,15 @@ test "@wasmMemoryGrow" {
a calling function, the returned address will apply to the calling function.
{#header_close#}
+
+ {#header_open|@select#}
+ {#syntax#}@select(comptime T: type, pred: std.meta.Vector(len, bool), a: std.meta.Vector(len, T), b: std.meta.Vector(len, T)) std.meta.Vector(len, T){#endsyntax#}
+
+ Selects values element-wise from {#syntax#}a{#endsyntax#} or {#syntax#}b{#endsyntax#} based on {#syntax#}pred{#endsyntax#}. If {#syntax#}pred[i]{#endsyntax#} is {#syntax#}true{#endsyntax#}, the corresponding element in the result will be {#syntax#}a[i]{#endsyntax#} and otherwise {#syntax#}b[i]{#endsyntax#}.
+
+ {#see_also|SIMD|Vectors#}
+ {#header_close#}
+
{#header_open|@setAlignStack#}
{#syntax#}@setAlignStack(comptime alignment: u29){#endsyntax#}
diff --git a/lib/libc/include/aarch64-macos-gnu/Availability.h b/lib/libc/include/any-macos-any/Availability.h
similarity index 100%
rename from lib/libc/include/aarch64-macos-gnu/Availability.h
rename to lib/libc/include/any-macos-any/Availability.h
diff --git a/lib/libc/include/aarch64-macos-gnu/CommonCrypto/CommonDigest.h b/lib/libc/include/any-macos-any/CommonCrypto/CommonDigest.h
similarity index 100%
rename from lib/libc/include/aarch64-macos-gnu/CommonCrypto/CommonDigest.h
rename to lib/libc/include/any-macos-any/CommonCrypto/CommonDigest.h
diff --git a/lib/libc/include/aarch64-macos-gnu/TargetConditionals.h b/lib/libc/include/any-macos-any/TargetConditionals.h
similarity index 100%
rename from lib/libc/include/aarch64-macos-gnu/TargetConditionals.h
rename to lib/libc/include/any-macos-any/TargetConditionals.h
diff --git a/lib/libc/include/aarch64-macos-gnu/_ctermid.h b/lib/libc/include/any-macos-any/_ctermid.h
similarity index 100%
rename from lib/libc/include/aarch64-macos-gnu/_ctermid.h
rename to lib/libc/include/any-macos-any/_ctermid.h
diff --git a/lib/libc/include/aarch64-macos-gnu/ar.h b/lib/libc/include/any-macos-any/ar.h
similarity index 100%
rename from lib/libc/include/aarch64-macos-gnu/ar.h
rename to lib/libc/include/any-macos-any/ar.h
diff --git a/lib/libc/include/aarch64-macos-gnu/bsm/audit.h b/lib/libc/include/any-macos-any/bsm/audit.h
similarity index 100%
rename from lib/libc/include/aarch64-macos-gnu/bsm/audit.h
rename to lib/libc/include/any-macos-any/bsm/audit.h
diff --git a/lib/libc/include/aarch64-macos-gnu/dispatch/block.h b/lib/libc/include/any-macos-any/dispatch/block.h
similarity index 100%
rename from lib/libc/include/aarch64-macos-gnu/dispatch/block.h
rename to lib/libc/include/any-macos-any/dispatch/block.h
diff --git a/lib/libc/include/aarch64-macos-gnu/dispatch/dispatch.h b/lib/libc/include/any-macos-any/dispatch/dispatch.h
similarity index 100%
rename from lib/libc/include/aarch64-macos-gnu/dispatch/dispatch.h
rename to lib/libc/include/any-macos-any/dispatch/dispatch.h
diff --git a/lib/libc/include/aarch64-macos-gnu/dispatch/group.h b/lib/libc/include/any-macos-any/dispatch/group.h
similarity index 100%
rename from lib/libc/include/aarch64-macos-gnu/dispatch/group.h
rename to lib/libc/include/any-macos-any/dispatch/group.h
diff --git a/lib/libc/include/aarch64-macos-gnu/dispatch/object.h b/lib/libc/include/any-macos-any/dispatch/object.h
similarity index 100%
rename from lib/libc/include/aarch64-macos-gnu/dispatch/object.h
rename to lib/libc/include/any-macos-any/dispatch/object.h
diff --git a/lib/libc/include/aarch64-macos-gnu/dispatch/queue.h b/lib/libc/include/any-macos-any/dispatch/queue.h
similarity index 100%
rename from lib/libc/include/aarch64-macos-gnu/dispatch/queue.h
rename to lib/libc/include/any-macos-any/dispatch/queue.h
diff --git a/lib/libc/include/aarch64-macos-gnu/dispatch/semaphore.h b/lib/libc/include/any-macos-any/dispatch/semaphore.h
similarity index 100%
rename from lib/libc/include/aarch64-macos-gnu/dispatch/semaphore.h
rename to lib/libc/include/any-macos-any/dispatch/semaphore.h
diff --git a/lib/libc/include/aarch64-macos-gnu/dispatch/source.h b/lib/libc/include/any-macos-any/dispatch/source.h
similarity index 100%
rename from lib/libc/include/aarch64-macos-gnu/dispatch/source.h
rename to lib/libc/include/any-macos-any/dispatch/source.h
diff --git a/lib/libc/include/aarch64-macos-gnu/dispatch/workloop.h b/lib/libc/include/any-macos-any/dispatch/workloop.h
similarity index 100%
rename from lib/libc/include/aarch64-macos-gnu/dispatch/workloop.h
rename to lib/libc/include/any-macos-any/dispatch/workloop.h
diff --git a/lib/libc/include/aarch64-macos-gnu/libkern/OSByteOrder.h b/lib/libc/include/any-macos-any/libkern/OSByteOrder.h
similarity index 100%
rename from lib/libc/include/aarch64-macos-gnu/libkern/OSByteOrder.h
rename to lib/libc/include/any-macos-any/libkern/OSByteOrder.h
diff --git a/lib/libc/include/aarch64-macos-gnu/libkern/_OSByteOrder.h b/lib/libc/include/any-macos-any/libkern/_OSByteOrder.h
similarity index 100%
rename from lib/libc/include/aarch64-macos-gnu/libkern/_OSByteOrder.h
rename to lib/libc/include/any-macos-any/libkern/_OSByteOrder.h
diff --git a/lib/libc/include/aarch64-macos-gnu/libproc.h b/lib/libc/include/any-macos-any/libproc.h
similarity index 100%
rename from lib/libc/include/aarch64-macos-gnu/libproc.h
rename to lib/libc/include/any-macos-any/libproc.h
diff --git a/lib/libc/include/aarch64-macos-gnu/mach-o/arch.h b/lib/libc/include/any-macos-any/mach-o/arch.h
similarity index 100%
rename from lib/libc/include/aarch64-macos-gnu/mach-o/arch.h
rename to lib/libc/include/any-macos-any/mach-o/arch.h
diff --git a/lib/libc/include/aarch64-macos-gnu/mach-o/arm64/reloc.h b/lib/libc/include/any-macos-any/mach-o/arm64/reloc.h
similarity index 100%
rename from lib/libc/include/aarch64-macos-gnu/mach-o/arm64/reloc.h
rename to lib/libc/include/any-macos-any/mach-o/arm64/reloc.h
diff --git a/lib/libc/include/aarch64-macos-gnu/mach-o/compact_unwind_encoding.h b/lib/libc/include/any-macos-any/mach-o/compact_unwind_encoding.h
similarity index 100%
rename from lib/libc/include/aarch64-macos-gnu/mach-o/compact_unwind_encoding.h
rename to lib/libc/include/any-macos-any/mach-o/compact_unwind_encoding.h
diff --git a/lib/libc/include/aarch64-macos-gnu/mach-o/dyld.h b/lib/libc/include/any-macos-any/mach-o/dyld.h
similarity index 100%
rename from lib/libc/include/aarch64-macos-gnu/mach-o/dyld.h
rename to lib/libc/include/any-macos-any/mach-o/dyld.h
diff --git a/lib/libc/include/aarch64-macos-gnu/mach-o/fat.h b/lib/libc/include/any-macos-any/mach-o/fat.h
similarity index 100%
rename from lib/libc/include/aarch64-macos-gnu/mach-o/fat.h
rename to lib/libc/include/any-macos-any/mach-o/fat.h
diff --git a/lib/libc/include/aarch64-macos-gnu/mach-o/loader.h b/lib/libc/include/any-macos-any/mach-o/loader.h
similarity index 100%
rename from lib/libc/include/aarch64-macos-gnu/mach-o/loader.h
rename to lib/libc/include/any-macos-any/mach-o/loader.h
diff --git a/lib/libc/include/aarch64-macos-gnu/mach-o/nlist.h b/lib/libc/include/any-macos-any/mach-o/nlist.h
similarity index 100%
rename from lib/libc/include/aarch64-macos-gnu/mach-o/nlist.h
rename to lib/libc/include/any-macos-any/mach-o/nlist.h
diff --git a/lib/libc/include/aarch64-macos-gnu/mach-o/ranlib.h b/lib/libc/include/any-macos-any/mach-o/ranlib.h
similarity index 100%
rename from lib/libc/include/aarch64-macos-gnu/mach-o/ranlib.h
rename to lib/libc/include/any-macos-any/mach-o/ranlib.h
diff --git a/lib/libc/include/aarch64-macos-gnu/mach-o/reloc.h b/lib/libc/include/any-macos-any/mach-o/reloc.h
similarity index 100%
rename from lib/libc/include/aarch64-macos-gnu/mach-o/reloc.h
rename to lib/libc/include/any-macos-any/mach-o/reloc.h
diff --git a/lib/libc/include/aarch64-macos-gnu/mach-o/stab.h b/lib/libc/include/any-macos-any/mach-o/stab.h
similarity index 100%
rename from lib/libc/include/aarch64-macos-gnu/mach-o/stab.h
rename to lib/libc/include/any-macos-any/mach-o/stab.h
diff --git a/lib/libc/include/aarch64-macos-gnu/mach-o/x86_64/reloc.h b/lib/libc/include/any-macos-any/mach-o/x86_64/reloc.h
similarity index 100%
rename from lib/libc/include/aarch64-macos-gnu/mach-o/x86_64/reloc.h
rename to lib/libc/include/any-macos-any/mach-o/x86_64/reloc.h
diff --git a/lib/libc/include/aarch64-macos-gnu/mach/kern_return.h b/lib/libc/include/any-macos-any/mach/kern_return.h
similarity index 100%
rename from lib/libc/include/aarch64-macos-gnu/mach/kern_return.h
rename to lib/libc/include/any-macos-any/mach/kern_return.h
diff --git a/lib/libc/include/aarch64-macos-gnu/mach/mach_port.h b/lib/libc/include/any-macos-any/mach/mach_port.h
similarity index 100%
rename from lib/libc/include/aarch64-macos-gnu/mach/mach_port.h
rename to lib/libc/include/any-macos-any/mach/mach_port.h
diff --git a/lib/libc/include/aarch64-macos-gnu/mach/mach_traps.h b/lib/libc/include/any-macos-any/mach/mach_traps.h
similarity index 100%
rename from lib/libc/include/aarch64-macos-gnu/mach/mach_traps.h
rename to lib/libc/include/any-macos-any/mach/mach_traps.h
diff --git a/lib/libc/include/aarch64-macos-gnu/mach/mach_types.h b/lib/libc/include/any-macos-any/mach/mach_types.h
similarity index 100%
rename from lib/libc/include/aarch64-macos-gnu/mach/mach_types.h
rename to lib/libc/include/any-macos-any/mach/mach_types.h
diff --git a/lib/libc/include/aarch64-macos-gnu/mach/machine.h b/lib/libc/include/any-macos-any/mach/machine.h
similarity index 100%
rename from lib/libc/include/aarch64-macos-gnu/mach/machine.h
rename to lib/libc/include/any-macos-any/mach/machine.h
diff --git a/lib/libc/include/aarch64-macos-gnu/mach/machine/_structs.h b/lib/libc/include/any-macos-any/mach/machine/_structs.h
similarity index 100%
rename from lib/libc/include/aarch64-macos-gnu/mach/machine/_structs.h
rename to lib/libc/include/any-macos-any/mach/machine/_structs.h
diff --git a/lib/libc/include/aarch64-macos-gnu/mach/machine/boolean.h b/lib/libc/include/any-macos-any/mach/machine/boolean.h
similarity index 100%
rename from lib/libc/include/aarch64-macos-gnu/mach/machine/boolean.h
rename to lib/libc/include/any-macos-any/mach/machine/boolean.h
diff --git a/lib/libc/include/aarch64-macos-gnu/mach/machine/exception.h b/lib/libc/include/any-macos-any/mach/machine/exception.h
similarity index 100%
rename from lib/libc/include/aarch64-macos-gnu/mach/machine/exception.h
rename to lib/libc/include/any-macos-any/mach/machine/exception.h
diff --git a/lib/libc/include/aarch64-macos-gnu/mach/machine/kern_return.h b/lib/libc/include/any-macos-any/mach/machine/kern_return.h
similarity index 100%
rename from lib/libc/include/aarch64-macos-gnu/mach/machine/kern_return.h
rename to lib/libc/include/any-macos-any/mach/machine/kern_return.h
diff --git a/lib/libc/include/aarch64-macos-gnu/mach/machine/processor_info.h b/lib/libc/include/any-macos-any/mach/machine/processor_info.h
similarity index 100%
rename from lib/libc/include/aarch64-macos-gnu/mach/machine/processor_info.h
rename to lib/libc/include/any-macos-any/mach/machine/processor_info.h
diff --git a/lib/libc/include/aarch64-macos-gnu/mach/machine/rpc.h b/lib/libc/include/any-macos-any/mach/machine/rpc.h
similarity index 100%
rename from lib/libc/include/aarch64-macos-gnu/mach/machine/rpc.h
rename to lib/libc/include/any-macos-any/mach/machine/rpc.h
diff --git a/lib/libc/include/aarch64-macos-gnu/mach/machine/thread_state.h b/lib/libc/include/any-macos-any/mach/machine/thread_state.h
similarity index 100%
rename from lib/libc/include/aarch64-macos-gnu/mach/machine/thread_state.h
rename to lib/libc/include/any-macos-any/mach/machine/thread_state.h
diff --git a/lib/libc/include/aarch64-macos-gnu/mach/machine/thread_status.h b/lib/libc/include/any-macos-any/mach/machine/thread_status.h
similarity index 100%
rename from lib/libc/include/aarch64-macos-gnu/mach/machine/thread_status.h
rename to lib/libc/include/any-macos-any/mach/machine/thread_status.h
diff --git a/lib/libc/include/aarch64-macos-gnu/mach/machine/vm_param.h b/lib/libc/include/any-macos-any/mach/machine/vm_param.h
similarity index 100%
rename from lib/libc/include/aarch64-macos-gnu/mach/machine/vm_param.h
rename to lib/libc/include/any-macos-any/mach/machine/vm_param.h
diff --git a/lib/libc/include/aarch64-macos-gnu/mach/machine/vm_types.h b/lib/libc/include/any-macos-any/mach/machine/vm_types.h
similarity index 100%
rename from lib/libc/include/aarch64-macos-gnu/mach/machine/vm_types.h
rename to lib/libc/include/any-macos-any/mach/machine/vm_types.h
diff --git a/lib/libc/include/aarch64-macos-gnu/mach/message.h b/lib/libc/include/any-macos-any/mach/message.h
similarity index 100%
rename from lib/libc/include/aarch64-macos-gnu/mach/message.h
rename to lib/libc/include/any-macos-any/mach/message.h
diff --git a/lib/libc/include/aarch64-macos-gnu/mach/port.h b/lib/libc/include/any-macos-any/mach/port.h
similarity index 100%
rename from lib/libc/include/aarch64-macos-gnu/mach/port.h
rename to lib/libc/include/any-macos-any/mach/port.h
diff --git a/lib/libc/include/aarch64-macos-gnu/mach/processor_set.h b/lib/libc/include/any-macos-any/mach/processor_set.h
similarity index 100%
rename from lib/libc/include/aarch64-macos-gnu/mach/processor_set.h
rename to lib/libc/include/any-macos-any/mach/processor_set.h
diff --git a/lib/libc/include/aarch64-macos-gnu/mach/task.h b/lib/libc/include/any-macos-any/mach/task.h
similarity index 100%
rename from lib/libc/include/aarch64-macos-gnu/mach/task.h
rename to lib/libc/include/any-macos-any/mach/task.h
diff --git a/lib/libc/include/aarch64-macos-gnu/mach/task_info.h b/lib/libc/include/any-macos-any/mach/task_info.h
similarity index 100%
rename from lib/libc/include/aarch64-macos-gnu/mach/task_info.h
rename to lib/libc/include/any-macos-any/mach/task_info.h
diff --git a/lib/libc/include/aarch64-macos-gnu/mach/task_policy.h b/lib/libc/include/any-macos-any/mach/task_policy.h
similarity index 100%
rename from lib/libc/include/aarch64-macos-gnu/mach/task_policy.h
rename to lib/libc/include/any-macos-any/mach/task_policy.h
diff --git a/lib/libc/include/aarch64-macos-gnu/mach/task_special_ports.h b/lib/libc/include/any-macos-any/mach/task_special_ports.h
similarity index 100%
rename from lib/libc/include/aarch64-macos-gnu/mach/task_special_ports.h
rename to lib/libc/include/any-macos-any/mach/task_special_ports.h
diff --git a/lib/libc/include/aarch64-macos-gnu/mach/thread_act.h b/lib/libc/include/any-macos-any/mach/thread_act.h
similarity index 100%
rename from lib/libc/include/aarch64-macos-gnu/mach/thread_act.h
rename to lib/libc/include/any-macos-any/mach/thread_act.h
diff --git a/lib/libc/include/aarch64-macos-gnu/mach/thread_special_ports.h b/lib/libc/include/any-macos-any/mach/thread_special_ports.h
similarity index 100%
rename from lib/libc/include/aarch64-macos-gnu/mach/thread_special_ports.h
rename to lib/libc/include/any-macos-any/mach/thread_special_ports.h
diff --git a/lib/libc/include/aarch64-macos-gnu/mach/thread_status.h b/lib/libc/include/any-macos-any/mach/thread_status.h
similarity index 100%
rename from lib/libc/include/aarch64-macos-gnu/mach/thread_status.h
rename to lib/libc/include/any-macos-any/mach/thread_status.h
diff --git a/lib/libc/include/aarch64-macos-gnu/mach/vm_prot.h b/lib/libc/include/any-macos-any/mach/vm_prot.h
similarity index 100%
rename from lib/libc/include/aarch64-macos-gnu/mach/vm_prot.h
rename to lib/libc/include/any-macos-any/mach/vm_prot.h
diff --git a/lib/libc/include/aarch64-macos-gnu/mach/vm_statistics.h b/lib/libc/include/any-macos-any/mach/vm_statistics.h
similarity index 100%
rename from lib/libc/include/aarch64-macos-gnu/mach/vm_statistics.h
rename to lib/libc/include/any-macos-any/mach/vm_statistics.h
diff --git a/lib/libc/include/aarch64-macos-gnu/mach/vm_types.h b/lib/libc/include/any-macos-any/mach/vm_types.h
similarity index 100%
rename from lib/libc/include/aarch64-macos-gnu/mach/vm_types.h
rename to lib/libc/include/any-macos-any/mach/vm_types.h
diff --git a/lib/libc/include/aarch64-macos-gnu/machine/_mcontext.h b/lib/libc/include/any-macos-any/machine/_mcontext.h
similarity index 100%
rename from lib/libc/include/aarch64-macos-gnu/machine/_mcontext.h
rename to lib/libc/include/any-macos-any/machine/_mcontext.h
diff --git a/lib/libc/include/aarch64-macos-gnu/machine/_param.h b/lib/libc/include/any-macos-any/machine/_param.h
similarity index 100%
rename from lib/libc/include/aarch64-macos-gnu/machine/_param.h
rename to lib/libc/include/any-macos-any/machine/_param.h
diff --git a/lib/libc/include/aarch64-macos-gnu/machine/_types.h b/lib/libc/include/any-macos-any/machine/_types.h
similarity index 100%
rename from lib/libc/include/aarch64-macos-gnu/machine/_types.h
rename to lib/libc/include/any-macos-any/machine/_types.h
diff --git a/lib/libc/include/aarch64-macos-gnu/machine/endian.h b/lib/libc/include/any-macos-any/machine/endian.h
similarity index 100%
rename from lib/libc/include/aarch64-macos-gnu/machine/endian.h
rename to lib/libc/include/any-macos-any/machine/endian.h
diff --git a/lib/libc/include/aarch64-macos-gnu/machine/limits.h b/lib/libc/include/any-macos-any/machine/limits.h
similarity index 100%
rename from lib/libc/include/aarch64-macos-gnu/machine/limits.h
rename to lib/libc/include/any-macos-any/machine/limits.h
diff --git a/lib/libc/include/aarch64-macos-gnu/machine/param.h b/lib/libc/include/any-macos-any/machine/param.h
similarity index 100%
rename from lib/libc/include/aarch64-macos-gnu/machine/param.h
rename to lib/libc/include/any-macos-any/machine/param.h
diff --git a/lib/libc/include/aarch64-macos-gnu/machine/signal.h b/lib/libc/include/any-macos-any/machine/signal.h
similarity index 100%
rename from lib/libc/include/aarch64-macos-gnu/machine/signal.h
rename to lib/libc/include/any-macos-any/machine/signal.h
diff --git a/lib/libc/include/aarch64-macos-gnu/machine/types.h b/lib/libc/include/any-macos-any/machine/types.h
similarity index 100%
rename from lib/libc/include/aarch64-macos-gnu/machine/types.h
rename to lib/libc/include/any-macos-any/machine/types.h
diff --git a/lib/libc/include/aarch64-macos-gnu/malloc/_malloc.h b/lib/libc/include/any-macos-any/malloc/_malloc.h
similarity index 100%
rename from lib/libc/include/aarch64-macos-gnu/malloc/_malloc.h
rename to lib/libc/include/any-macos-any/malloc/_malloc.h
diff --git a/lib/libc/include/aarch64-macos-gnu/malloc/malloc.h b/lib/libc/include/any-macos-any/malloc/malloc.h
similarity index 100%
rename from lib/libc/include/aarch64-macos-gnu/malloc/malloc.h
rename to lib/libc/include/any-macos-any/malloc/malloc.h
diff --git a/lib/libc/include/aarch64-macos-gnu/math.h b/lib/libc/include/any-macos-any/math.h
similarity index 100%
rename from lib/libc/include/aarch64-macos-gnu/math.h
rename to lib/libc/include/any-macos-any/math.h
diff --git a/lib/libc/include/aarch64-macos-gnu/net/if.h b/lib/libc/include/any-macos-any/net/if.h
similarity index 100%
rename from lib/libc/include/aarch64-macos-gnu/net/if.h
rename to lib/libc/include/any-macos-any/net/if.h
diff --git a/lib/libc/include/aarch64-macos-gnu/net/if_var.h b/lib/libc/include/any-macos-any/net/if_var.h
similarity index 100%
rename from lib/libc/include/aarch64-macos-gnu/net/if_var.h
rename to lib/libc/include/any-macos-any/net/if_var.h
diff --git a/lib/libc/include/aarch64-macos-gnu/net/route.h b/lib/libc/include/any-macos-any/net/route.h
similarity index 100%
rename from lib/libc/include/aarch64-macos-gnu/net/route.h
rename to lib/libc/include/any-macos-any/net/route.h
diff --git a/lib/libc/include/aarch64-macos-gnu/netinet/in.h b/lib/libc/include/any-macos-any/netinet/in.h
similarity index 100%
rename from lib/libc/include/aarch64-macos-gnu/netinet/in.h
rename to lib/libc/include/any-macos-any/netinet/in.h
diff --git a/lib/libc/include/aarch64-macos-gnu/netinet/tcp.h b/lib/libc/include/any-macos-any/netinet/tcp.h
similarity index 100%
rename from lib/libc/include/aarch64-macos-gnu/netinet/tcp.h
rename to lib/libc/include/any-macos-any/netinet/tcp.h
diff --git a/lib/libc/include/aarch64-macos-gnu/netinet6/in6.h b/lib/libc/include/any-macos-any/netinet6/in6.h
similarity index 100%
rename from lib/libc/include/aarch64-macos-gnu/netinet6/in6.h
rename to lib/libc/include/any-macos-any/netinet6/in6.h
diff --git a/lib/libc/include/aarch64-macos-gnu/objc/objc-api.h b/lib/libc/include/any-macos-any/objc/objc-api.h
similarity index 100%
rename from lib/libc/include/aarch64-macos-gnu/objc/objc-api.h
rename to lib/libc/include/any-macos-any/objc/objc-api.h
diff --git a/lib/libc/include/aarch64-macos-gnu/objc/runtime.h b/lib/libc/include/any-macos-any/objc/runtime.h
similarity index 100%
rename from lib/libc/include/aarch64-macos-gnu/objc/runtime.h
rename to lib/libc/include/any-macos-any/objc/runtime.h
diff --git a/lib/libc/include/aarch64-macos-gnu/os/base.h b/lib/libc/include/any-macos-any/os/base.h
similarity index 100%
rename from lib/libc/include/aarch64-macos-gnu/os/base.h
rename to lib/libc/include/any-macos-any/os/base.h
diff --git a/lib/libc/include/aarch64-macos-gnu/os/clock.h b/lib/libc/include/any-macos-any/os/clock.h
similarity index 100%
rename from lib/libc/include/aarch64-macos-gnu/os/clock.h
rename to lib/libc/include/any-macos-any/os/clock.h
diff --git a/lib/libc/include/aarch64-macos-gnu/os/object.h b/lib/libc/include/any-macos-any/os/object.h
similarity index 100%
rename from lib/libc/include/aarch64-macos-gnu/os/object.h
rename to lib/libc/include/any-macos-any/os/object.h
diff --git a/lib/libc/include/aarch64-macos-gnu/os/workgroup.h b/lib/libc/include/any-macos-any/os/workgroup.h
similarity index 100%
rename from lib/libc/include/aarch64-macos-gnu/os/workgroup.h
rename to lib/libc/include/any-macos-any/os/workgroup.h
diff --git a/lib/libc/include/aarch64-macos-gnu/os/workgroup_base.h b/lib/libc/include/any-macos-any/os/workgroup_base.h
similarity index 100%
rename from lib/libc/include/aarch64-macos-gnu/os/workgroup_base.h
rename to lib/libc/include/any-macos-any/os/workgroup_base.h
diff --git a/lib/libc/include/aarch64-macos-gnu/os/workgroup_interval.h b/lib/libc/include/any-macos-any/os/workgroup_interval.h
similarity index 100%
rename from lib/libc/include/aarch64-macos-gnu/os/workgroup_interval.h
rename to lib/libc/include/any-macos-any/os/workgroup_interval.h
diff --git a/lib/libc/include/aarch64-macos-gnu/os/workgroup_object.h b/lib/libc/include/any-macos-any/os/workgroup_object.h
similarity index 100%
rename from lib/libc/include/aarch64-macos-gnu/os/workgroup_object.h
rename to lib/libc/include/any-macos-any/os/workgroup_object.h
diff --git a/lib/libc/include/aarch64-macos-gnu/os/workgroup_parallel.h b/lib/libc/include/any-macos-any/os/workgroup_parallel.h
similarity index 100%
rename from lib/libc/include/aarch64-macos-gnu/os/workgroup_parallel.h
rename to lib/libc/include/any-macos-any/os/workgroup_parallel.h
diff --git a/lib/libc/include/aarch64-macos-gnu/pthread.h b/lib/libc/include/any-macos-any/pthread.h
similarity index 100%
rename from lib/libc/include/aarch64-macos-gnu/pthread.h
rename to lib/libc/include/any-macos-any/pthread.h
diff --git a/lib/libc/include/aarch64-macos-gnu/pthread/sched.h b/lib/libc/include/any-macos-any/pthread/sched.h
similarity index 100%
rename from lib/libc/include/aarch64-macos-gnu/pthread/sched.h
rename to lib/libc/include/any-macos-any/pthread/sched.h
diff --git a/lib/libc/include/aarch64-macos-gnu/sched.h b/lib/libc/include/any-macos-any/sched.h
similarity index 100%
rename from lib/libc/include/aarch64-macos-gnu/sched.h
rename to lib/libc/include/any-macos-any/sched.h
diff --git a/lib/libc/include/aarch64-macos-gnu/signal.h b/lib/libc/include/any-macos-any/signal.h
similarity index 100%
rename from lib/libc/include/aarch64-macos-gnu/signal.h
rename to lib/libc/include/any-macos-any/signal.h
diff --git a/lib/libc/include/aarch64-macos-gnu/simd/common.h b/lib/libc/include/any-macos-any/simd/common.h
similarity index 100%
rename from lib/libc/include/aarch64-macos-gnu/simd/common.h
rename to lib/libc/include/any-macos-any/simd/common.h
diff --git a/lib/libc/include/aarch64-macos-gnu/simd/conversion.h b/lib/libc/include/any-macos-any/simd/conversion.h
similarity index 100%
rename from lib/libc/include/aarch64-macos-gnu/simd/conversion.h
rename to lib/libc/include/any-macos-any/simd/conversion.h
diff --git a/lib/libc/include/aarch64-macos-gnu/simd/logic.h b/lib/libc/include/any-macos-any/simd/logic.h
similarity index 100%
rename from lib/libc/include/aarch64-macos-gnu/simd/logic.h
rename to lib/libc/include/any-macos-any/simd/logic.h
diff --git a/lib/libc/include/aarch64-macos-gnu/simd/math.h b/lib/libc/include/any-macos-any/simd/math.h
similarity index 100%
rename from lib/libc/include/aarch64-macos-gnu/simd/math.h
rename to lib/libc/include/any-macos-any/simd/math.h
diff --git a/lib/libc/include/aarch64-macos-gnu/simd/packed.h b/lib/libc/include/any-macos-any/simd/packed.h
similarity index 100%
rename from lib/libc/include/aarch64-macos-gnu/simd/packed.h
rename to lib/libc/include/any-macos-any/simd/packed.h
diff --git a/lib/libc/include/aarch64-macos-gnu/simd/quaternion.h b/lib/libc/include/any-macos-any/simd/quaternion.h
similarity index 100%
rename from lib/libc/include/aarch64-macos-gnu/simd/quaternion.h
rename to lib/libc/include/any-macos-any/simd/quaternion.h
diff --git a/lib/libc/include/aarch64-macos-gnu/spawn.h b/lib/libc/include/any-macos-any/spawn.h
similarity index 100%
rename from lib/libc/include/aarch64-macos-gnu/spawn.h
rename to lib/libc/include/any-macos-any/spawn.h
diff --git a/lib/libc/include/aarch64-macos-gnu/stdio.h b/lib/libc/include/any-macos-any/stdio.h
similarity index 100%
rename from lib/libc/include/aarch64-macos-gnu/stdio.h
rename to lib/libc/include/any-macos-any/stdio.h
diff --git a/lib/libc/include/aarch64-macos-gnu/stdlib.h b/lib/libc/include/any-macos-any/stdlib.h
similarity index 100%
rename from lib/libc/include/aarch64-macos-gnu/stdlib.h
rename to lib/libc/include/any-macos-any/stdlib.h
diff --git a/lib/libc/include/aarch64-macos-gnu/string.h b/lib/libc/include/any-macos-any/string.h
similarity index 100%
rename from lib/libc/include/aarch64-macos-gnu/string.h
rename to lib/libc/include/any-macos-any/string.h
diff --git a/lib/libc/include/aarch64-macos-gnu/sys/_pthread/_pthread_attr_t.h b/lib/libc/include/any-macos-any/sys/_pthread/_pthread_attr_t.h
similarity index 100%
rename from lib/libc/include/aarch64-macos-gnu/sys/_pthread/_pthread_attr_t.h
rename to lib/libc/include/any-macos-any/sys/_pthread/_pthread_attr_t.h
diff --git a/lib/libc/include/aarch64-macos-gnu/sys/_pthread/_pthread_cond_t.h b/lib/libc/include/any-macos-any/sys/_pthread/_pthread_cond_t.h
similarity index 100%
rename from lib/libc/include/aarch64-macos-gnu/sys/_pthread/_pthread_cond_t.h
rename to lib/libc/include/any-macos-any/sys/_pthread/_pthread_cond_t.h
diff --git a/lib/libc/include/aarch64-macos-gnu/sys/_pthread/_pthread_condattr_t.h b/lib/libc/include/any-macos-any/sys/_pthread/_pthread_condattr_t.h
similarity index 100%
rename from lib/libc/include/aarch64-macos-gnu/sys/_pthread/_pthread_condattr_t.h
rename to lib/libc/include/any-macos-any/sys/_pthread/_pthread_condattr_t.h
diff --git a/lib/libc/include/aarch64-macos-gnu/sys/_pthread/_pthread_rwlock_t.h b/lib/libc/include/any-macos-any/sys/_pthread/_pthread_rwlock_t.h
similarity index 100%
rename from lib/libc/include/aarch64-macos-gnu/sys/_pthread/_pthread_rwlock_t.h
rename to lib/libc/include/any-macos-any/sys/_pthread/_pthread_rwlock_t.h
diff --git a/lib/libc/include/aarch64-macos-gnu/sys/_pthread/_pthread_rwlockattr_t.h b/lib/libc/include/any-macos-any/sys/_pthread/_pthread_rwlockattr_t.h
similarity index 100%
rename from lib/libc/include/aarch64-macos-gnu/sys/_pthread/_pthread_rwlockattr_t.h
rename to lib/libc/include/any-macos-any/sys/_pthread/_pthread_rwlockattr_t.h
diff --git a/lib/libc/include/aarch64-macos-gnu/sys/_pthread/_pthread_t.h b/lib/libc/include/any-macos-any/sys/_pthread/_pthread_t.h
similarity index 100%
rename from lib/libc/include/aarch64-macos-gnu/sys/_pthread/_pthread_t.h
rename to lib/libc/include/any-macos-any/sys/_pthread/_pthread_t.h
diff --git a/lib/libc/include/aarch64-macos-gnu/sys/_pthread/_pthread_types.h b/lib/libc/include/any-macos-any/sys/_pthread/_pthread_types.h
similarity index 100%
rename from lib/libc/include/aarch64-macos-gnu/sys/_pthread/_pthread_types.h
rename to lib/libc/include/any-macos-any/sys/_pthread/_pthread_types.h
diff --git a/lib/libc/include/aarch64-macos-gnu/sys/_select.h b/lib/libc/include/any-macos-any/sys/_select.h
similarity index 100%
rename from lib/libc/include/aarch64-macos-gnu/sys/_select.h
rename to lib/libc/include/any-macos-any/sys/_select.h
diff --git a/lib/libc/include/aarch64-macos-gnu/sys/_symbol_aliasing.h b/lib/libc/include/any-macos-any/sys/_symbol_aliasing.h
similarity index 100%
rename from lib/libc/include/aarch64-macos-gnu/sys/_symbol_aliasing.h
rename to lib/libc/include/any-macos-any/sys/_symbol_aliasing.h
diff --git a/lib/libc/include/aarch64-macos-gnu/sys/_types/_fd_def.h b/lib/libc/include/any-macos-any/sys/_types/_fd_def.h
similarity index 100%
rename from lib/libc/include/aarch64-macos-gnu/sys/_types/_fd_def.h
rename to lib/libc/include/any-macos-any/sys/_types/_fd_def.h
diff --git a/lib/libc/include/aarch64-macos-gnu/sys/_types/_int8_t.h b/lib/libc/include/any-macos-any/sys/_types/_int8_t.h
similarity index 100%
rename from lib/libc/include/aarch64-macos-gnu/sys/_types/_int8_t.h
rename to lib/libc/include/any-macos-any/sys/_types/_int8_t.h
diff --git a/lib/libc/include/aarch64-macos-gnu/sys/_types/_ucontext.h b/lib/libc/include/any-macos-any/sys/_types/_ucontext.h
similarity index 100%
rename from lib/libc/include/aarch64-macos-gnu/sys/_types/_ucontext.h
rename to lib/libc/include/any-macos-any/sys/_types/_ucontext.h
diff --git a/lib/libc/include/aarch64-macos-gnu/sys/acl.h b/lib/libc/include/any-macos-any/sys/acl.h
similarity index 100%
rename from lib/libc/include/aarch64-macos-gnu/sys/acl.h
rename to lib/libc/include/any-macos-any/sys/acl.h
diff --git a/lib/libc/include/aarch64-macos-gnu/sys/attr.h b/lib/libc/include/any-macos-any/sys/attr.h
similarity index 100%
rename from lib/libc/include/aarch64-macos-gnu/sys/attr.h
rename to lib/libc/include/any-macos-any/sys/attr.h
diff --git a/lib/libc/include/aarch64-macos-gnu/sys/cdefs.h b/lib/libc/include/any-macos-any/sys/cdefs.h
similarity index 100%
rename from lib/libc/include/aarch64-macos-gnu/sys/cdefs.h
rename to lib/libc/include/any-macos-any/sys/cdefs.h
diff --git a/lib/libc/include/aarch64-macos-gnu/sys/event.h b/lib/libc/include/any-macos-any/sys/event.h
similarity index 100%
rename from lib/libc/include/aarch64-macos-gnu/sys/event.h
rename to lib/libc/include/any-macos-any/sys/event.h
diff --git a/lib/libc/include/aarch64-macos-gnu/sys/fcntl.h b/lib/libc/include/any-macos-any/sys/fcntl.h
similarity index 100%
rename from lib/libc/include/aarch64-macos-gnu/sys/fcntl.h
rename to lib/libc/include/any-macos-any/sys/fcntl.h
diff --git a/lib/libc/include/aarch64-macos-gnu/sys/ioccom.h b/lib/libc/include/any-macos-any/sys/ioccom.h
similarity index 100%
rename from lib/libc/include/aarch64-macos-gnu/sys/ioccom.h
rename to lib/libc/include/any-macos-any/sys/ioccom.h
diff --git a/lib/libc/include/aarch64-macos-gnu/sys/kauth.h b/lib/libc/include/any-macos-any/sys/kauth.h
similarity index 100%
rename from lib/libc/include/aarch64-macos-gnu/sys/kauth.h
rename to lib/libc/include/any-macos-any/sys/kauth.h
diff --git a/lib/libc/include/aarch64-macos-gnu/sys/kern_control.h b/lib/libc/include/any-macos-any/sys/kern_control.h
similarity index 100%
rename from lib/libc/include/aarch64-macos-gnu/sys/kern_control.h
rename to lib/libc/include/any-macos-any/sys/kern_control.h
diff --git a/lib/libc/include/aarch64-macos-gnu/sys/mman.h b/lib/libc/include/any-macos-any/sys/mman.h
similarity index 100%
rename from lib/libc/include/aarch64-macos-gnu/sys/mman.h
rename to lib/libc/include/any-macos-any/sys/mman.h
diff --git a/lib/libc/include/aarch64-macos-gnu/sys/mount.h b/lib/libc/include/any-macos-any/sys/mount.h
similarity index 100%
rename from lib/libc/include/aarch64-macos-gnu/sys/mount.h
rename to lib/libc/include/any-macos-any/sys/mount.h
diff --git a/lib/libc/include/aarch64-macos-gnu/sys/param.h b/lib/libc/include/any-macos-any/sys/param.h
similarity index 100%
rename from lib/libc/include/aarch64-macos-gnu/sys/param.h
rename to lib/libc/include/any-macos-any/sys/param.h
diff --git a/lib/libc/include/aarch64-macos-gnu/sys/proc.h b/lib/libc/include/any-macos-any/sys/proc.h
similarity index 100%
rename from lib/libc/include/aarch64-macos-gnu/sys/proc.h
rename to lib/libc/include/any-macos-any/sys/proc.h
diff --git a/lib/libc/include/aarch64-macos-gnu/sys/proc_info.h b/lib/libc/include/any-macos-any/sys/proc_info.h
similarity index 100%
rename from lib/libc/include/aarch64-macos-gnu/sys/proc_info.h
rename to lib/libc/include/any-macos-any/sys/proc_info.h
diff --git a/lib/libc/include/aarch64-macos-gnu/sys/random.h b/lib/libc/include/any-macos-any/sys/random.h
similarity index 100%
rename from lib/libc/include/aarch64-macos-gnu/sys/random.h
rename to lib/libc/include/any-macos-any/sys/random.h
diff --git a/lib/libc/include/aarch64-macos-gnu/sys/resource.h b/lib/libc/include/any-macos-any/sys/resource.h
similarity index 100%
rename from lib/libc/include/aarch64-macos-gnu/sys/resource.h
rename to lib/libc/include/any-macos-any/sys/resource.h
diff --git a/lib/libc/include/aarch64-macos-gnu/sys/shm.h b/lib/libc/include/any-macos-any/sys/shm.h
similarity index 100%
rename from lib/libc/include/aarch64-macos-gnu/sys/shm.h
rename to lib/libc/include/any-macos-any/sys/shm.h
diff --git a/lib/libc/include/aarch64-macos-gnu/sys/socket.h b/lib/libc/include/any-macos-any/sys/socket.h
similarity index 100%
rename from lib/libc/include/aarch64-macos-gnu/sys/socket.h
rename to lib/libc/include/any-macos-any/sys/socket.h
diff --git a/lib/libc/include/aarch64-macos-gnu/sys/sockio.h b/lib/libc/include/any-macos-any/sys/sockio.h
similarity index 100%
rename from lib/libc/include/aarch64-macos-gnu/sys/sockio.h
rename to lib/libc/include/any-macos-any/sys/sockio.h
diff --git a/lib/libc/include/aarch64-macos-gnu/sys/spawn.h b/lib/libc/include/any-macos-any/sys/spawn.h
similarity index 100%
rename from lib/libc/include/aarch64-macos-gnu/sys/spawn.h
rename to lib/libc/include/any-macos-any/sys/spawn.h
diff --git a/lib/libc/include/aarch64-macos-gnu/sys/stat.h b/lib/libc/include/any-macos-any/sys/stat.h
similarity index 100%
rename from lib/libc/include/aarch64-macos-gnu/sys/stat.h
rename to lib/libc/include/any-macos-any/sys/stat.h
diff --git a/lib/libc/include/aarch64-macos-gnu/sys/sysctl.h b/lib/libc/include/any-macos-any/sys/sysctl.h
similarity index 100%
rename from lib/libc/include/aarch64-macos-gnu/sys/sysctl.h
rename to lib/libc/include/any-macos-any/sys/sysctl.h
diff --git a/lib/libc/include/aarch64-macos-gnu/sys/syslimits.h b/lib/libc/include/any-macos-any/sys/syslimits.h
similarity index 100%
rename from lib/libc/include/aarch64-macos-gnu/sys/syslimits.h
rename to lib/libc/include/any-macos-any/sys/syslimits.h
diff --git a/lib/libc/include/aarch64-macos-gnu/sys/ucontext.h b/lib/libc/include/any-macos-any/sys/ucontext.h
similarity index 100%
rename from lib/libc/include/aarch64-macos-gnu/sys/ucontext.h
rename to lib/libc/include/any-macos-any/sys/ucontext.h
diff --git a/lib/libc/include/aarch64-macos-gnu/sys/uio.h b/lib/libc/include/any-macos-any/sys/uio.h
similarity index 100%
rename from lib/libc/include/aarch64-macos-gnu/sys/uio.h
rename to lib/libc/include/any-macos-any/sys/uio.h
diff --git a/lib/libc/include/aarch64-macos-gnu/sys/un.h b/lib/libc/include/any-macos-any/sys/un.h
similarity index 100%
rename from lib/libc/include/aarch64-macos-gnu/sys/un.h
rename to lib/libc/include/any-macos-any/sys/un.h
diff --git a/lib/libc/include/aarch64-macos-gnu/ucontext.h b/lib/libc/include/any-macos-any/ucontext.h
similarity index 100%
rename from lib/libc/include/aarch64-macos-gnu/ucontext.h
rename to lib/libc/include/any-macos-any/ucontext.h
diff --git a/lib/libc/include/aarch64-macos-gnu/xlocale/_inttypes.h b/lib/libc/include/any-macos-any/xlocale/_inttypes.h
similarity index 100%
rename from lib/libc/include/aarch64-macos-gnu/xlocale/_inttypes.h
rename to lib/libc/include/any-macos-any/xlocale/_inttypes.h
diff --git a/lib/libc/include/aarch64-macos-gnu/xlocale/_wchar.h b/lib/libc/include/any-macos-any/xlocale/_wchar.h
similarity index 100%
rename from lib/libc/include/aarch64-macos-gnu/xlocale/_wchar.h
rename to lib/libc/include/any-macos-any/xlocale/_wchar.h
diff --git a/lib/libc/include/aarch64-macos-gnu/xpc/availability.h b/lib/libc/include/any-macos-any/xpc/availability.h
similarity index 100%
rename from lib/libc/include/aarch64-macos-gnu/xpc/availability.h
rename to lib/libc/include/any-macos-any/xpc/availability.h
diff --git a/lib/libc/include/aarch64-macos-gnu/xpc/base.h b/lib/libc/include/any-macos-any/xpc/base.h
similarity index 100%
rename from lib/libc/include/aarch64-macos-gnu/xpc/base.h
rename to lib/libc/include/any-macos-any/xpc/base.h
diff --git a/lib/libc/include/aarch64-macos-gnu/xpc/connection.h b/lib/libc/include/any-macos-any/xpc/connection.h
similarity index 100%
rename from lib/libc/include/aarch64-macos-gnu/xpc/connection.h
rename to lib/libc/include/any-macos-any/xpc/connection.h
diff --git a/lib/libc/include/aarch64-macos-gnu/xpc/xpc.h b/lib/libc/include/any-macos-any/xpc/xpc.h
similarity index 100%
rename from lib/libc/include/aarch64-macos-gnu/xpc/xpc.h
rename to lib/libc/include/any-macos-any/xpc/xpc.h
diff --git a/lib/libc/include/x86_64-macos-gnu/Availability.h b/lib/libc/include/x86_64-macos-gnu/Availability.h
deleted file mode 100644
index bdfd794d89..0000000000
--- a/lib/libc/include/x86_64-macos-gnu/Availability.h
+++ /dev/null
@@ -1,605 +0,0 @@
-/*
- * Copyright (c) 2007-2016 by Apple Inc.. All rights reserved.
- *
- * @APPLE_LICENSE_HEADER_START@
- *
- * This file contains Original Code and/or Modifications of Original Code
- * as defined in and that are subject to the Apple Public Source License
- * Version 2.0 (the 'License'). You may not use this file except in
- * compliance with the License. Please obtain a copy of the License at
- * http://www.opensource.apple.com/apsl/ and read it before using this
- * file.
- *
- * The Original Code and all software distributed under the License are
- * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
- * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
- * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
- * Please see the License for the specific language governing rights and
- * limitations under the License.
- *
- * @APPLE_LICENSE_HEADER_END@
- */
-
-#ifndef __AVAILABILITY__
-#define __AVAILABILITY__
- /*
- These macros are for use in OS header files. They enable function prototypes
- and Objective-C methods to be tagged with the OS version in which they
- were first available; and, if applicable, the OS version in which they
- became deprecated.
-
- The desktop Mac OS X and iOS each have different version numbers.
- The __OSX_AVAILABLE_STARTING() macro allows you to specify both the desktop
- and iOS version numbers. For instance:
- __OSX_AVAILABLE_STARTING(__MAC_10_2,__IPHONE_2_0)
- means the function/method was first available on Mac OS X 10.2 on the desktop
- and first available in iOS 2.0 on the iPhone.
-
- If a function is available on one platform, but not the other a _NA (not
- applicable) parameter is used. For instance:
- __OSX_AVAILABLE_STARTING(__MAC_10_3,__IPHONE_NA)
- means that the function/method was first available on Mac OS X 10.3, and it
- currently not implemented on the iPhone.
-
- At some point, a function/method may be deprecated. That means Apple
- recommends applications stop using the function, either because there is a
- better replacement or the functionality is being phased out. Deprecated
- functions/methods can be tagged with a __OSX_AVAILABLE_BUT_DEPRECATED()
- macro which specifies the OS version where the function became available
- as well as the OS version in which it became deprecated. For instance:
- __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_0,__MAC_10_5,__IPHONE_NA,__IPHONE_NA)
- means that the function/method was introduced in Mac OS X 10.0, then
- became deprecated beginning in Mac OS X 10.5. On iOS the function
- has never been available.
-
- For these macros to function properly, a program must specify the OS version range
- it is targeting. The min OS version is specified as an option to the compiler:
- -mmacosx-version-min=10.x when building for Mac OS X, and -miphoneos-version-min=y.z
- when building for the iPhone. The upper bound for the OS version is rarely needed,
- but it can be set on the command line via: -D__MAC_OS_X_VERSION_MAX_ALLOWED=10x0 for
- Mac OS X and __IPHONE_OS_VERSION_MAX_ALLOWED = y0z00 for iOS.
-
- Examples:
-
- A function available in Mac OS X 10.5 and later, but not on the phone:
-
- extern void mymacfunc() __OSX_AVAILABLE_STARTING(__MAC_10_5,__IPHONE_NA);
-
-
- An Objective-C method in Mac OS X 10.5 and later, but not on the phone:
-
- @interface MyClass : NSObject
- -(void) mymacmethod __OSX_AVAILABLE_STARTING(__MAC_10_5,__IPHONE_NA);
- @end
-
-
- An enum available on the phone, but not available on Mac OS X:
-
- #if __IPHONE_OS_VERSION_MIN_REQUIRED
- enum { myEnum = 1 };
- #endif
- Note: this works when targeting the Mac OS X platform because
- __IPHONE_OS_VERSION_MIN_REQUIRED is undefined which evaluates to zero.
-
-
- An enum with values added in different iPhoneOS versions:
-
- enum {
- myX = 1, // Usable on iPhoneOS 2.1 and later
- myY = 2, // Usable on iPhoneOS 3.0 and later
- myZ = 3, // Usable on iPhoneOS 3.0 and later
- ...
- Note: you do not want to use #if with enumeration values
- when a client needs to see all values at compile time
- and use runtime logic to only use the viable values.
-
-
- It is also possible to use the *_VERSION_MIN_REQUIRED in source code to make one
- source base that can be compiled to target a range of OS versions. It is best
- to not use the _MAC_* and __IPHONE_* macros for comparisons, but rather their values.
- That is because you might get compiled on an old OS that does not define a later
- OS version macro, and in the C preprocessor undefined values evaluate to zero
- in expresssions, which could cause the #if expression to evaluate in an unexpected
- way.
-
- #ifdef __MAC_OS_X_VERSION_MIN_REQUIRED
- // code only compiled when targeting Mac OS X and not iPhone
- // note use of 1050 instead of __MAC_10_5
- #if __MAC_OS_X_VERSION_MIN_REQUIRED < 1050
- // code in here might run on pre-Leopard OS
- #else
- // code here can assume Leopard or later
- #endif
- #endif
-
-
-*/
-
-/*
- * __API_TO_BE_DEPRECATED is used as a version number in API that will be deprecated
- * in an upcoming release. This soft deprecation is an intermediate step before formal
- * deprecation to notify developers about the API before compiler warnings are generated.
- * You can find all places in your code that use soft deprecated API by redefining the
- * value of this macro to your current minimum deployment target, for example:
- * (macOS)
- * clang -D__API_TO_BE_DEPRECATED=10.12
- * (iOS)
- * clang -D__API_TO_BE_DEPRECATED=11.0
- */
-
-#ifndef __API_TO_BE_DEPRECATED
-#define __API_TO_BE_DEPRECATED 100000
-#endif
-
-#ifndef __MAC_10_0
-#define __MAC_10_0 1000
-#define __MAC_10_1 1010
-#define __MAC_10_2 1020
-#define __MAC_10_3 1030
-#define __MAC_10_4 1040
-#define __MAC_10_5 1050
-#define __MAC_10_6 1060
-#define __MAC_10_7 1070
-#define __MAC_10_8 1080
-#define __MAC_10_9 1090
-#define __MAC_10_10 101000
-#define __MAC_10_10_2 101002
-#define __MAC_10_10_3 101003
-#define __MAC_10_11 101100
-#define __MAC_10_11_2 101102
-#define __MAC_10_11_3 101103
-#define __MAC_10_11_4 101104
-#define __MAC_10_12 101200
-#define __MAC_10_12_1 101201
-#define __MAC_10_12_2 101202
-#define __MAC_10_12_4 101204
-#define __MAC_10_13 101300
-#define __MAC_10_13_1 101301
-#define __MAC_10_13_2 101302
-#define __MAC_10_13_4 101304
-#define __MAC_10_14 101400
-#define __MAC_10_14_1 101401
-#define __MAC_10_14_4 101404
-#define __MAC_10_15 101500
-#define __MAC_10_15_1 101501
-#define __MAC_10_15_4 101504
-/* __MAC_NA is not defined to a value but is uses as a token by macros to indicate that the API is unavailable */
-
-#define __IPHONE_2_0 20000
-#define __IPHONE_2_1 20100
-#define __IPHONE_2_2 20200
-#define __IPHONE_3_0 30000
-#define __IPHONE_3_1 30100
-#define __IPHONE_3_2 30200
-#define __IPHONE_4_0 40000
-#define __IPHONE_4_1 40100
-#define __IPHONE_4_2 40200
-#define __IPHONE_4_3 40300
-#define __IPHONE_5_0 50000
-#define __IPHONE_5_1 50100
-#define __IPHONE_6_0 60000
-#define __IPHONE_6_1 60100
-#define __IPHONE_7_0 70000
-#define __IPHONE_7_1 70100
-#define __IPHONE_8_0 80000
-#define __IPHONE_8_1 80100
-#define __IPHONE_8_2 80200
-#define __IPHONE_8_3 80300
-#define __IPHONE_8_4 80400
-#define __IPHONE_9_0 90000
-#define __IPHONE_9_1 90100
-#define __IPHONE_9_2 90200
-#define __IPHONE_9_3 90300
-#define __IPHONE_10_0 100000
-#define __IPHONE_10_1 100100
-#define __IPHONE_10_2 100200
-#define __IPHONE_10_3 100300
-#define __IPHONE_11_0 110000
-#define __IPHONE_11_1 110100
-#define __IPHONE_11_2 110200
-#define __IPHONE_11_3 110300
-#define __IPHONE_11_4 110400
-#define __IPHONE_12_0 120000
-#define __IPHONE_12_1 120100
-#define __IPHONE_12_2 120200
-#define __IPHONE_12_3 120300
-#define __IPHONE_13_0 130000
-#define __IPHONE_13_1 130100
-#define __IPHONE_13_2 130200
-#define __IPHONE_13_3 130300
-#define __IPHONE_13_4 130400
-#define __IPHONE_13_5 130500
-#define __IPHONE_13_6 130600
-/* __IPHONE_NA is not defined to a value but is uses as a token by macros to indicate that the API is unavailable */
-
-#define __TVOS_9_0 90000
-#define __TVOS_9_1 90100
-#define __TVOS_9_2 90200
-#define __TVOS_10_0 100000
-#define __TVOS_10_0_1 100001
-#define __TVOS_10_1 100100
-#define __TVOS_10_2 100200
-#define __TVOS_11_0 110000
-#define __TVOS_11_1 110100
-#define __TVOS_11_2 110200
-#define __TVOS_11_3 110300
-#define __TVOS_11_4 110400
-#define __TVOS_12_0 120000
-#define __TVOS_12_1 120100
-#define __TVOS_12_2 120200
-#define __TVOS_12_3 120300
-#define __TVOS_13_0 130000
-#define __TVOS_13_2 130200
-#define __TVOS_13_3 130300
-#define __TVOS_13_4 130400
-
-#define __WATCHOS_1_0 10000
-#define __WATCHOS_2_0 20000
-#define __WATCHOS_2_1 20100
-#define __WATCHOS_2_2 20200
-#define __WATCHOS_3_0 30000
-#define __WATCHOS_3_1 30100
-#define __WATCHOS_3_1_1 30101
-#define __WATCHOS_3_2 30200
-#define __WATCHOS_4_0 40000
-#define __WATCHOS_4_1 40100
-#define __WATCHOS_4_2 40200
-#define __WATCHOS_4_3 40300
-#define __WATCHOS_5_0 50000
-#define __WATCHOS_5_1 50100
-#define __WATCHOS_5_2 50200
-#define __WATCHOS_6_0 60000
-#define __WATCHOS_6_1 60100
-#define __WATCHOS_6_2 60200
-
-#define __DRIVERKIT_19_0 190000
-#endif /* __MAC_10_0 */
-
-#include
-
-#ifdef __IPHONE_OS_VERSION_MIN_REQUIRED
- #define __OSX_AVAILABLE_STARTING(_osx, _ios) __AVAILABILITY_INTERNAL##_ios
- #define __OSX_AVAILABLE_BUT_DEPRECATED(_osxIntro, _osxDep, _iosIntro, _iosDep) \
- __AVAILABILITY_INTERNAL##_iosIntro##_DEP##_iosDep
- #define __OSX_AVAILABLE_BUT_DEPRECATED_MSG(_osxIntro, _osxDep, _iosIntro, _iosDep, _msg) \
- __AVAILABILITY_INTERNAL##_iosIntro##_DEP##_iosDep##_MSG(_msg)
-
-#elif defined(__MAC_OS_X_VERSION_MIN_REQUIRED)
-
- #if defined(__has_builtin)
- #if __has_builtin(__is_target_arch)
- #if __has_builtin(__is_target_vendor)
- #if __has_builtin(__is_target_os)
- #if __has_builtin(__is_target_environment)
- #if __has_builtin(__is_target_variant_os)
- #if __has_builtin(__is_target_variant_environment)
- #if (__is_target_arch(x86_64) && __is_target_vendor(apple) && ((__is_target_os(ios) && __is_target_environment(macabi)) || (__is_target_variant_os(ios) && __is_target_variant_environment(macabi))))
- #define __OSX_AVAILABLE_STARTING(_osx, _ios) __AVAILABILITY_INTERNAL##_osx __AVAILABILITY_INTERNAL##_ios
- #define __OSX_AVAILABLE_BUT_DEPRECATED(_osxIntro, _osxDep, _iosIntro, _iosDep) \
- __AVAILABILITY_INTERNAL##_osxIntro##_DEP##_osxDep __AVAILABILITY_INTERNAL##_iosIntro##_DEP##_iosDep
- #define __OSX_AVAILABLE_BUT_DEPRECATED_MSG(_osxIntro, _osxDep, _iosIntro, _iosDep, _msg) \
- __AVAILABILITY_INTERNAL##_osxIntro##_DEP##_osxDep##_MSG(_msg) __AVAILABILITY_INTERNAL##_iosIntro##_DEP##_iosDep##_MSG(_msg)
- #endif /* # if __is_target_arch... */
- #endif /* #if __has_builtin(__is_target_variant_environment) */
- #endif /* #if __has_builtin(__is_target_variant_os) */
- #endif /* #if __has_builtin(__is_target_environment) */
- #endif /* #if __has_builtin(__is_target_os) */
- #endif /* #if __has_builtin(__is_target_vendor) */
- #endif /* #if __has_builtin(__is_target_arch) */
- #endif /* #if defined(__has_builtin) */
-
- #ifndef __OSX_AVAILABLE_STARTING
- #if defined(__has_attribute) && defined(__has_feature)
- #if __has_attribute(availability)
- #define __OSX_AVAILABLE_STARTING(_osx, _ios) __AVAILABILITY_INTERNAL##_osx
- #define __OSX_AVAILABLE_BUT_DEPRECATED(_osxIntro, _osxDep, _iosIntro, _iosDep) \
- __AVAILABILITY_INTERNAL##_osxIntro##_DEP##_osxDep
- #define __OSX_AVAILABLE_BUT_DEPRECATED_MSG(_osxIntro, _osxDep, _iosIntro, _iosDep, _msg) \
- __AVAILABILITY_INTERNAL##_osxIntro##_DEP##_osxDep##_MSG(_msg)
- #else
- #define __OSX_AVAILABLE_STARTING(_osx, _ios)
- #define __OSX_AVAILABLE_BUT_DEPRECATED(_osxIntro, _osxDep, _iosIntro, _iosDep)
- #define __OSX_AVAILABLE_BUT_DEPRECATED_MSG(_osxIntro, _osxDep, _iosIntro, _iosDep, _msg)
- #endif
- #else
- #define __OSX_AVAILABLE_STARTING(_osx, _ios)
- #define __OSX_AVAILABLE_BUT_DEPRECATED(_osxIntro, _osxDep, _iosIntro, _iosDep)
- #define __OSX_AVAILABLE_BUT_DEPRECATED_MSG(_osxIntro, _osxDep, _iosIntro, _iosDep, _msg)
- #endif
-#endif /* __OSX_AVAILABLE_STARTING */
-
-#else
- #define __OSX_AVAILABLE_STARTING(_osx, _ios)
- #define __OSX_AVAILABLE_BUT_DEPRECATED(_osxIntro, _osxDep, _iosIntro, _iosDep)
- #define __OSX_AVAILABLE_BUT_DEPRECATED_MSG(_osxIntro, _osxDep, _iosIntro, _iosDep, _msg)
-#endif
-
-
-#if defined(__has_feature)
- #if __has_feature(attribute_availability_with_message)
- #define __OS_AVAILABILITY(_target, _availability) __attribute__((availability(_target,_availability)))
- #define __OS_AVAILABILITY_MSG(_target, _availability, _msg) __attribute__((availability(_target,_availability,message=_msg)))
- #elif __has_feature(attribute_availability)
- #define __OS_AVAILABILITY(_target, _availability) __attribute__((availability(_target,_availability)))
- #define __OS_AVAILABILITY_MSG(_target, _availability, _msg) __attribute__((availability(_target,_availability)))
- #else
- #define __OS_AVAILABILITY(_target, _availability)
- #define __OS_AVAILABILITY_MSG(_target, _availability, _msg)
- #endif
-#else
- #define __OS_AVAILABILITY(_target, _availability)
- #define __OS_AVAILABILITY_MSG(_target, _availability, _msg)
-#endif
-
-
-/* for use to document app extension usage */
-#if defined(__has_feature)
- #if __has_feature(attribute_availability_app_extension)
- #define __OSX_EXTENSION_UNAVAILABLE(_msg) __OS_AVAILABILITY_MSG(macosx_app_extension,unavailable,_msg)
- #define __IOS_EXTENSION_UNAVAILABLE(_msg) __OS_AVAILABILITY_MSG(ios_app_extension,unavailable,_msg)
- #else
- #define __OSX_EXTENSION_UNAVAILABLE(_msg)
- #define __IOS_EXTENSION_UNAVAILABLE(_msg)
- #endif
-#else
- #define __OSX_EXTENSION_UNAVAILABLE(_msg)
- #define __IOS_EXTENSION_UNAVAILABLE(_msg)
-#endif
-
-#define __OS_EXTENSION_UNAVAILABLE(_msg) __OSX_EXTENSION_UNAVAILABLE(_msg) __IOS_EXTENSION_UNAVAILABLE(_msg)
-
-
-
-/* for use marking APIs available info for Mac OSX */
-#if defined(__has_attribute)
- #if __has_attribute(availability)
- #define __OSX_UNAVAILABLE __OS_AVAILABILITY(macosx,unavailable)
- #define __OSX_AVAILABLE(_vers) __OS_AVAILABILITY(macosx,introduced=_vers)
- #define __OSX_DEPRECATED(_start, _dep, _msg) __OSX_AVAILABLE(_start) __OS_AVAILABILITY_MSG(macosx,deprecated=_dep,_msg)
- #endif
-#endif
-
-#ifndef __OSX_UNAVAILABLE
- #define __OSX_UNAVAILABLE
-#endif
-
-#ifndef __OSX_AVAILABLE
- #define __OSX_AVAILABLE(_vers)
-#endif
-
-#ifndef __OSX_DEPRECATED
- #define __OSX_DEPRECATED(_start, _dep, _msg)
-#endif
-
-
-/* for use marking APIs available info for iOS */
-#if defined(__has_attribute)
- #if __has_attribute(availability)
- #define __IOS_UNAVAILABLE __OS_AVAILABILITY(ios,unavailable)
- #define __IOS_PROHIBITED __OS_AVAILABILITY(ios,unavailable)
- #define __IOS_AVAILABLE(_vers) __OS_AVAILABILITY(ios,introduced=_vers)
- #define __IOS_DEPRECATED(_start, _dep, _msg) __IOS_AVAILABLE(_start) __OS_AVAILABILITY_MSG(ios,deprecated=_dep,_msg)
- #endif
-#endif
-
-#ifndef __IOS_UNAVAILABLE
- #define __IOS_UNAVAILABLE
-#endif
-
-#ifndef __IOS_PROHIBITED
- #define __IOS_PROHIBITED
-#endif
-
-#ifndef __IOS_AVAILABLE
- #define __IOS_AVAILABLE(_vers)
-#endif
-
-#ifndef __IOS_DEPRECATED
- #define __IOS_DEPRECATED(_start, _dep, _msg)
-#endif
-
-
-/* for use marking APIs available info for tvOS */
-#if defined(__has_feature)
- #if __has_feature(attribute_availability_tvos)
- #define __TVOS_UNAVAILABLE __OS_AVAILABILITY(tvos,unavailable)
- #define __TVOS_PROHIBITED __OS_AVAILABILITY(tvos,unavailable)
- #define __TVOS_AVAILABLE(_vers) __OS_AVAILABILITY(tvos,introduced=_vers)
- #define __TVOS_DEPRECATED(_start, _dep, _msg) __TVOS_AVAILABLE(_start) __OS_AVAILABILITY_MSG(tvos,deprecated=_dep,_msg)
- #endif
-#endif
-
-#ifndef __TVOS_UNAVAILABLE
- #define __TVOS_UNAVAILABLE
-#endif
-
-#ifndef __TVOS_PROHIBITED
- #define __TVOS_PROHIBITED
-#endif
-
-#ifndef __TVOS_AVAILABLE
- #define __TVOS_AVAILABLE(_vers)
-#endif
-
-#ifndef __TVOS_DEPRECATED
- #define __TVOS_DEPRECATED(_start, _dep, _msg)
-#endif
-
-
-/* for use marking APIs available info for Watch OS */
-#if defined(__has_feature)
- #if __has_feature(attribute_availability_watchos)
- #define __WATCHOS_UNAVAILABLE __OS_AVAILABILITY(watchos,unavailable)
- #define __WATCHOS_PROHIBITED __OS_AVAILABILITY(watchos,unavailable)
- #define __WATCHOS_AVAILABLE(_vers) __OS_AVAILABILITY(watchos,introduced=_vers)
- #define __WATCHOS_DEPRECATED(_start, _dep, _msg) __WATCHOS_AVAILABLE(_start) __OS_AVAILABILITY_MSG(watchos,deprecated=_dep,_msg)
- #endif
-#endif
-
-#ifndef __WATCHOS_UNAVAILABLE
- #define __WATCHOS_UNAVAILABLE
-#endif
-
-#ifndef __WATCHOS_PROHIBITED
- #define __WATCHOS_PROHIBITED
-#endif
-
-#ifndef __WATCHOS_AVAILABLE
- #define __WATCHOS_AVAILABLE(_vers)
-#endif
-
-#ifndef __WATCHOS_DEPRECATED
- #define __WATCHOS_DEPRECATED(_start, _dep, _msg)
-#endif
-
-
-/* for use marking APIs unavailable for swift */
-#if defined(__has_feature)
- #if __has_feature(attribute_availability_swift)
- #define __SWIFT_UNAVAILABLE __OS_AVAILABILITY(swift,unavailable)
- #define __SWIFT_UNAVAILABLE_MSG(_msg) __OS_AVAILABILITY_MSG(swift,unavailable,_msg)
- #endif
-#endif
-
-#ifndef __SWIFT_UNAVAILABLE
- #define __SWIFT_UNAVAILABLE
-#endif
-
-#ifndef __SWIFT_UNAVAILABLE_MSG
- #define __SWIFT_UNAVAILABLE_MSG(_msg)
-#endif
-
-/*
- Macros for defining which versions/platform a given symbol can be used.
-
- @see http://clang.llvm.org/docs/AttributeReference.html#availability
-
- * Note that these macros are only compatible with clang compilers that
- * support the following target selection options:
- *
- * -mmacosx-version-min
- * -miphoneos-version-min
- * -mwatchos-version-min
- * -mtvos-version-min
- */
-
-#if defined(__has_feature) && defined(__has_attribute)
- #if __has_attribute(availability)
-
- /*
- * API Introductions
- *
- * Use to specify the release that a particular API became available.
- *
- * Platform names:
- * macos, ios, tvos, watchos
- *
- * Examples:
- * __API_AVAILABLE(macos(10.10))
- * __API_AVAILABLE(macos(10.9), ios(10.0))
- * __API_AVAILABLE(macos(10.4), ios(8.0), watchos(2.0), tvos(10.0))
- * __API_AVAILABLE(driverkit(19.0))
- */
- #define __API_AVAILABLE(...) __API_AVAILABLE_GET_MACRO(__VA_ARGS__,__API_AVAILABLE7, __API_AVAILABLE6, __API_AVAILABLE5, __API_AVAILABLE4, __API_AVAILABLE3, __API_AVAILABLE2, __API_AVAILABLE1, 0)(__VA_ARGS__)
-
- #define __API_AVAILABLE_BEGIN(...) _Pragma("clang attribute push") __API_AVAILABLE_BEGIN_GET_MACRO(__VA_ARGS__,__API_AVAILABLE_BEGIN7, __API_AVAILABLE_BEGIN6, __API_AVAILABLE_BEGIN5, __API_AVAILABLE_BEGIN4, __API_AVAILABLE_BEGIN3, __API_AVAILABLE_BEGIN2, __API_AVAILABLE_BEGIN1, 0)(__VA_ARGS__)
- #define __API_AVAILABLE_END _Pragma("clang attribute pop")
-
- /*
- * API Deprecations
- *
- * Use to specify the release that a particular API became unavailable.
- *
- * Platform names:
- * macos, ios, tvos, watchos
- *
- * Examples:
- *
- * __API_DEPRECATED("No longer supported", macos(10.4, 10.8))
- * __API_DEPRECATED("No longer supported", macos(10.4, 10.8), ios(2.0, 3.0), watchos(2.0, 3.0), tvos(9.0, 10.0))
- *
- * __API_DEPRECATED_WITH_REPLACEMENT("-setName:", tvos(10.0, 10.4), ios(9.0, 10.0))
- * __API_DEPRECATED_WITH_REPLACEMENT("SomeClassName", macos(10.4, 10.6), watchos(2.0, 3.0))
- */
- #define __API_DEPRECATED(...) __API_DEPRECATED_MSG_GET_MACRO(__VA_ARGS__,__API_DEPRECATED_MSG8,__API_DEPRECATED_MSG7,__API_DEPRECATED_MSG6,__API_DEPRECATED_MSG5,__API_DEPRECATED_MSG4,__API_DEPRECATED_MSG3,__API_DEPRECATED_MSG2,__API_DEPRECATED_MSG1, 0)(__VA_ARGS__)
- #define __API_DEPRECATED_WITH_REPLACEMENT(...) __API_DEPRECATED_REP_GET_MACRO(__VA_ARGS__,__API_DEPRECATED_REP8,__API_DEPRECATED_REP7,__API_DEPRECATED_REP6,__API_DEPRECATED_REP5,__API_DEPRECATED_REP4,__API_DEPRECATED_REP3,__API_DEPRECATED_REP2,__API_DEPRECATED_REP1, 0)(__VA_ARGS__)
-
- #define __API_DEPRECATED_BEGIN(...) _Pragma("clang attribute push") __API_DEPRECATED_BEGIN_MSG_GET_MACRO(__VA_ARGS__,__API_DEPRECATED_BEGIN_MSG8,__API_DEPRECATED_BEGIN_MSG7, __API_DEPRECATED_BEGIN_MSG6, __API_DEPRECATED_BEGIN_MSG5, __API_DEPRECATED_BEGIN_MSG4, __API_DEPRECATED_BEGIN_MSG3, __API_DEPRECATED_BEGIN_MSG2, __API_DEPRECATED_BEGIN_MSG1, 0)(__VA_ARGS__)
- #define __API_DEPRECATED_END _Pragma("clang attribute pop")
-
- #define __API_DEPRECATED_WITH_REPLACEMENT_BEGIN(...) _Pragma("clang attribute push") __API_DEPRECATED_BEGIN_REP_GET_MACRO(__VA_ARGS__,__API_DEPRECATED_BEGIN_REP8,__API_DEPRECATED_BEGIN_REP7, __API_DEPRECATED_BEGIN_REP6, __API_DEPRECATED_BEGIN_REP5, __API_DEPRECATED_BEGIN_REP4, __API_DEPRECATED_BEGIN_REP3, __API_DEPRECATED_BEGIN_REP2, __API_DEPRECATED_BEGIN_REP1, 0)(__VA_ARGS__)
- #define __API_DEPRECATED_WITH_REPLACEMENT_END _Pragma("clang attribute pop")
-
- /*
- * API Unavailability
- * Use to specify that an API is unavailable for a particular platform.
- *
- * Example:
- * __API_UNAVAILABLE(macos)
- * __API_UNAVAILABLE(watchos, tvos)
- */
- #define __API_UNAVAILABLE(...) __API_UNAVAILABLE_GET_MACRO(__VA_ARGS__,__API_UNAVAILABLE7,__API_UNAVAILABLE6,__API_UNAVAILABLE5,__API_UNAVAILABLE4,__API_UNAVAILABLE3,__API_UNAVAILABLE2,__API_UNAVAILABLE1, 0)(__VA_ARGS__)
-
- #define __API_UNAVAILABLE_BEGIN(...) _Pragma("clang attribute push") __API_UNAVAILABLE_BEGIN_GET_MACRO(__VA_ARGS__,__API_UNAVAILABLE_BEGIN7,__API_UNAVAILABLE_BEGIN6, __API_UNAVAILABLE_BEGIN5, __API_UNAVAILABLE_BEGIN4, __API_UNAVAILABLE_BEGIN3, __API_UNAVAILABLE_BEGIN2, __API_UNAVAILABLE_BEGIN1, 0)(__VA_ARGS__)
- #define __API_UNAVAILABLE_END _Pragma("clang attribute pop")
- #else
-
- /*
- * Evaluate to nothing for compilers that don't support availability.
- */
-
- #define __API_AVAILABLE(...)
- #define __API_AVAILABLE_BEGIN(...)
- #define __API_AVAILABLE_END
- #define __API_DEPRECATED(...)
- #define __API_DEPRECATED_WITH_REPLACEMENT(...)
- #define __API_DEPRECATED_BEGIN(...)
- #define __API_DEPRECATED_END
- #define __API_DEPRECATED_WITH_REPLACEMENT_BEGIN(...)
- #define __API_DEPRECATED_WITH_REPLACEMENT_END
- #define __API_UNAVAILABLE(...)
- #define __API_UNAVAILABLE_BEGIN(...)
- #define __API_UNAVAILABLE_END
- #endif /* __has_attribute(availability) */
-#else
-
- /*
- * Evaluate to nothing for compilers that don't support clang language extensions.
- */
-
- #define __API_AVAILABLE(...)
- #define __API_AVAILABLE_BEGIN(...)
- #define __API_AVAILABLE_END
- #define __API_DEPRECATED(...)
- #define __API_DEPRECATED_WITH_REPLACEMENT(...)
- #define __API_DEPRECATED_BEGIN(...)
- #define __API_DEPRECATED_END
- #define __API_DEPRECATED_WITH_REPLACEMENT_BEGIN(...)
- #define __API_DEPRECATED_WITH_REPLACEMENT_END
- #define __API_UNAVAILABLE(...)
- #define __API_UNAVAILABLE_BEGIN(...)
- #define __API_UNAVAILABLE_END
-#endif /* #if defined(__has_feature) && defined(__has_attribute) */
-
-#if __has_include()
- #include
-#endif
-
-/*
- * If SPI decorations have not been defined elsewhere, disable them.
- */
-
-#ifndef __SPI_AVAILABLE
- #define __SPI_AVAILABLE(...)
-#endif
-
-#ifndef __SPI_DEPRECATED
- #define __SPI_DEPRECATED(...)
-#endif
-
-#ifndef __SPI_DEPRECATED_WITH_REPLACEMENT
- #define __SPI_DEPRECATED_WITH_REPLACEMENT(...)
-#endif
-
-#endif /* __AVAILABILITY__ */
\ No newline at end of file
diff --git a/lib/libc/include/x86_64-macos-gnu/AvailabilityInternal.h b/lib/libc/include/x86_64-macos-gnu/AvailabilityInternal.h
index 11e6d1ed17..6a35a16782 100644
--- a/lib/libc/include/x86_64-macos-gnu/AvailabilityInternal.h
+++ b/lib/libc/include/x86_64-macos-gnu/AvailabilityInternal.h
@@ -45,6 +45,9 @@
#ifdef __ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__
/* compiler sets __ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__ when -miphoneos-version-min is used */
#define __IPHONE_OS_VERSION_MIN_REQUIRED __ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__
+ /* set to 1 when RC_FALLBACK_PLATFORM=iphoneos */
+ #elif 0
+ #define __IPHONE_OS_VERSION_MIN_REQUIRED __IPHONE_14_0
#endif
#endif /* __IPHONE_OS_VERSION_MIN_REQUIRED */
@@ -52,7 +55,7 @@
#ifdef __ENVIRONMENT_TV_OS_VERSION_MIN_REQUIRED__
/* compiler sets __ENVIRONMENT_TV_OS_VERSION_MIN_REQUIRED__ when -mtvos-version-min is used */
#define __TV_OS_VERSION_MIN_REQUIRED __ENVIRONMENT_TV_OS_VERSION_MIN_REQUIRED__
- #define __TV_OS_VERSION_MAX_ALLOWED __TVOS_13_0
+ #define __TV_OS_VERSION_MAX_ALLOWED __TVOS_14_5
/* for compatibility with existing code. New code should use platform specific checks */
#define __IPHONE_OS_VERSION_MIN_REQUIRED 90000
#endif
@@ -62,7 +65,7 @@
#ifdef __ENVIRONMENT_WATCH_OS_VERSION_MIN_REQUIRED__
/* compiler sets __ENVIRONMENT_WATCH_OS_VERSION_MIN_REQUIRED__ when -mwatchos-version-min is used */
#define __WATCH_OS_VERSION_MIN_REQUIRED __ENVIRONMENT_WATCH_OS_VERSION_MIN_REQUIRED__
- #define __WATCH_OS_VERSION_MAX_ALLOWED 60000
+ #define __WATCH_OS_VERSION_MAX_ALLOWED __WATCHOS_7_4
/* for compatibility with existing code. New code should use platform specific checks */
#define __IPHONE_OS_VERSION_MIN_REQUIRED 90000
#endif
@@ -72,7 +75,7 @@
#ifdef __ENVIRONMENT_BRIDGE_OS_VERSION_MIN_REQUIRED__
#define __BRIDGE_OS_VERSION_MIN_REQUIRED __ENVIRONMENT_BRIDGE_OS_VERSION_MIN_REQUIRED__
- #define __BRIDGE_OS_VERSION_MAX_ALLOWED 20000
+ #define __BRIDGE_OS_VERSION_MAX_ALLOWED 50300
/* for compatibility with existing code. New code should use platform specific checks */
#define __IPHONE_OS_VERSION_MIN_REQUIRED 110000
#endif
@@ -87,14 +90,14 @@
#ifdef __MAC_OS_X_VERSION_MIN_REQUIRED
/* make sure a default max version is set */
#ifndef __MAC_OS_X_VERSION_MAX_ALLOWED
- #define __MAC_OS_X_VERSION_MAX_ALLOWED __MAC_10_15
+ #define __MAC_OS_X_VERSION_MAX_ALLOWED __MAC_11_3
#endif
#endif /* __MAC_OS_X_VERSION_MIN_REQUIRED */
#ifdef __IPHONE_OS_VERSION_MIN_REQUIRED
/* make sure a default max version is set */
#ifndef __IPHONE_OS_VERSION_MAX_ALLOWED
- #define __IPHONE_OS_VERSION_MAX_ALLOWED __IPHONE_13_0
+ #define __IPHONE_OS_VERSION_MAX_ALLOWED __IPHONE_14_5
#endif
/* make sure a valid min is set */
#if __IPHONE_OS_VERSION_MIN_REQUIRED < __IPHONE_2_0
@@ -2887,7 +2890,7 @@
#if __has_builtin(__is_target_environment)
#if __has_builtin(__is_target_variant_os)
#if __has_builtin(__is_target_variant_environment)
- #if (__is_target_arch(x86_64) && __is_target_vendor(apple) && __is_target_os(ios) && __is_target_environment(macabi))
+ #if ((__is_target_arch(x86_64) || __is_target_arch(arm64) || __is_target_arch(arm64e)) && __is_target_vendor(apple) && __is_target_os(ios) && __is_target_environment(macabi))
#define __AVAILABILITY_INTERNAL__IPHONE_COMPAT_VERSION __attribute__((availability(ios,introduced=4.0)))
#define __AVAILABILITY_INTERNAL__IPHONE_COMPAT_VERSION_DEP__IPHONE_COMPAT_VERSION __attribute__((availability(ios,unavailable)))
#define __AVAILABILITY_INTERNAL__IPHONE_COMPAT_VERSION_DEP__IPHONE_COMPAT_VERSION_MSG(_msg) __attribute__((availability(ios,unavailable)))
@@ -4643,7 +4646,7 @@
/*
* Swift compiler version
- * Allows for project-agnostic “epochs” for frameworks imported into Swift via the Clang importer, like #if _compiler_version for Swift
+ * Allows for project-agnostic "epochs" for frameworks imported into Swift via the Clang importer, like #if _compiler_version for Swift
* Example:
*
* #if __swift_compiler_version_at_least(800, 2, 20)
diff --git a/lib/libc/include/x86_64-macos-gnu/AvailabilityMacros.h b/lib/libc/include/x86_64-macos-gnu/AvailabilityMacros.h
index 9cc7100ffe..74537c5bd8 100644
--- a/lib/libc/include/x86_64-macos-gnu/AvailabilityMacros.h
+++ b/lib/libc/include/x86_64-macos-gnu/AvailabilityMacros.h
@@ -117,9 +117,11 @@
#define MAC_OS_X_VERSION_10_14_1 101401
#define MAC_OS_X_VERSION_10_14_4 101404
#define MAC_OS_X_VERSION_10_15 101500
-#define MAC_OS_X_VERSION_10_15_1 101501
+#define MAC_OS_VERSION_11_0 110000
+#define MAC_OS_VERSION_11_1 110100
+#define MAC_OS_VERSION_11_3 110300
-/*
+/*
* If min OS not specified, assume 10.4 for intel
* Note: compiler driver may set _ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED_ based on MACOSX_DEPLOYMENT_TARGET environment variable
*/
@@ -144,10 +146,10 @@
* if max OS not specified, assume larger of (10.15, min)
*/
#ifndef MAC_OS_X_VERSION_MAX_ALLOWED
- #if MAC_OS_X_VERSION_MIN_REQUIRED > MAC_OS_X_VERSION_10_15
+ #if MAC_OS_X_VERSION_MIN_REQUIRED > MAC_OS_VERSION_11_3
#define MAC_OS_X_VERSION_MAX_ALLOWED MAC_OS_X_VERSION_MIN_REQUIRED
#else
- #define MAC_OS_X_VERSION_MAX_ALLOWED MAC_OS_X_VERSION_10_15
+ #define MAC_OS_X_VERSION_MAX_ALLOWED MAC_OS_VERSION_11_3
#endif
#endif
diff --git a/lib/libc/include/x86_64-macos-gnu/AvailabilityVersions.h b/lib/libc/include/x86_64-macos-gnu/AvailabilityVersions.h
new file mode 100644
index 0000000000..591e541d7f
--- /dev/null
+++ b/lib/libc/include/x86_64-macos-gnu/AvailabilityVersions.h
@@ -0,0 +1,216 @@
+/*
+ * Copyright (c) 2019 by Apple Inc.. All rights reserved.
+ *
+ * @APPLE_LICENSE_HEADER_START@
+ *
+ * This file contains Original Code and/or Modifications of Original Code
+ * as defined in and that are subject to the Apple Public Source License
+ * Version 2.0 (the 'License'). You may not use this file except in
+ * compliance with the License. Please obtain a copy of the License at
+ * http://www.opensource.apple.com/apsl/ and read it before using this
+ * file.
+ *
+ * The Original Code and all software distributed under the License are
+ * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
+ * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
+ * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
+ * Please see the License for the specific language governing rights and
+ * limitations under the License.
+ *
+ * @APPLE_LICENSE_HEADER_END@
+ */
+
+#ifndef __AVAILABILITY_VERSIONS__
+#define __AVAILABILITY_VERSIONS__
+
+#define __MAC_10_0 1000
+#define __MAC_10_1 1010
+#define __MAC_10_2 1020
+#define __MAC_10_3 1030
+#define __MAC_10_4 1040
+#define __MAC_10_5 1050
+#define __MAC_10_6 1060
+#define __MAC_10_7 1070
+#define __MAC_10_8 1080
+#define __MAC_10_9 1090
+#define __MAC_10_10 101000
+#define __MAC_10_10_2 101002
+#define __MAC_10_10_3 101003
+#define __MAC_10_11 101100
+#define __MAC_10_11_2 101102
+#define __MAC_10_11_3 101103
+#define __MAC_10_11_4 101104
+#define __MAC_10_12 101200
+#define __MAC_10_12_1 101201
+#define __MAC_10_12_2 101202
+#define __MAC_10_12_4 101204
+#define __MAC_10_13 101300
+#define __MAC_10_13_1 101301
+#define __MAC_10_13_2 101302
+#define __MAC_10_13_4 101304
+#define __MAC_10_14 101400
+#define __MAC_10_14_1 101401
+#define __MAC_10_14_4 101404
+#define __MAC_10_14_6 101406
+#define __MAC_10_15 101500
+#define __MAC_10_15_1 101501
+#define __MAC_10_15_4 101504
+#define __MAC_10_16 101600
+#define __MAC_11_0 110000
+#define __MAC_11_1 110100
+#define __MAC_11_3 110300
+/* __MAC_NA is not defined to a value but is used as a token by macros to indicate that the API is unavailable */
+
+#define __IPHONE_2_0 20000
+#define __IPHONE_2_1 20100
+#define __IPHONE_2_2 20200
+#define __IPHONE_3_0 30000
+#define __IPHONE_3_1 30100
+#define __IPHONE_3_2 30200
+#define __IPHONE_4_0 40000
+#define __IPHONE_4_1 40100
+#define __IPHONE_4_2 40200
+#define __IPHONE_4_3 40300
+#define __IPHONE_5_0 50000
+#define __IPHONE_5_1 50100
+#define __IPHONE_6_0 60000
+#define __IPHONE_6_1 60100
+#define __IPHONE_7_0 70000
+#define __IPHONE_7_1 70100
+#define __IPHONE_8_0 80000
+#define __IPHONE_8_1 80100
+#define __IPHONE_8_2 80200
+#define __IPHONE_8_3 80300
+#define __IPHONE_8_4 80400
+#define __IPHONE_9_0 90000
+#define __IPHONE_9_1 90100
+#define __IPHONE_9_2 90200
+#define __IPHONE_9_3 90300
+#define __IPHONE_10_0 100000
+#define __IPHONE_10_1 100100
+#define __IPHONE_10_2 100200
+#define __IPHONE_10_3 100300
+#define __IPHONE_11_0 110000
+#define __IPHONE_11_1 110100
+#define __IPHONE_11_2 110200
+#define __IPHONE_11_3 110300
+#define __IPHONE_11_4 110400
+#define __IPHONE_12_0 120000
+#define __IPHONE_12_1 120100
+#define __IPHONE_12_2 120200
+#define __IPHONE_12_3 120300
+#define __IPHONE_12_4 120400
+#define __IPHONE_13_0 130000
+#define __IPHONE_13_1 130100
+#define __IPHONE_13_2 130200
+#define __IPHONE_13_3 130300
+#define __IPHONE_13_4 130400
+#define __IPHONE_13_5 130500
+#define __IPHONE_13_6 130600
+#define __IPHONE_13_7 130700
+#define __IPHONE_14_0 140000
+#define __IPHONE_14_1 140100
+#define __IPHONE_14_2 140200
+#define __IPHONE_14_3 140300
+#define __IPHONE_14_5 140500
+/* __IPHONE_NA is not defined to a value but is used as a token by macros to indicate that the API is unavailable */
+
+#define __TVOS_9_0 90000
+#define __TVOS_9_1 90100
+#define __TVOS_9_2 90200
+#define __TVOS_10_0 100000
+#define __TVOS_10_0_1 100001
+#define __TVOS_10_1 100100
+#define __TVOS_10_2 100200
+#define __TVOS_11_0 110000
+#define __TVOS_11_1 110100
+#define __TVOS_11_2 110200
+#define __TVOS_11_3 110300
+#define __TVOS_11_4 110400
+#define __TVOS_12_0 120000
+#define __TVOS_12_1 120100
+#define __TVOS_12_2 120200
+#define __TVOS_12_3 120300
+#define __TVOS_12_4 120400
+#define __TVOS_13_0 130000
+#define __TVOS_13_2 130200
+#define __TVOS_13_3 130300
+#define __TVOS_13_4 130400
+#define __TVOS_14_0 140000
+#define __TVOS_14_1 140100
+#define __TVOS_14_2 140200
+#define __TVOS_14_3 140300
+#define __TVOS_14_5 140500
+
+#define __WATCHOS_1_0 10000
+#define __WATCHOS_2_0 20000
+#define __WATCHOS_2_1 20100
+#define __WATCHOS_2_2 20200
+#define __WATCHOS_3_0 30000
+#define __WATCHOS_3_1 30100
+#define __WATCHOS_3_1_1 30101
+#define __WATCHOS_3_2 30200
+#define __WATCHOS_4_0 40000
+#define __WATCHOS_4_1 40100
+#define __WATCHOS_4_2 40200
+#define __WATCHOS_4_3 40300
+#define __WATCHOS_5_0 50000
+#define __WATCHOS_5_1 50100
+#define __WATCHOS_5_2 50200
+#define __WATCHOS_5_3 50300
+#define __WATCHOS_6_0 60000
+#define __WATCHOS_6_1 60100
+#define __WATCHOS_6_2 60200
+#define __WATCHOS_7_0 70000
+#define __WATCHOS_7_1 70100
+#define __WATCHOS_7_2 70200
+#define __WATCHOS_7_3 70300
+#define __WATCHOS_7_4 70400
+
+/*
+ * Set up standard Mac OS X versions
+ */
+
+#if (!defined(_POSIX_C_SOURCE) && !defined(_XOPEN_SOURCE)) || defined(_DARWIN_C_SOURCE)
+
+#define MAC_OS_X_VERSION_10_0 1000
+#define MAC_OS_X_VERSION_10_1 1010
+#define MAC_OS_X_VERSION_10_2 1020
+#define MAC_OS_X_VERSION_10_3 1030
+#define MAC_OS_X_VERSION_10_4 1040
+#define MAC_OS_X_VERSION_10_5 1050
+#define MAC_OS_X_VERSION_10_6 1060
+#define MAC_OS_X_VERSION_10_7 1070
+#define MAC_OS_X_VERSION_10_8 1080
+#define MAC_OS_X_VERSION_10_9 1090
+#define MAC_OS_X_VERSION_10_10 101000
+#define MAC_OS_X_VERSION_10_10_2 101002
+#define MAC_OS_X_VERSION_10_10_3 101003
+#define MAC_OS_X_VERSION_10_11 101100
+#define MAC_OS_X_VERSION_10_11_2 101102
+#define MAC_OS_X_VERSION_10_11_3 101103
+#define MAC_OS_X_VERSION_10_11_4 101104
+#define MAC_OS_X_VERSION_10_12 101200
+#define MAC_OS_X_VERSION_10_12_1 101201
+#define MAC_OS_X_VERSION_10_12_2 101202
+#define MAC_OS_X_VERSION_10_12_4 101204
+#define MAC_OS_X_VERSION_10_13 101300
+#define MAC_OS_X_VERSION_10_13_1 101301
+#define MAC_OS_X_VERSION_10_13_2 101302
+#define MAC_OS_X_VERSION_10_13_4 101304
+#define MAC_OS_X_VERSION_10_14 101400
+#define MAC_OS_X_VERSION_10_14_1 101401
+#define MAC_OS_X_VERSION_10_14_4 101404
+#define MAC_OS_X_VERSION_10_14_6 101406
+#define MAC_OS_X_VERSION_10_15 101500
+#define MAC_OS_X_VERSION_10_15_1 101501
+#define MAC_OS_X_VERSION_10_16 101600
+#define MAC_OS_VERSION_11_0 110000
+
+#endif /* #if (!defined(_POSIX_C_SOURCE) && !defined(_XOPEN_SOURCE)) || defined(_DARWIN_C_SOURCE) */
+
+#define __DRIVERKIT_19_0 190000
+#define __DRIVERKIT_20_0 200000
+
+#endif /* __AVAILABILITY_VERSIONS__ */
\ No newline at end of file
diff --git a/lib/libc/include/x86_64-macos-gnu/TargetConditionals.h b/lib/libc/include/x86_64-macos-gnu/TargetConditionals.h
deleted file mode 100644
index 896956f33d..0000000000
--- a/lib/libc/include/x86_64-macos-gnu/TargetConditionals.h
+++ /dev/null
@@ -1,502 +0,0 @@
-/*
- * Copyright (c) 2000-2014 by Apple Inc.. All rights reserved.
- *
- * @APPLE_LICENSE_HEADER_START@
- *
- * This file contains Original Code and/or Modifications of Original Code
- * as defined in and that are subject to the Apple Public Source License
- * Version 2.0 (the 'License'). You may not use this file except in
- * compliance with the License. Please obtain a copy of the License at
- * http://www.opensource.apple.com/apsl/ and read it before using this
- * file.
- *
- * The Original Code and all software distributed under the License are
- * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
- * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
- * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
- * Please see the License for the specific language governing rights and
- * limitations under the License.
- *
- * @APPLE_LICENSE_HEADER_END@
- */
-
-/*
- File: TargetConditionals.h
-
- Contains: Autoconfiguration of TARGET_ conditionals for Mac OS X and iPhone
-
- Note: TargetConditionals.h in 3.4 Universal Interfaces works
- with all compilers. This header only recognizes compilers
- known to run on Mac OS X.
-
-*/
-
-#ifndef __TARGETCONDITIONALS__
-#define __TARGETCONDITIONALS__
-
-/****************************************************************************************************
-
- TARGET_CPU_*
- These conditionals specify which microprocessor instruction set is being
- generated. At most one of these is true, the rest are false.
-
- TARGET_CPU_PPC - Compiler is generating PowerPC instructions for 32-bit mode
- TARGET_CPU_PPC64 - Compiler is generating PowerPC instructions for 64-bit mode
- TARGET_CPU_68K - Compiler is generating 680x0 instructions
- TARGET_CPU_X86 - Compiler is generating x86 instructions for 32-bit mode
- TARGET_CPU_X86_64 - Compiler is generating x86 instructions for 64-bit mode
- TARGET_CPU_ARM - Compiler is generating ARM instructions for 32-bit mode
- TARGET_CPU_ARM64 - Compiler is generating ARM instructions for 64-bit mode
- TARGET_CPU_MIPS - Compiler is generating MIPS instructions
- TARGET_CPU_SPARC - Compiler is generating Sparc instructions
- TARGET_CPU_ALPHA - Compiler is generating Dec Alpha instructions
-
-
- TARGET_OS_*
- These conditionals specify in which Operating System the generated code will
- run. Indention is used to show which conditionals are evolutionary subclasses.
-
- The MAC/WIN32/UNIX conditionals are mutually exclusive.
- The IOS/TV/WATCH conditionals are mutually exclusive.
-
-
- TARGET_OS_WIN32 - Generated code will run under 32-bit Windows
- TARGET_OS_UNIX - Generated code will run under some Unix (not OSX)
- TARGET_OS_MAC - Generated code will run under Mac OS X variant
- TARGET_OS_OSX - Generated code will run under OS X devices
- TARGET_OS_IPHONE - Generated code for firmware, devices, or simulator
- TARGET_OS_IOS - Generated code will run under iOS
- TARGET_OS_TV - Generated code will run under Apple TV OS
- TARGET_OS_WATCH - Generated code will run under Apple Watch OS
- TARGET_OS_BRIDGE - Generated code will run under Bridge devices
- TARGET_OS_MACCATALYST - Generated code will run under macOS
- TARGET_OS_SIMULATOR - Generated code will run under a simulator
-
- TARGET_OS_EMBEDDED - DEPRECATED: Use TARGET_OS_IPHONE and/or TARGET_OS_SIMULATOR instead
- TARGET_IPHONE_SIMULATOR - DEPRECATED: Same as TARGET_OS_SIMULATOR
- TARGET_OS_NANO - DEPRECATED: Same as TARGET_OS_WATCH
-
- +----------------------------------------------------------------+
- | TARGET_OS_MAC |
- | +---+ +-----------------------------------------------------+ |
- | | | | TARGET_OS_IPHONE | |
- | |OSX| | +-----+ +----+ +-------+ +--------+ +-------------+ | |
- | | | | | IOS | | TV | | WATCH | | BRIDGE | | MACCATALYST | | |
- | | | | +-----+ +----+ +-------+ +--------+ +-------------+ | |
- | +---+ +-----------------------------------------------------+ |
- +----------------------------------------------------------------+
-
- TARGET_RT_*
- These conditionals specify in which runtime the generated code will
- run. This is needed when the OS and CPU support more than one runtime
- (e.g. Mac OS X supports CFM and mach-o).
-
- TARGET_RT_LITTLE_ENDIAN - Generated code uses little endian format for integers
- TARGET_RT_BIG_ENDIAN - Generated code uses big endian format for integers
- TARGET_RT_64_BIT - Generated code uses 64-bit pointers
- TARGET_RT_MAC_CFM - TARGET_OS_MAC is true and CFM68K or PowerPC CFM (TVectors) are used
- TARGET_RT_MAC_MACHO - TARGET_OS_MAC is true and Mach-O/dlyd runtime is used
-
-
-****************************************************************************************************/
-
- /*
- * TARGET_OS conditionals can be enabled via clang preprocessor extensions:
- *
- * __is_target_arch
- * __is_target_vendor
- * __is_target_os
- * __is_target_environment
- *
- * “-target=x86_64-apple-ios12-macabi”
- * TARGET_OS_MAC=1
- * TARGET_OS_IPHONE=1
- * TARGET_OS_IOS=1
- * TARGET_OS_MACCATALYST=1
- *
- * “-target=x86_64-apple-ios12-simulator”
- * TARGET_OS_MAC=1
- * TARGET_OS_IPHONE=1
- * TARGET_OS_IOS=1
- * TARGET_OS_SIMULATOR=1
- *
- * DYNAMIC_TARGETS_ENABLED indicates that the core TARGET_OS macros were enabled via clang preprocessor extensions.
- * If this value is not set, the macro enablements will fall back to the static behavior.
- * It is disabled by default.
- */
-
-#if defined(__has_builtin)
- #if __has_builtin(__is_target_arch)
- #if __has_builtin(__is_target_vendor)
- #if __has_builtin(__is_target_os)
- #if __has_builtin(__is_target_environment)
-
- /* “-target=x86_64-apple-ios12-macabi” */
- #if __is_target_arch(x86_64) && __is_target_vendor(apple) && __is_target_os(ios) && __is_target_environment(macabi)
- #define TARGET_OS_OSX 0
- #define TARGET_OS_IPHONE 1
- #define TARGET_OS_IOS 1
- #define TARGET_OS_WATCH 0
-
- #define TARGET_OS_TV 0
- #define TARGET_OS_SIMULATOR 0
- #define TARGET_OS_EMBEDDED 0
- #define TARGET_OS_RTKIT 0
- #define TARGET_OS_MACCATALYST 1
- #define TARGET_OS_MACCATALYST 1
- #ifndef TARGET_OS_UIKITFORMAC
- #define TARGET_OS_UIKITFORMAC 1
- #endif
- #define TARGET_OS_DRIVERKIT 0
- #define DYNAMIC_TARGETS_ENABLED 1
- #endif
-
- /* “-target=x86_64-apple-ios12-simulator” */
- #if __is_target_arch(x86_64) && __is_target_vendor(apple) && __is_target_os(ios) && __is_target_environment(simulator)
- #define TARGET_OS_OSX 0
- #define TARGET_OS_IPHONE 1
- #define TARGET_OS_IOS 1
- #define TARGET_OS_WATCH 0
-
- #define TARGET_OS_TV 0
- #define TARGET_OS_SIMULATOR 1
- #define TARGET_OS_EMBEDDED 0
- #define TARGET_OS_RTKIT 0
- #define TARGET_OS_MACCATALYST 0
- #define TARGET_OS_MACCATALYST 0
- #ifndef TARGET_OS_UIKITFORMAC
- #define TARGET_OS_UIKITFORMAC 0
- #endif
- #define TARGET_OS_DRIVERKIT 0
- #define DYNAMIC_TARGETS_ENABLED 1
- #endif
-
- /* -target=x86_64-apple-driverkit19.0 */
- #if __is_target_arch(x86_64) && __is_target_vendor(apple) && __is_target_os(driverkit)
- #define TARGET_OS_OSX 0
- #define TARGET_OS_IPHONE 0
- #define TARGET_OS_IOS 0
- #define TARGET_OS_WATCH 0
-
- #define TARGET_OS_TV 0
- #define TARGET_OS_SIMULATOR 0
- #define TARGET_OS_EMBEDDED 0
- #define TARGET_OS_RTKIT 0
- #define TARGET_OS_MACCATALYST 0
- #define TARGET_OS_MACCATALYST 0
- #ifndef TARGET_OS_UIKITFORMAC
- #define TARGET_OS_UIKITFORMAC 0
- #endif
- #define TARGET_OS_DRIVERKIT 1
- #define DYNAMIC_TARGETS_ENABLED 1
- #endif
-
- #endif /* #if __has_builtin(__is_target_environment) */
- #endif /* #if __has_builtin(__is_target_os) */
- #endif /* #if __has_builtin(__is_target_vendor) */
- #endif /* #if __has_builtin(__is_target_arch) */
-#endif /* #if defined(__has_builtin) */
-
-
-#ifndef DYNAMIC_TARGETS_ENABLED
- #define DYNAMIC_TARGETS_ENABLED 0
-#endif /* DYNAMIC_TARGETS_ENABLED */
-
-/*
- * gcc based compiler used on Mac OS X
- */
-#if defined(__GNUC__) && ( defined(__APPLE_CPP__) || defined(__APPLE_CC__) || defined(__MACOS_CLASSIC__) )
- #define TARGET_OS_MAC 1
- #define TARGET_OS_WIN32 0
- #define TARGET_OS_UNIX 0
-
- #if !DYNAMIC_TARGETS_ENABLED
- #define TARGET_OS_OSX 1
- #define TARGET_OS_IPHONE 0
- #define TARGET_OS_IOS 0
- #define TARGET_OS_WATCH 0
-
- #define TARGET_OS_TV 0
- #define TARGET_OS_MACCATALYST 0
- #define TARGET_OS_MACCATALYST 0
- #ifndef TARGET_OS_UIKITFORMAC
- #define TARGET_OS_UIKITFORMAC 0
- #endif
- #define TARGET_OS_SIMULATOR 0
- #define TARGET_OS_EMBEDDED 0
- #define TARGET_OS_RTKIT 0
- #define TARGET_OS_DRIVERKIT 0
- #endif
-
- #define TARGET_IPHONE_SIMULATOR TARGET_OS_SIMULATOR /* deprecated */
- #define TARGET_OS_NANO TARGET_OS_WATCH /* deprecated */
- #define TARGET_ABI_USES_IOS_VALUES (TARGET_OS_IPHONE && !TARGET_OS_MACCATALYST)
- #if defined(__ppc__)
- #define TARGET_CPU_PPC 1
- #define TARGET_CPU_PPC64 0
- #define TARGET_CPU_68K 0
- #define TARGET_CPU_X86 0
- #define TARGET_CPU_X86_64 0
- #define TARGET_CPU_ARM 0
- #define TARGET_CPU_ARM64 0
- #define TARGET_CPU_MIPS 0
- #define TARGET_CPU_SPARC 0
- #define TARGET_CPU_ALPHA 0
- #define TARGET_RT_LITTLE_ENDIAN 0
- #define TARGET_RT_BIG_ENDIAN 1
- #define TARGET_RT_64_BIT 0
- #ifdef __MACOS_CLASSIC__
- #define TARGET_RT_MAC_CFM 1
- #define TARGET_RT_MAC_MACHO 0
- #else
- #define TARGET_RT_MAC_CFM 0
- #define TARGET_RT_MAC_MACHO 1
- #endif
- #elif defined(__ppc64__)
- #define TARGET_CPU_PPC 0
- #define TARGET_CPU_PPC64 1
- #define TARGET_CPU_68K 0
- #define TARGET_CPU_X86 0
- #define TARGET_CPU_X86_64 0
- #define TARGET_CPU_ARM 0
- #define TARGET_CPU_ARM64 0
- #define TARGET_CPU_MIPS 0
- #define TARGET_CPU_SPARC 0
- #define TARGET_CPU_ALPHA 0
- #define TARGET_RT_LITTLE_ENDIAN 0
- #define TARGET_RT_BIG_ENDIAN 1
- #define TARGET_RT_64_BIT 1
- #define TARGET_RT_MAC_CFM 0
- #define TARGET_RT_MAC_MACHO 1
- #elif defined(__i386__)
- #define TARGET_CPU_PPC 0
- #define TARGET_CPU_PPC64 0
- #define TARGET_CPU_68K 0
- #define TARGET_CPU_X86 1
- #define TARGET_CPU_X86_64 0
- #define TARGET_CPU_ARM 0
- #define TARGET_CPU_ARM64 0
- #define TARGET_CPU_MIPS 0
- #define TARGET_CPU_SPARC 0
- #define TARGET_CPU_ALPHA 0
- #define TARGET_RT_MAC_CFM 0
- #define TARGET_RT_MAC_MACHO 1
- #define TARGET_RT_LITTLE_ENDIAN 1
- #define TARGET_RT_BIG_ENDIAN 0
- #define TARGET_RT_64_BIT 0
- #elif defined(__x86_64__)
- #define TARGET_CPU_PPC 0
- #define TARGET_CPU_PPC64 0
- #define TARGET_CPU_68K 0
- #define TARGET_CPU_X86 0
- #define TARGET_CPU_X86_64 1
- #define TARGET_CPU_ARM 0
- #define TARGET_CPU_ARM64 0
- #define TARGET_CPU_MIPS 0
- #define TARGET_CPU_SPARC 0
- #define TARGET_CPU_ALPHA 0
- #define TARGET_RT_MAC_CFM 0
- #define TARGET_RT_MAC_MACHO 1
- #define TARGET_RT_LITTLE_ENDIAN 1
- #define TARGET_RT_BIG_ENDIAN 0
- #define TARGET_RT_64_BIT 1
- #elif defined(__arm__)
- #define TARGET_CPU_PPC 0
- #define TARGET_CPU_PPC64 0
- #define TARGET_CPU_68K 0
- #define TARGET_CPU_X86 0
- #define TARGET_CPU_X86_64 0
- #define TARGET_CPU_ARM 1
- #define TARGET_CPU_ARM64 0
- #define TARGET_CPU_MIPS 0
- #define TARGET_CPU_SPARC 0
- #define TARGET_CPU_ALPHA 0
- #define TARGET_RT_MAC_CFM 0
- #define TARGET_RT_MAC_MACHO 1
- #define TARGET_RT_LITTLE_ENDIAN 1
- #define TARGET_RT_BIG_ENDIAN 0
- #define TARGET_RT_64_BIT 0
- #elif defined(__arm64__)
- #define TARGET_CPU_PPC 0
- #define TARGET_CPU_PPC64 0
- #define TARGET_CPU_68K 0
- #define TARGET_CPU_X86 0
- #define TARGET_CPU_X86_64 0
- #define TARGET_CPU_ARM 0
- #define TARGET_CPU_ARM64 1
- #define TARGET_CPU_MIPS 0
- #define TARGET_CPU_SPARC 0
- #define TARGET_CPU_ALPHA 0
- #define TARGET_RT_MAC_CFM 0
- #define TARGET_RT_MAC_MACHO 1
- #define TARGET_RT_LITTLE_ENDIAN 1
- #define TARGET_RT_BIG_ENDIAN 0
- #if __LP64__
- #define TARGET_RT_64_BIT 1
- #else
- #define TARGET_RT_64_BIT 0
- #endif
- #else
- #error unrecognized GNU C compiler
- #endif
-
-
-
-/*
- * CodeWarrior compiler from Metrowerks/Motorola
- */
-#elif defined(__MWERKS__)
- #define TARGET_OS_MAC 1
- #define TARGET_OS_WIN32 0
- #define TARGET_OS_UNIX 0
- #define TARGET_OS_EMBEDDED 0
- #if defined(__POWERPC__)
- #define TARGET_CPU_PPC 1
- #define TARGET_CPU_PPC64 0
- #define TARGET_CPU_68K 0
- #define TARGET_CPU_X86 0
- #define TARGET_CPU_MIPS 0
- #define TARGET_CPU_SPARC 0
- #define TARGET_CPU_ALPHA 0
- #define TARGET_RT_LITTLE_ENDIAN 0
- #define TARGET_RT_BIG_ENDIAN 1
- #elif defined(__INTEL__)
- #define TARGET_CPU_PPC 0
- #define TARGET_CPU_PPC64 0
- #define TARGET_CPU_68K 0
- #define TARGET_CPU_X86 1
- #define TARGET_CPU_MIPS 0
- #define TARGET_CPU_SPARC 0
- #define TARGET_CPU_ALPHA 0
- #define TARGET_RT_LITTLE_ENDIAN 1
- #define TARGET_RT_BIG_ENDIAN 0
- #else
- #error unknown Metrowerks CPU type
- #endif
- #define TARGET_RT_64_BIT 0
- #ifdef __MACH__
- #define TARGET_RT_MAC_CFM 0
- #define TARGET_RT_MAC_MACHO 1
- #else
- #define TARGET_RT_MAC_CFM 1
- #define TARGET_RT_MAC_MACHO 0
- #endif
-
-/*
- * unknown compiler
- */
-#else
- #if defined(TARGET_CPU_PPC) && TARGET_CPU_PPC
- #define TARGET_CPU_PPC64 0
- #define TARGET_CPU_68K 0
- #define TARGET_CPU_X86 0
- #define TARGET_CPU_X86_64 0
- #define TARGET_CPU_ARM 0
- #define TARGET_CPU_ARM64 0
- #define TARGET_CPU_MIPS 0
- #define TARGET_CPU_SPARC 0
- #define TARGET_CPU_ALPHA 0
- #elif defined(TARGET_CPU_PPC64) && TARGET_CPU_PPC64
- #define TARGET_CPU_PPC 0
- #define TARGET_CPU_68K 0
- #define TARGET_CPU_X86 0
- #define TARGET_CPU_X86_64 0
- #define TARGET_CPU_ARM 0
- #define TARGET_CPU_ARM64 0
- #define TARGET_CPU_MIPS 0
- #define TARGET_CPU_SPARC 0
- #define TARGET_CPU_ALPHA 0
- #elif defined(TARGET_CPU_X86) && TARGET_CPU_X86
- #define TARGET_CPU_PPC 0
- #define TARGET_CPU_PPC64 0
- #define TARGET_CPU_X86_64 0
- #define TARGET_CPU_68K 0
- #define TARGET_CPU_ARM 0
- #define TARGET_CPU_ARM64 0
- #define TARGET_CPU_MIPS 0
- #define TARGET_CPU_SPARC 0
- #define TARGET_CPU_ALPHA 0
- #elif defined(TARGET_CPU_X86_64) && TARGET_CPU_X86_64
- #define TARGET_CPU_PPC 0
- #define TARGET_CPU_PPC64 0
- #define TARGET_CPU_X86 0
- #define TARGET_CPU_68K 0
- #define TARGET_CPU_ARM 0
- #define TARGET_CPU_ARM64 0
- #define TARGET_CPU_MIPS 0
- #define TARGET_CPU_SPARC 0
- #define TARGET_CPU_ALPHA 0
- #elif defined(TARGET_CPU_ARM) && TARGET_CPU_ARM
- #define TARGET_CPU_PPC 0
- #define TARGET_CPU_PPC64 0
- #define TARGET_CPU_X86 0
- #define TARGET_CPU_X86_64 0
- #define TARGET_CPU_68K 0
- #define TARGET_CPU_ARM64 0
- #define TARGET_CPU_MIPS 0
- #define TARGET_CPU_SPARC 0
- #define TARGET_CPU_ALPHA 0
- #elif defined(TARGET_CPU_ARM64) && TARGET_CPU_ARM64
- #define TARGET_CPU_PPC 0
- #define TARGET_CPU_PPC64 0
- #define TARGET_CPU_X86 0
- #define TARGET_CPU_X86_64 0
- #define TARGET_CPU_68K 0
- #define TARGET_CPU_ARM 0
- #define TARGET_CPU_MIPS 0
- #define TARGET_CPU_SPARC 0
- #define TARGET_CPU_ALPHA 0
- #else
- /*
- NOTE: If your compiler errors out here then support for your compiler
- has not yet been added to TargetConditionals.h.
-
- TargetConditionals.h is designed to be plug-and-play. It auto detects
- which compiler is being run and configures the TARGET_ conditionals
- appropriately.
-
- The short term work around is to set the TARGET_CPU_ and TARGET_OS_
- on the command line to the compiler (e.g. -DTARGET_CPU_MIPS=1 -DTARGET_OS_UNIX=1)
-
- The long term solution is to add a new case to this file which
- auto detects your compiler and sets up the TARGET_ conditionals.
- Then submit the changes to Apple Computer.
- */
- #error TargetConditionals.h: unknown compiler (see comment above)
- #define TARGET_CPU_PPC 0
- #define TARGET_CPU_68K 0
- #define TARGET_CPU_X86 0
- #define TARGET_CPU_ARM 0
- #define TARGET_CPU_ARM64 0
- #define TARGET_CPU_MIPS 0
- #define TARGET_CPU_SPARC 0
- #define TARGET_CPU_ALPHA 0
- #endif
- #define TARGET_OS_MAC 1
- #define TARGET_OS_WIN32 0
- #define TARGET_OS_UNIX 0
- #define TARGET_OS_EMBEDDED 0
- #if TARGET_CPU_PPC || TARGET_CPU_PPC64
- #define TARGET_RT_BIG_ENDIAN 1
- #define TARGET_RT_LITTLE_ENDIAN 0
- #else
- #define TARGET_RT_BIG_ENDIAN 0
- #define TARGET_RT_LITTLE_ENDIAN 1
- #endif
- #if TARGET_CPU_PPC64 || TARGET_CPU_X86_64
- #define TARGET_RT_64_BIT 1
- #else
- #define TARGET_RT_64_BIT 0
- #endif
- #ifdef __MACH__
- #define TARGET_RT_MAC_MACHO 1
- #define TARGET_RT_MAC_CFM 0
- #else
- #define TARGET_RT_MAC_MACHO 0
- #define TARGET_RT_MAC_CFM 1
- #endif
-
-#endif
-
-#endif /* __TARGETCONDITIONALS__ */
\ No newline at end of file
diff --git a/lib/libc/include/x86_64-macos-gnu/_ctermid.h b/lib/libc/include/x86_64-macos-gnu/_ctermid.h
deleted file mode 100644
index b941ea10d4..0000000000
--- a/lib/libc/include/x86_64-macos-gnu/_ctermid.h
+++ /dev/null
@@ -1,27 +0,0 @@
-/*
- * Copyright (c) 2000, 2002-2006, 2008-2010, 2012 Apple Inc. All rights reserved.
- *
- * @APPLE_LICENSE_HEADER_START@
- *
- * This file contains Original Code and/or Modifications of Original Code
- * as defined in and that are subject to the Apple Public Source License
- * Version 2.0 (the 'License'). You may not use this file except in
- * compliance with the License. Please obtain a copy of the License at
- * http://www.opensource.apple.com/apsl/ and read it before using this
- * file.
- *
- * The Original Code and all software distributed under the License are
- * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
- * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
- * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
- * Please see the License for the specific language governing rights and
- * limitations under the License.
- *
- * @APPLE_LICENSE_HEADER_END@
- */
-
-#ifndef _CTERMID_H_
-#define _CTERMID_H_
-char *ctermid(char *);
-#endif
\ No newline at end of file
diff --git a/lib/libc/include/x86_64-macos-gnu/bsm/audit.h b/lib/libc/include/x86_64-macos-gnu/bsm/audit.h
deleted file mode 100644
index e65ccbfab6..0000000000
--- a/lib/libc/include/x86_64-macos-gnu/bsm/audit.h
+++ /dev/null
@@ -1,378 +0,0 @@
-/*-
- * Copyright (c) 2005-2009 Apple Inc.
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. Neither the name of Apple Inc. ("Apple") nor the names of
- * its contributors may be used to endorse or promote products derived
- * from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY
- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
- * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY
- * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
- * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
- * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
- * $P4: //depot/projects/trustedbsd/openbsm/sys/bsm/audit.h#10 $
- */
-
-#ifndef _BSM_AUDIT_H
-#define _BSM_AUDIT_H
-
-#include
-#include
-
-#define AUDIT_RECORD_MAGIC 0x828a0f1b
-#define MAX_AUDIT_RECORDS 20
-#define MAXAUDITDATA (0x8000 - 1)
-#define MAX_AUDIT_RECORD_SIZE MAXAUDITDATA
-#define MIN_AUDIT_FILE_SIZE (512 * 1024)
-
-/*
- * Minimum noumber of free blocks on the filesystem containing the audit
- * log necessary to avoid a hard log rotation. DO NOT SET THIS VALUE TO 0
- * as the kernel does an unsigned compare, plus we want to leave a few blocks
- * free so userspace can terminate the log, etc.
- */
-#define AUDIT_HARD_LIMIT_FREE_BLOCKS 4
-
-/*
- * Triggers for the audit daemon.
- */
-#define AUDIT_TRIGGER_MIN 1
-#define AUDIT_TRIGGER_LOW_SPACE 1 /* Below low watermark. */
-#define AUDIT_TRIGGER_ROTATE_KERNEL 2 /* Kernel requests rotate. */
-#define AUDIT_TRIGGER_READ_FILE 3 /* Re-read config file. */
-#define AUDIT_TRIGGER_CLOSE_AND_DIE 4 /* Terminate audit. */
-#define AUDIT_TRIGGER_NO_SPACE 5 /* Below min free space. */
-#define AUDIT_TRIGGER_ROTATE_USER 6 /* User requests rotate. */
-#define AUDIT_TRIGGER_INITIALIZE 7 /* User initialize of auditd. */
-#define AUDIT_TRIGGER_EXPIRE_TRAILS 8 /* User expiration of trails. */
-#define AUDIT_TRIGGER_MAX 8
-
-/*
- * The special device filename (FreeBSD).
- */
-#define AUDITDEV_FILENAME "audit"
-#define AUDIT_TRIGGER_FILE ("/dev/" AUDITDEV_FILENAME)
-
-/*
- * Pre-defined audit IDs
- */
-#define AU_DEFAUDITID (uid_t)(-1)
-#define AU_DEFAUDITSID 0
-#define AU_ASSIGN_ASID -1
-
-/*
- * IPC types.
- */
-#define AT_IPC_MSG ((unsigned char)1) /* Message IPC id. */
-#define AT_IPC_SEM ((unsigned char)2) /* Semaphore IPC id. */
-#define AT_IPC_SHM ((unsigned char)3) /* Shared mem IPC id. */
-
-/*
- * Audit conditions.
- */
-#define AUC_UNSET 0
-#define AUC_AUDITING 1
-#define AUC_NOAUDIT 2
-#define AUC_DISABLED -1
-
-/*
- * auditon(2) commands.
- */
-#define A_OLDGETPOLICY 2
-#define A_OLDSETPOLICY 3
-#define A_GETKMASK 4
-#define A_SETKMASK 5
-#define A_OLDGETQCTRL 6
-#define A_OLDSETQCTRL 7
-#define A_GETCWD 8
-#define A_GETCAR 9
-#define A_GETSTAT 12
-#define A_SETSTAT 13
-#define A_SETUMASK 14
-#define A_SETSMASK 15
-#define A_OLDGETCOND 20
-#define A_OLDSETCOND 21
-#define A_GETCLASS 22
-#define A_SETCLASS 23
-#define A_GETPINFO 24
-#define A_SETPMASK 25
-#define A_SETFSIZE 26
-#define A_GETFSIZE 27
-#define A_GETPINFO_ADDR 28
-#define A_GETKAUDIT 29
-#define A_SETKAUDIT 30
-#define A_SENDTRIGGER 31
-#define A_GETSINFO_ADDR 32
-#define A_GETPOLICY 33
-#define A_SETPOLICY 34
-#define A_GETQCTRL 35
-#define A_SETQCTRL 36
-#define A_GETCOND 37
-#define A_SETCOND 38
-#define A_GETSFLAGS 39
-#define A_SETSFLAGS 40
-#define A_GETCTLMODE 41
-#define A_SETCTLMODE 42
-#define A_GETEXPAFTER 43
-#define A_SETEXPAFTER 44
-
-/*
- * Audit policy controls.
- */
-#define AUDIT_CNT 0x0001
-#define AUDIT_AHLT 0x0002
-#define AUDIT_ARGV 0x0004
-#define AUDIT_ARGE 0x0008
-#define AUDIT_SEQ 0x0010
-#define AUDIT_WINDATA 0x0020
-#define AUDIT_USER 0x0040
-#define AUDIT_GROUP 0x0080
-#define AUDIT_TRAIL 0x0100
-#define AUDIT_PATH 0x0200
-#define AUDIT_SCNT 0x0400
-#define AUDIT_PUBLIC 0x0800
-#define AUDIT_ZONENAME 0x1000
-#define AUDIT_PERZONE 0x2000
-
-/*
- * Default audit queue control parameters.
- */
-#define AQ_HIWATER 100
-#define AQ_MAXHIGH 10000
-#define AQ_LOWATER 10
-#define AQ_BUFSZ MAXAUDITDATA
-#define AQ_MAXBUFSZ 1048576
-
-/*
- * Default minimum percentage free space on file system.
- */
-#define AU_FS_MINFREE 20
-
-/*
- * Type definitions used indicating the length of variable length addresses
- * in tokens containing addresses, such as header fields.
- */
-#define AU_IPv4 4
-#define AU_IPv6 16
-
-/*
- * Reserved audit class mask indicating which classes are unable to have
- * events added or removed by unentitled processes.
- */
-#define AU_CLASS_MASK_RESERVED 0x10000000
-
-/*
- * Audit control modes
- */
-#define AUDIT_CTLMODE_NORMAL ((unsigned char)1)
-#define AUDIT_CTLMODE_EXTERNAL ((unsigned char)2)
-
-/*
- * Audit file expire_after op modes
- */
-#define AUDIT_EXPIRE_OP_AND ((unsigned char)0)
-#define AUDIT_EXPIRE_OP_OR ((unsigned char)1)
-
-__BEGIN_DECLS
-
-typedef uid_t au_id_t;
-typedef pid_t au_asid_t;
-typedef u_int16_t au_event_t;
-typedef u_int16_t au_emod_t;
-typedef u_int32_t au_class_t;
-typedef u_int64_t au_asflgs_t __attribute__ ((aligned(8)));
-typedef unsigned char au_ctlmode_t;
-
-struct au_tid {
- dev_t port;
- u_int32_t machine;
-};
-typedef struct au_tid au_tid_t;
-
-struct au_tid_addr {
- dev_t at_port;
- u_int32_t at_type;
- u_int32_t at_addr[4];
-};
-typedef struct au_tid_addr au_tid_addr_t;
-
-struct au_mask {
- unsigned int am_success; /* Success bits. */
- unsigned int am_failure; /* Failure bits. */
-};
-typedef struct au_mask au_mask_t;
-
-struct auditinfo {
- au_id_t ai_auid; /* Audit user ID. */
- au_mask_t ai_mask; /* Audit masks. */
- au_tid_t ai_termid; /* Terminal ID. */
- au_asid_t ai_asid; /* Audit session ID. */
-};
-typedef struct auditinfo auditinfo_t;
-
-struct auditinfo_addr {
- au_id_t ai_auid; /* Audit user ID. */
- au_mask_t ai_mask; /* Audit masks. */
- au_tid_addr_t ai_termid; /* Terminal ID. */
- au_asid_t ai_asid; /* Audit session ID. */
- au_asflgs_t ai_flags; /* Audit session flags. */
-};
-typedef struct auditinfo_addr auditinfo_addr_t;
-
-struct auditpinfo {
- pid_t ap_pid; /* ID of target process. */
- au_id_t ap_auid; /* Audit user ID. */
- au_mask_t ap_mask; /* Audit masks. */
- au_tid_t ap_termid; /* Terminal ID. */
- au_asid_t ap_asid; /* Audit session ID. */
-};
-typedef struct auditpinfo auditpinfo_t;
-
-struct auditpinfo_addr {
- pid_t ap_pid; /* ID of target process. */
- au_id_t ap_auid; /* Audit user ID. */
- au_mask_t ap_mask; /* Audit masks. */
- au_tid_addr_t ap_termid; /* Terminal ID. */
- au_asid_t ap_asid; /* Audit session ID. */
- au_asflgs_t ap_flags; /* Audit session flags. */
-};
-typedef struct auditpinfo_addr auditpinfo_addr_t;
-
-struct au_session {
- auditinfo_addr_t *as_aia_p; /* Ptr to full audit info. */
- au_mask_t as_mask; /* Process Audit Masks. */
-};
-typedef struct au_session au_session_t;
-
-struct au_expire_after {
- time_t age; /* Age after which trail files should be expired */
- size_t size; /* Aggregate trail size when files should be expired */
- unsigned char op_type; /* Operator used with the above values to determine when files should be expired */
-};
-typedef struct au_expire_after au_expire_after_t;
-
-/*
- * Contents of token_t are opaque outside of libbsm.
- */
-typedef struct au_token token_t;
-
-/*
- * Kernel audit queue control parameters:
- * Default: Maximum:
- * aq_hiwater: AQ_HIWATER (100) AQ_MAXHIGH (10000)
- * aq_lowater: AQ_LOWATER (10)
-
-/*
- * getaudit()/setaudit() are deprecated and have been replaced with
- * wrappers to the getaudit_addr()/setaudit_addr() syscalls above.
- */
-
-int getaudit(struct auditinfo *)
-__OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_0, __MAC_10_8,
- __IPHONE_2_0, __IPHONE_6_0);
-int setaudit(const struct auditinfo *)
-__OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_0, __MAC_10_8,
- __IPHONE_2_0, __IPHONE_6_0);
-#else
-
-int getaudit(struct auditinfo *);
-int setaudit(const struct auditinfo *);
-#endif /* !__APPLE__ */
-
-#ifdef __APPLE_API_PRIVATE
-#include
-mach_port_name_t audit_session_self(void);
-au_asid_t audit_session_join(mach_port_name_t port);
-int audit_session_port(au_asid_t asid, mach_port_name_t *portname);
-#endif /* __APPLE_API_PRIVATE */
-
-#endif /* defined(_KERNEL) || defined(KERNEL) */
-
-__END_DECLS
-
-#endif /* !_BSM_AUDIT_H */
\ No newline at end of file
diff --git a/lib/libc/include/x86_64-macos-gnu/dispatch/block.h b/lib/libc/include/x86_64-macos-gnu/dispatch/block.h
deleted file mode 100644
index 5a28f48ce4..0000000000
--- a/lib/libc/include/x86_64-macos-gnu/dispatch/block.h
+++ /dev/null
@@ -1,428 +0,0 @@
-/*
- * Copyright (c) 2014 Apple Inc. All rights reserved.
- *
- * @APPLE_APACHE_LICENSE_HEADER_START@
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- * @APPLE_APACHE_LICENSE_HEADER_END@
- */
-
-#ifndef __DISPATCH_BLOCK__
-#define __DISPATCH_BLOCK__
-
-#ifndef __DISPATCH_INDIRECT__
-#error "Please #include instead of this file directly."
-#include // for HeaderDoc
-#endif
-
-#ifdef __BLOCKS__
-
-/*!
- * @group Dispatch block objects
- */
-
-DISPATCH_ASSUME_NONNULL_BEGIN
-
-__BEGIN_DECLS
-
-/*!
- * @typedef dispatch_block_flags_t
- * Flags to pass to the dispatch_block_create* functions.
- *
- * @const DISPATCH_BLOCK_BARRIER
- * Flag indicating that a dispatch block object should act as a barrier block
- * when submitted to a DISPATCH_QUEUE_CONCURRENT queue.
- * See dispatch_barrier_async() for details.
- * This flag has no effect when the dispatch block object is invoked directly.
- *
- * @const DISPATCH_BLOCK_DETACHED
- * Flag indicating that a dispatch block object should execute disassociated
- * from current execution context attributes such as os_activity_t
- * and properties of the current IPC request (if any). With regard to QoS class,
- * the behavior is the same as for DISPATCH_BLOCK_NO_QOS. If invoked directly,
- * the block object will remove the other attributes from the calling thread for
- * the duration of the block body (before applying attributes assigned to the
- * block object, if any). If submitted to a queue, the block object will be
- * executed with the attributes of the queue (or any attributes specifically
- * assigned to the block object).
- *
- * @const DISPATCH_BLOCK_ASSIGN_CURRENT
- * Flag indicating that a dispatch block object should be assigned the execution
- * context attributes that are current at the time the block object is created.
- * This applies to attributes such as QOS class, os_activity_t and properties of
- * the current IPC request (if any). If invoked directly, the block object will
- * apply these attributes to the calling thread for the duration of the block
- * body. If the block object is submitted to a queue, this flag replaces the
- * default behavior of associating the submitted block instance with the
- * execution context attributes that are current at the time of submission.
- * If a specific QOS class is assigned with DISPATCH_BLOCK_NO_QOS_CLASS or
- * dispatch_block_create_with_qos_class(), that QOS class takes precedence over
- * the QOS class assignment indicated by this flag.
- *
- * @const DISPATCH_BLOCK_NO_QOS_CLASS
- * Flag indicating that a dispatch block object should be not be assigned a QOS
- * class. If invoked directly, the block object will be executed with the QOS
- * class of the calling thread. If the block object is submitted to a queue,
- * this replaces the default behavior of associating the submitted block
- * instance with the QOS class current at the time of submission.
- * This flag is ignored if a specific QOS class is assigned with
- * dispatch_block_create_with_qos_class().
- *
- * @const DISPATCH_BLOCK_INHERIT_QOS_CLASS
- * Flag indicating that execution of a dispatch block object submitted to a
- * queue should prefer the QOS class assigned to the queue over the QOS class
- * assigned to the block (resp. associated with the block at the time of
- * submission). The latter will only be used if the queue in question does not
- * have an assigned QOS class, as long as doing so does not result in a QOS
- * class lower than the QOS class inherited from the queue's target queue.
- * This flag is the default when a dispatch block object is submitted to a queue
- * for asynchronous execution and has no effect when the dispatch block object
- * is invoked directly. It is ignored if DISPATCH_BLOCK_ENFORCE_QOS_CLASS is
- * also passed.
- *
- * @const DISPATCH_BLOCK_ENFORCE_QOS_CLASS
- * Flag indicating that execution of a dispatch block object submitted to a
- * queue should prefer the QOS class assigned to the block (resp. associated
- * with the block at the time of submission) over the QOS class assigned to the
- * queue, as long as doing so will not result in a lower QOS class.
- * This flag is the default when a dispatch block object is submitted to a queue
- * for synchronous execution or when the dispatch block object is invoked
- * directly.
- */
-DISPATCH_OPTIONS(dispatch_block_flags, unsigned long,
- DISPATCH_BLOCK_BARRIER
- DISPATCH_ENUM_API_AVAILABLE(macos(10.10), ios(8.0)) = 0x1,
- DISPATCH_BLOCK_DETACHED
- DISPATCH_ENUM_API_AVAILABLE(macos(10.10), ios(8.0)) = 0x2,
- DISPATCH_BLOCK_ASSIGN_CURRENT
- DISPATCH_ENUM_API_AVAILABLE(macos(10.10), ios(8.0)) = 0x4,
- DISPATCH_BLOCK_NO_QOS_CLASS
- DISPATCH_ENUM_API_AVAILABLE(macos(10.10), ios(8.0)) = 0x8,
- DISPATCH_BLOCK_INHERIT_QOS_CLASS
- DISPATCH_ENUM_API_AVAILABLE(macos(10.10), ios(8.0)) = 0x10,
- DISPATCH_BLOCK_ENFORCE_QOS_CLASS
- DISPATCH_ENUM_API_AVAILABLE(macos(10.10), ios(8.0)) = 0x20,
-);
-
-/*!
- * @function dispatch_block_create
- *
- * @abstract
- * Create a new dispatch block object on the heap from an existing block and
- * the given flags.
- *
- * @discussion
- * The provided block is Block_copy'ed to the heap and retained by the newly
- * created dispatch block object.
- *
- * The returned dispatch block object is intended to be submitted to a dispatch
- * queue with dispatch_async() and related functions, but may also be invoked
- * directly. Both operations can be performed an arbitrary number of times but
- * only the first completed execution of a dispatch block object can be waited
- * on with dispatch_block_wait() or observed with dispatch_block_notify().
- *
- * If the returned dispatch block object is submitted to a dispatch queue, the
- * submitted block instance will be associated with the QOS class current at the
- * time of submission, unless one of the following flags assigned a specific QOS
- * class (or no QOS class) at the time of block creation:
- * - DISPATCH_BLOCK_ASSIGN_CURRENT
- * - DISPATCH_BLOCK_NO_QOS_CLASS
- * - DISPATCH_BLOCK_DETACHED
- * The QOS class the block object will be executed with also depends on the QOS
- * class assigned to the queue and which of the following flags was specified or
- * defaulted to:
- * - DISPATCH_BLOCK_INHERIT_QOS_CLASS (default for asynchronous execution)
- * - DISPATCH_BLOCK_ENFORCE_QOS_CLASS (default for synchronous execution)
- * See description of dispatch_block_flags_t for details.
- *
- * If the returned dispatch block object is submitted directly to a serial queue
- * and is configured to execute with a specific QOS class, the system will make
- * a best effort to apply the necessary QOS overrides to ensure that blocks
- * submitted earlier to the serial queue are executed at that same QOS class or
- * higher.
- *
- * @param flags
- * Configuration flags for the block object.
- * Passing a value that is not a bitwise OR of flags from dispatch_block_flags_t
- * results in NULL being returned.
- *
- * @param block
- * The block to create the dispatch block object from.
- *
- * @result
- * The newly created dispatch block object, or NULL.
- * When not building with Objective-C ARC, must be released with a -[release]
- * message or the Block_release() function.
- */
-API_AVAILABLE(macos(10.10), ios(8.0))
-DISPATCH_EXPORT DISPATCH_NONNULL2 DISPATCH_RETURNS_RETAINED_BLOCK
-DISPATCH_WARN_RESULT DISPATCH_NOTHROW
-dispatch_block_t
-dispatch_block_create(dispatch_block_flags_t flags, dispatch_block_t block);
-
-/*!
- * @function dispatch_block_create_with_qos_class
- *
- * @abstract
- * Create a new dispatch block object on the heap from an existing block and
- * the given flags, and assign it the specified QOS class and relative priority.
- *
- * @discussion
- * The provided block is Block_copy'ed to the heap and retained by the newly
- * created dispatch block object.
- *
- * The returned dispatch block object is intended to be submitted to a dispatch
- * queue with dispatch_async() and related functions, but may also be invoked
- * directly. Both operations can be performed an arbitrary number of times but
- * only the first completed execution of a dispatch block object can be waited
- * on with dispatch_block_wait() or observed with dispatch_block_notify().
- *
- * If invoked directly, the returned dispatch block object will be executed with
- * the assigned QOS class as long as that does not result in a lower QOS class
- * than what is current on the calling thread.
- *
- * If the returned dispatch block object is submitted to a dispatch queue, the
- * QOS class it will be executed with depends on the QOS class assigned to the
- * block, the QOS class assigned to the queue and which of the following flags
- * was specified or defaulted to:
- * - DISPATCH_BLOCK_INHERIT_QOS_CLASS: default for asynchronous execution
- * - DISPATCH_BLOCK_ENFORCE_QOS_CLASS: default for synchronous execution
- * See description of dispatch_block_flags_t for details.
- *
- * If the returned dispatch block object is submitted directly to a serial queue
- * and is configured to execute with a specific QOS class, the system will make
- * a best effort to apply the necessary QOS overrides to ensure that blocks
- * submitted earlier to the serial queue are executed at that same QOS class or
- * higher.
- *
- * @param flags
- * Configuration flags for the new block object.
- * Passing a value that is not a bitwise OR of flags from dispatch_block_flags_t
- * results in NULL being returned.
- *
- * @param qos_class
- * A QOS class value:
- * - QOS_CLASS_USER_INTERACTIVE
- * - QOS_CLASS_USER_INITIATED
- * - QOS_CLASS_DEFAULT
- * - QOS_CLASS_UTILITY
- * - QOS_CLASS_BACKGROUND
- * - QOS_CLASS_UNSPECIFIED
- * Passing QOS_CLASS_UNSPECIFIED is equivalent to specifying the
- * DISPATCH_BLOCK_NO_QOS_CLASS flag. Passing any other value results in NULL
- * being returned.
- *
- * @param relative_priority
- * A relative priority within the QOS class. This value is a negative
- * offset from the maximum supported scheduler priority for the given class.
- * Passing a value greater than zero or less than QOS_MIN_RELATIVE_PRIORITY
- * results in NULL being returned.
- *
- * @param block
- * The block to create the dispatch block object from.
- *
- * @result
- * The newly created dispatch block object, or NULL.
- * When not building with Objective-C ARC, must be released with a -[release]
- * message or the Block_release() function.
- */
-API_AVAILABLE(macos(10.10), ios(8.0))
-DISPATCH_EXPORT DISPATCH_NONNULL4 DISPATCH_RETURNS_RETAINED_BLOCK
-DISPATCH_WARN_RESULT DISPATCH_NOTHROW
-dispatch_block_t
-dispatch_block_create_with_qos_class(dispatch_block_flags_t flags,
- dispatch_qos_class_t qos_class, int relative_priority,
- dispatch_block_t block);
-
-/*!
- * @function dispatch_block_perform
- *
- * @abstract
- * Create, synchronously execute and release a dispatch block object from the
- * specified block and flags.
- *
- * @discussion
- * Behaves identically to the sequence
- *
- * dispatch_block_t b = dispatch_block_create(flags, block);
- * b();
- * Block_release(b);
- *
- * but may be implemented more efficiently internally by not requiring a copy
- * to the heap of the specified block or the allocation of a new block object.
- *
- * @param flags
- * Configuration flags for the temporary block object.
- * The result of passing a value that is not a bitwise OR of flags from
- * dispatch_block_flags_t is undefined.
- *
- * @param block
- * The block to create the temporary block object from.
- */
-API_AVAILABLE(macos(10.10), ios(8.0))
-DISPATCH_EXPORT DISPATCH_NONNULL2 DISPATCH_NOTHROW
-void
-dispatch_block_perform(dispatch_block_flags_t flags,
- DISPATCH_NOESCAPE dispatch_block_t block);
-
-/*!
- * @function dispatch_block_wait
- *
- * @abstract
- * Wait synchronously until execution of the specified dispatch block object has
- * completed or until the specified timeout has elapsed.
- *
- * @discussion
- * This function will return immediately if execution of the block object has
- * already completed.
- *
- * It is not possible to wait for multiple executions of the same block object
- * with this interface; use dispatch_group_wait() for that purpose. A single
- * dispatch block object may either be waited on once and executed once,
- * or it may be executed any number of times. The behavior of any other
- * combination is undefined. Submission to a dispatch queue counts as an
- * execution, even if cancellation (dispatch_block_cancel) means the block's
- * code never runs.
- *
- * The result of calling this function from multiple threads simultaneously
- * with the same dispatch block object is undefined, but note that doing so
- * would violate the rules described in the previous paragraph.
- *
- * If this function returns indicating that the specified timeout has elapsed,
- * then that invocation does not count as the one allowed wait.
- *
- * If at the time this function is called, the specified dispatch block object
- * has been submitted directly to a serial queue, the system will make a best
- * effort to apply the necessary QOS overrides to ensure that the block and any
- * blocks submitted earlier to that serial queue are executed at the QOS class
- * (or higher) of the thread calling dispatch_block_wait().
- *
- * @param block
- * The dispatch block object to wait on.
- * The result of passing NULL or a block object not returned by one of the
- * dispatch_block_create* functions is undefined.
- *
- * @param timeout
- * When to timeout (see dispatch_time). As a convenience, there are the
- * DISPATCH_TIME_NOW and DISPATCH_TIME_FOREVER constants.
- *
- * @result
- * Returns zero on success (the dispatch block object completed within the
- * specified timeout) or non-zero on error (i.e. timed out).
- */
-API_AVAILABLE(macos(10.10), ios(8.0))
-DISPATCH_EXPORT DISPATCH_NONNULL1 DISPATCH_NOTHROW
-long
-dispatch_block_wait(dispatch_block_t block, dispatch_time_t timeout);
-
-/*!
- * @function dispatch_block_notify
- *
- * @abstract
- * Schedule a notification block to be submitted to a queue when the execution
- * of a specified dispatch block object has completed.
- *
- * @discussion
- * This function will submit the notification block immediately if execution of
- * the observed block object has already completed.
- *
- * It is not possible to be notified of multiple executions of the same block
- * object with this interface, use dispatch_group_notify() for that purpose.
- *
- * A single dispatch block object may either be observed one or more times
- * and executed once, or it may be executed any number of times. The behavior
- * of any other combination is undefined. Submission to a dispatch queue
- * counts as an execution, even if cancellation (dispatch_block_cancel) means
- * the block's code never runs.
- *
- * If multiple notification blocks are scheduled for a single block object,
- * there is no defined order in which the notification blocks will be submitted
- * to their associated queues.
- *
- * @param block
- * The dispatch block object to observe.
- * The result of passing NULL or a block object not returned by one of the
- * dispatch_block_create* functions is undefined.
- *
- * @param queue
- * The queue to which the supplied notification block will be submitted when
- * the observed block completes.
- *
- * @param notification_block
- * The notification block to submit when the observed block object completes.
- */
-API_AVAILABLE(macos(10.10), ios(8.0))
-DISPATCH_EXPORT DISPATCH_NONNULL_ALL DISPATCH_NOTHROW
-void
-dispatch_block_notify(dispatch_block_t block, dispatch_queue_t queue,
- dispatch_block_t notification_block);
-
-/*!
- * @function dispatch_block_cancel
- *
- * @abstract
- * Asynchronously cancel the specified dispatch block object.
- *
- * @discussion
- * Cancellation causes any future execution of the dispatch block object to
- * return immediately, but does not affect any execution of the block object
- * that is already in progress.
- *
- * Release of any resources associated with the block object will be delayed
- * until execution of the block object is next attempted (or any execution
- * already in progress completes).
- *
- * NOTE: care needs to be taken to ensure that a block object that may be
- * canceled does not capture any resources that require execution of the
- * block body in order to be released (e.g. memory allocated with
- * malloc(3) that the block body calls free(3) on). Such resources will
- * be leaked if the block body is never executed due to cancellation.
- *
- * @param block
- * The dispatch block object to cancel.
- * The result of passing NULL or a block object not returned by one of the
- * dispatch_block_create* functions is undefined.
- */
-API_AVAILABLE(macos(10.10), ios(8.0))
-DISPATCH_EXPORT DISPATCH_NONNULL_ALL DISPATCH_NOTHROW
-void
-dispatch_block_cancel(dispatch_block_t block);
-
-/*!
- * @function dispatch_block_testcancel
- *
- * @abstract
- * Tests whether the given dispatch block object has been canceled.
- *
- * @param block
- * The dispatch block object to test.
- * The result of passing NULL or a block object not returned by one of the
- * dispatch_block_create* functions is undefined.
- *
- * @result
- * Non-zero if canceled and zero if not canceled.
- */
-API_AVAILABLE(macos(10.10), ios(8.0))
-DISPATCH_EXPORT DISPATCH_NONNULL_ALL DISPATCH_WARN_RESULT DISPATCH_PURE
-DISPATCH_NOTHROW
-long
-dispatch_block_testcancel(dispatch_block_t block);
-
-__END_DECLS
-
-DISPATCH_ASSUME_NONNULL_END
-
-#endif // __BLOCKS__
-
-#endif // __DISPATCH_BLOCK__
\ No newline at end of file
diff --git a/lib/libc/include/x86_64-macos-gnu/dispatch/dispatch.h b/lib/libc/include/x86_64-macos-gnu/dispatch/dispatch.h
deleted file mode 100644
index 7d5356aab6..0000000000
--- a/lib/libc/include/x86_64-macos-gnu/dispatch/dispatch.h
+++ /dev/null
@@ -1,75 +0,0 @@
-/*
- * Copyright (c) 2008-2013 Apple Inc. All rights reserved.
- *
- * @APPLE_APACHE_LICENSE_HEADER_START@
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- * @APPLE_APACHE_LICENSE_HEADER_END@
- */
-
-#ifndef __DISPATCH_PUBLIC__
-#define __DISPATCH_PUBLIC__
-
-#ifdef __APPLE__
-#include
-#include
-#include
-#include
-#elif defined(_WIN32)
-#include
-#elif defined(__unix__)
-#include
-#endif
-
-#include
-#include
-#include
-#include
-#include
-#if defined(__unix__) || (defined(__APPLE__) && defined(__MACH__))
-#include
-#endif
-#include
-
-#if (defined(__linux__) || defined(__FreeBSD__)) && defined(__has_feature)
-#if __has_feature(modules)
-#if !defined(__arm__)
-#include // for off_t (to match Glibc.modulemap)
-#endif
-#endif
-#endif
-
-#define DISPATCH_API_VERSION 20181008
-
-#ifndef __DISPATCH_INDIRECT__
-#define __DISPATCH_INDIRECT__
-#endif
-
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-
-#undef __DISPATCH_INDIRECT__
-
-#endif
\ No newline at end of file
diff --git a/lib/libc/include/x86_64-macos-gnu/dispatch/group.h b/lib/libc/include/x86_64-macos-gnu/dispatch/group.h
deleted file mode 100644
index bb9bad30e3..0000000000
--- a/lib/libc/include/x86_64-macos-gnu/dispatch/group.h
+++ /dev/null
@@ -1,279 +0,0 @@
-/*
- * Copyright (c) 2008-2013 Apple Inc. All rights reserved.
- *
- * @APPLE_APACHE_LICENSE_HEADER_START@
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- * @APPLE_APACHE_LICENSE_HEADER_END@
- */
-
-#ifndef __DISPATCH_GROUP__
-#define __DISPATCH_GROUP__
-
-#ifndef __DISPATCH_INDIRECT__
-#error "Please #include instead of this file directly."
-#include // for HeaderDoc
-#endif
-
-DISPATCH_ASSUME_NONNULL_BEGIN
-
-/*!
- * @typedef dispatch_group_t
- * @abstract
- * A group of blocks submitted to queues for asynchronous invocation.
- */
-DISPATCH_DECL(dispatch_group);
-
-__BEGIN_DECLS
-
-/*!
- * @function dispatch_group_create
- *
- * @abstract
- * Creates new group with which blocks may be associated.
- *
- * @discussion
- * This function creates a new group with which blocks may be associated.
- * The dispatch group may be used to wait for the completion of the blocks it
- * references. The group object memory is freed with dispatch_release().
- *
- * @result
- * The newly created group, or NULL on failure.
- */
-API_AVAILABLE(macos(10.6), ios(4.0))
-DISPATCH_EXPORT DISPATCH_MALLOC DISPATCH_RETURNS_RETAINED DISPATCH_WARN_RESULT
-DISPATCH_NOTHROW
-dispatch_group_t
-dispatch_group_create(void);
-
-/*!
- * @function dispatch_group_async
- *
- * @abstract
- * Submits a block to a dispatch queue and associates the block with the given
- * dispatch group.
- *
- * @discussion
- * Submits a block to a dispatch queue and associates the block with the given
- * dispatch group. The dispatch group may be used to wait for the completion
- * of the blocks it references.
- *
- * @param group
- * A dispatch group to associate with the submitted block.
- * The result of passing NULL in this parameter is undefined.
- *
- * @param queue
- * The dispatch queue to which the block will be submitted for asynchronous
- * invocation.
- *
- * @param block
- * The block to perform asynchronously.
- */
-#ifdef __BLOCKS__
-API_AVAILABLE(macos(10.6), ios(4.0))
-DISPATCH_EXPORT DISPATCH_NONNULL_ALL DISPATCH_NOTHROW
-void
-dispatch_group_async(dispatch_group_t group,
- dispatch_queue_t queue,
- dispatch_block_t block);
-#endif /* __BLOCKS__ */
-
-/*!
- * @function dispatch_group_async_f
- *
- * @abstract
- * Submits a function to a dispatch queue and associates the block with the
- * given dispatch group.
- *
- * @discussion
- * See dispatch_group_async() for details.
- *
- * @param group
- * A dispatch group to associate with the submitted function.
- * The result of passing NULL in this parameter is undefined.
- *
- * @param queue
- * The dispatch queue to which the function will be submitted for asynchronous
- * invocation.
- *
- * @param context
- * The application-defined context parameter to pass to the function.
- *
- * @param work
- * The application-defined function to invoke on the target queue. The first
- * parameter passed to this function is the context provided to
- * dispatch_group_async_f().
- */
-API_AVAILABLE(macos(10.6), ios(4.0))
-DISPATCH_EXPORT DISPATCH_NONNULL1 DISPATCH_NONNULL2 DISPATCH_NONNULL4
-DISPATCH_NOTHROW
-void
-dispatch_group_async_f(dispatch_group_t group,
- dispatch_queue_t queue,
- void *_Nullable context,
- dispatch_function_t work);
-
-/*!
- * @function dispatch_group_wait
- *
- * @abstract
- * Wait synchronously until all the blocks associated with a group have
- * completed or until the specified timeout has elapsed.
- *
- * @discussion
- * This function waits for the completion of the blocks associated with the
- * given dispatch group, and returns after all blocks have completed or when
- * the specified timeout has elapsed.
- *
- * This function will return immediately if there are no blocks associated
- * with the dispatch group (i.e. the group is empty).
- *
- * The result of calling this function from multiple threads simultaneously
- * with the same dispatch group is undefined.
- *
- * After the successful return of this function, the dispatch group is empty.
- * It may either be released with dispatch_release() or re-used for additional
- * blocks. See dispatch_group_async() for more information.
- *
- * @param group
- * The dispatch group to wait on.
- * The result of passing NULL in this parameter is undefined.
- *
- * @param timeout
- * When to timeout (see dispatch_time). As a convenience, there are the
- * DISPATCH_TIME_NOW and DISPATCH_TIME_FOREVER constants.
- *
- * @result
- * Returns zero on success (all blocks associated with the group completed
- * within the specified timeout) or non-zero on error (i.e. timed out).
- */
-API_AVAILABLE(macos(10.6), ios(4.0))
-DISPATCH_EXPORT DISPATCH_NONNULL_ALL DISPATCH_NOTHROW
-long
-dispatch_group_wait(dispatch_group_t group, dispatch_time_t timeout);
-
-/*!
- * @function dispatch_group_notify
- *
- * @abstract
- * Schedule a block to be submitted to a queue when all the blocks associated
- * with a group have completed.
- *
- * @discussion
- * This function schedules a notification block to be submitted to the specified
- * queue once all blocks associated with the dispatch group have completed.
- *
- * If no blocks are associated with the dispatch group (i.e. the group is empty)
- * then the notification block will be submitted immediately.
- *
- * The group will be empty at the time the notification block is submitted to
- * the target queue. The group may either be released with dispatch_release()
- * or reused for additional operations.
- * See dispatch_group_async() for more information.
- *
- * @param group
- * The dispatch group to observe.
- * The result of passing NULL in this parameter is undefined.
- *
- * @param queue
- * The queue to which the supplied block will be submitted when the group
- * completes.
- *
- * @param block
- * The block to submit when the group completes.
- */
-#ifdef __BLOCKS__
-API_AVAILABLE(macos(10.6), ios(4.0))
-DISPATCH_EXPORT DISPATCH_NONNULL_ALL DISPATCH_NOTHROW
-void
-dispatch_group_notify(dispatch_group_t group,
- dispatch_queue_t queue,
- dispatch_block_t block);
-#endif /* __BLOCKS__ */
-
-/*!
- * @function dispatch_group_notify_f
- *
- * @abstract
- * Schedule a function to be submitted to a queue when all the blocks
- * associated with a group have completed.
- *
- * @discussion
- * See dispatch_group_notify() for details.
- *
- * @param group
- * The dispatch group to observe.
- * The result of passing NULL in this parameter is undefined.
- *
- * @param context
- * The application-defined context parameter to pass to the function.
- *
- * @param work
- * The application-defined function to invoke on the target queue. The first
- * parameter passed to this function is the context provided to
- * dispatch_group_notify_f().
- */
-API_AVAILABLE(macos(10.6), ios(4.0))
-DISPATCH_EXPORT DISPATCH_NONNULL1 DISPATCH_NONNULL2 DISPATCH_NONNULL4
-DISPATCH_NOTHROW
-void
-dispatch_group_notify_f(dispatch_group_t group,
- dispatch_queue_t queue,
- void *_Nullable context,
- dispatch_function_t work);
-
-/*!
- * @function dispatch_group_enter
- *
- * @abstract
- * Manually indicate a block has entered the group
- *
- * @discussion
- * Calling this function indicates another block has joined the group through
- * a means other than dispatch_group_async(). Calls to this function must be
- * balanced with dispatch_group_leave().
- *
- * @param group
- * The dispatch group to update.
- * The result of passing NULL in this parameter is undefined.
- */
-API_AVAILABLE(macos(10.6), ios(4.0))
-DISPATCH_EXPORT DISPATCH_NONNULL_ALL DISPATCH_NOTHROW
-void
-dispatch_group_enter(dispatch_group_t group);
-
-/*!
- * @function dispatch_group_leave
- *
- * @abstract
- * Manually indicate a block in the group has completed
- *
- * @discussion
- * Calling this function indicates block has completed and left the dispatch
- * group by a means other than dispatch_group_async().
- *
- * @param group
- * The dispatch group to update.
- * The result of passing NULL in this parameter is undefined.
- */
-API_AVAILABLE(macos(10.6), ios(4.0))
-DISPATCH_EXPORT DISPATCH_NONNULL_ALL DISPATCH_NOTHROW
-void
-dispatch_group_leave(dispatch_group_t group);
-
-__END_DECLS
-
-DISPATCH_ASSUME_NONNULL_END
-
-#endif
\ No newline at end of file
diff --git a/lib/libc/include/x86_64-macos-gnu/dispatch/object.h b/lib/libc/include/x86_64-macos-gnu/dispatch/object.h
deleted file mode 100644
index 3d89eb1fe6..0000000000
--- a/lib/libc/include/x86_64-macos-gnu/dispatch/object.h
+++ /dev/null
@@ -1,606 +0,0 @@
-/*
- * Copyright (c) 2008-2012 Apple Inc. All rights reserved.
- *
- * @APPLE_APACHE_LICENSE_HEADER_START@
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- * @APPLE_APACHE_LICENSE_HEADER_END@
- */
-
-#ifndef __DISPATCH_OBJECT__
-#define __DISPATCH_OBJECT__
-
-#ifndef __DISPATCH_INDIRECT__
-#error "Please #include instead of this file directly."
-#include // for HeaderDoc
-#endif
-
-#if __has_include()
-#include
-#endif
-
-DISPATCH_ASSUME_NONNULL_BEGIN
-
-/*!
- * @typedef dispatch_object_t
- *
- * @abstract
- * Abstract base type for all dispatch objects.
- * The details of the type definition are language-specific.
- *
- * @discussion
- * Dispatch objects are reference counted via calls to dispatch_retain() and
- * dispatch_release().
- */
-
-#if OS_OBJECT_USE_OBJC
-/*
- * By default, dispatch objects are declared as Objective-C types when building
- * with an Objective-C compiler. This allows them to participate in ARC, in RR
- * management by the Blocks runtime and in leaks checking by the static
- * analyzer, and enables them to be added to Cocoa collections.
- * See for details.
- */
-OS_OBJECT_DECL_CLASS(dispatch_object);
-
-#if OS_OBJECT_SWIFT3
-#define DISPATCH_DECL(name) OS_OBJECT_DECL_SUBCLASS_SWIFT(name, dispatch_object)
-#define DISPATCH_DECL_SUBCLASS(name, base) OS_OBJECT_DECL_SUBCLASS_SWIFT(name, base)
-#else // OS_OBJECT_SWIFT3
-#define DISPATCH_DECL(name) OS_OBJECT_DECL_SUBCLASS(name, dispatch_object)
-#define DISPATCH_DECL_SUBCLASS(name, base) OS_OBJECT_DECL_SUBCLASS(name, base)
-
-DISPATCH_INLINE DISPATCH_ALWAYS_INLINE DISPATCH_NONNULL_ALL DISPATCH_NOTHROW
-void
-_dispatch_object_validate(dispatch_object_t object)
-{
- void *isa = *(void *volatile*)(OS_OBJECT_BRIDGE void*)object;
- (void)isa;
-}
-#endif // OS_OBJECT_SWIFT3
-
-#define DISPATCH_GLOBAL_OBJECT(type, object) ((OS_OBJECT_BRIDGE type)&(object))
-#define DISPATCH_RETURNS_RETAINED OS_OBJECT_RETURNS_RETAINED
-#elif defined(__cplusplus) && !defined(__DISPATCH_BUILDING_DISPATCH__)
-/*
- * Dispatch objects are NOT C++ objects. Nevertheless, we can at least keep C++
- * aware of type compatibility.
- */
-typedef struct dispatch_object_s {
-private:
- dispatch_object_s();
- ~dispatch_object_s();
- dispatch_object_s(const dispatch_object_s &);
- void operator=(const dispatch_object_s &);
-} *dispatch_object_t;
-#define DISPATCH_DECL(name) \
- typedef struct name##_s : public dispatch_object_s {} *name##_t
-#define DISPATCH_DECL_SUBCLASS(name, base) \
- typedef struct name##_s : public base##_s {} *name##_t
-#define DISPATCH_GLOBAL_OBJECT(type, object) (static_cast(&(object)))
-#define DISPATCH_RETURNS_RETAINED
-#else /* Plain C */
-typedef union {
- struct _os_object_s *_os_obj;
- struct dispatch_object_s *_do;
- struct dispatch_queue_s *_dq;
- struct dispatch_queue_attr_s *_dqa;
- struct dispatch_group_s *_dg;
- struct dispatch_source_s *_ds;
- struct dispatch_channel_s *_dch;
- struct dispatch_mach_s *_dm;
- struct dispatch_mach_msg_s *_dmsg;
- struct dispatch_semaphore_s *_dsema;
- struct dispatch_data_s *_ddata;
- struct dispatch_io_s *_dchannel;
-} dispatch_object_t DISPATCH_TRANSPARENT_UNION;
-#define DISPATCH_DECL(name) typedef struct name##_s *name##_t
-#define DISPATCH_DECL_SUBCLASS(name, base) typedef base##_t name##_t
-#define DISPATCH_GLOBAL_OBJECT(type, object) ((type)&(object))
-#define DISPATCH_RETURNS_RETAINED
-#endif
-
-#if OS_OBJECT_SWIFT3 && OS_OBJECT_USE_OBJC
-#define DISPATCH_SOURCE_TYPE_DECL(name) \
- DISPATCH_EXPORT struct dispatch_source_type_s \
- _dispatch_source_type_##name; \
- OS_OBJECT_DECL_PROTOCOL(dispatch_source_##name, ); \
- OS_OBJECT_CLASS_IMPLEMENTS_PROTOCOL( \
- dispatch_source, dispatch_source_##name)
-#define DISPATCH_SOURCE_DECL(name) \
- DISPATCH_DECL(name); \
- OS_OBJECT_DECL_PROTOCOL(name, ); \
- OS_OBJECT_CLASS_IMPLEMENTS_PROTOCOL(name, name)
-#ifndef DISPATCH_DATA_DECL
-#define DISPATCH_DATA_DECL(name) OS_OBJECT_DECL_SWIFT(name)
-#endif // DISPATCH_DATA_DECL
-#else
-#define DISPATCH_SOURCE_DECL(name) \
- DISPATCH_DECL(name);
-#define DISPATCH_DATA_DECL(name) DISPATCH_DECL(name)
-#define DISPATCH_SOURCE_TYPE_DECL(name) \
- DISPATCH_EXPORT const struct dispatch_source_type_s \
- _dispatch_source_type_##name
-#endif
-
-#ifdef __BLOCKS__
-/*!
- * @typedef dispatch_block_t
- *
- * @abstract
- * The type of blocks submitted to dispatch queues, which take no arguments
- * and have no return value.
- *
- * @discussion
- * When not building with Objective-C ARC, a block object allocated on or
- * copied to the heap must be released with a -[release] message or the
- * Block_release() function.
- *
- * The declaration of a block literal allocates storage on the stack.
- * Therefore, this is an invalid construct:
- *
- * dispatch_block_t block;
- * if (x) {
- * block = ^{ printf("true\n"); };
- * } else {
- * block = ^{ printf("false\n"); };
- * }
- * block(); // unsafe!!!
- *
- *
- * What is happening behind the scenes:
- *
- * if (x) {
- * struct Block __tmp_1 = ...; // setup details
- * block = &__tmp_1;
- * } else {
- * struct Block __tmp_2 = ...; // setup details
- * block = &__tmp_2;
- * }
- *
- *
- * As the example demonstrates, the address of a stack variable is escaping the
- * scope in which it is allocated. That is a classic C bug.
- *
- * Instead, the block literal must be copied to the heap with the Block_copy()
- * function or by sending it a -[copy] message.
- */
-typedef void (^dispatch_block_t)(void);
-#endif // __BLOCKS__
-
-__BEGIN_DECLS
-
-/*!
- * @typedef dispatch_qos_class_t
- * Alias for qos_class_t type.
- */
-#if __has_include()
-typedef qos_class_t dispatch_qos_class_t;
-#else
-typedef unsigned int dispatch_qos_class_t;
-#endif
-
-/*!
- * @function dispatch_retain
- *
- * @abstract
- * Increment the reference count of a dispatch object.
- *
- * @discussion
- * Calls to dispatch_retain() must be balanced with calls to
- * dispatch_release().
- *
- * @param object
- * The object to retain.
- * The result of passing NULL in this parameter is undefined.
- */
-API_AVAILABLE(macos(10.6), ios(4.0))
-DISPATCH_EXPORT DISPATCH_NONNULL_ALL DISPATCH_NOTHROW
-DISPATCH_SWIFT_UNAVAILABLE("Can't be used with ARC")
-void
-dispatch_retain(dispatch_object_t object);
-#if OS_OBJECT_USE_OBJC_RETAIN_RELEASE
-#undef dispatch_retain
-#define dispatch_retain(object) \
- __extension__({ dispatch_object_t _o = (object); \
- _dispatch_object_validate(_o); (void)[_o retain]; })
-#endif
-
-/*!
- * @function dispatch_release
- *
- * @abstract
- * Decrement the reference count of a dispatch object.
- *
- * @discussion
- * A dispatch object is asynchronously deallocated once all references are
- * released (i.e. the reference count becomes zero). The system does not
- * guarantee that a given client is the last or only reference to a given
- * object.
- *
- * @param object
- * The object to release.
- * The result of passing NULL in this parameter is undefined.
- */
-API_AVAILABLE(macos(10.6), ios(4.0))
-DISPATCH_EXPORT DISPATCH_NONNULL_ALL DISPATCH_NOTHROW
-DISPATCH_SWIFT_UNAVAILABLE("Can't be used with ARC")
-void
-dispatch_release(dispatch_object_t object);
-#if OS_OBJECT_USE_OBJC_RETAIN_RELEASE
-#undef dispatch_release
-#define dispatch_release(object) \
- __extension__({ dispatch_object_t _o = (object); \
- _dispatch_object_validate(_o); [_o release]; })
-#endif
-
-/*!
- * @function dispatch_get_context
- *
- * @abstract
- * Returns the application defined context of the object.
- *
- * @param object
- * The result of passing NULL in this parameter is undefined.
- *
- * @result
- * The context of the object; may be NULL.
- */
-API_AVAILABLE(macos(10.6), ios(4.0))
-DISPATCH_EXPORT DISPATCH_NONNULL_ALL DISPATCH_PURE DISPATCH_WARN_RESULT
-DISPATCH_NOTHROW
-void *_Nullable
-dispatch_get_context(dispatch_object_t object);
-
-/*!
- * @function dispatch_set_context
- *
- * @abstract
- * Associates an application defined context with the object.
- *
- * @param object
- * The result of passing NULL in this parameter is undefined.
- *
- * @param context
- * The new client defined context for the object. This may be NULL.
- *
- */
-API_AVAILABLE(macos(10.6), ios(4.0))
-DISPATCH_EXPORT DISPATCH_NOTHROW
-void
-dispatch_set_context(dispatch_object_t object, void *_Nullable context);
-
-/*!
- * @function dispatch_set_finalizer_f
- *
- * @abstract
- * Set the finalizer function for a dispatch object.
- *
- * @param object
- * The dispatch object to modify.
- * The result of passing NULL in this parameter is undefined.
- *
- * @param finalizer
- * The finalizer function pointer.
- *
- * @discussion
- * A dispatch object's finalizer will be invoked on the object's target queue
- * after all references to the object have been released. This finalizer may be
- * used by the application to release any resources associated with the object,
- * such as freeing the object's context.
- * The context parameter passed to the finalizer function is the current
- * context of the dispatch object at the time the finalizer call is made.
- */
-API_AVAILABLE(macos(10.6), ios(4.0))
-DISPATCH_EXPORT DISPATCH_NOTHROW
-void
-dispatch_set_finalizer_f(dispatch_object_t object,
- dispatch_function_t _Nullable finalizer);
-
-/*!
- * @function dispatch_activate
- *
- * @abstract
- * Activates the specified dispatch object.
- *
- * @discussion
- * Dispatch objects such as queues and sources may be created in an inactive
- * state. Objects in this state have to be activated before any blocks
- * associated with them will be invoked.
- *
- * The target queue of inactive objects can be changed using
- * dispatch_set_target_queue(). Change of target queue is no longer permitted
- * once an initially inactive object has been activated.
- *
- * Calling dispatch_activate() on an active object has no effect.
- * Releasing the last reference count on an inactive object is undefined.
- *
- * @param object
- * The object to be activated.
- * The result of passing NULL in this parameter is undefined.
- */
-API_AVAILABLE(macos(10.12), ios(10.0), tvos(10.0), watchos(3.0))
-DISPATCH_EXPORT DISPATCH_NONNULL_ALL DISPATCH_NOTHROW
-void
-dispatch_activate(dispatch_object_t object);
-
-/*!
- * @function dispatch_suspend
- *
- * @abstract
- * Suspends the invocation of blocks on a dispatch object.
- *
- * @discussion
- * A suspended object will not invoke any blocks associated with it. The
- * suspension of an object will occur after any running block associated with
- * the object completes.
- *
- * Calls to dispatch_suspend() must be balanced with calls
- * to dispatch_resume().
- *
- * @param object
- * The object to be suspended.
- * The result of passing NULL in this parameter is undefined.
- */
-API_AVAILABLE(macos(10.6), ios(4.0))
-DISPATCH_EXPORT DISPATCH_NONNULL_ALL DISPATCH_NOTHROW
-void
-dispatch_suspend(dispatch_object_t object);
-
-/*!
- * @function dispatch_resume
- *
- * @abstract
- * Resumes the invocation of blocks on a dispatch object.
- *
- * @discussion
- * Dispatch objects can be suspended with dispatch_suspend(), which increments
- * an internal suspension count. dispatch_resume() is the inverse operation,
- * and consumes suspension counts. When the last suspension count is consumed,
- * blocks associated with the object will be invoked again.
- *
- * For backward compatibility reasons, dispatch_resume() on an inactive and not
- * otherwise suspended dispatch source object has the same effect as calling
- * dispatch_activate(). For new code, using dispatch_activate() is preferred.
- *
- * If the specified object has zero suspension count and is not an inactive
- * source, this function will result in an assertion and the process being
- * terminated.
- *
- * @param object
- * The object to be resumed.
- * The result of passing NULL in this parameter is undefined.
- */
-API_AVAILABLE(macos(10.6), ios(4.0))
-DISPATCH_EXPORT DISPATCH_NONNULL_ALL DISPATCH_NOTHROW
-void
-dispatch_resume(dispatch_object_t object);
-
-/*!
- * @function dispatch_set_qos_class_floor
- *
- * @abstract
- * Sets the QOS class floor on a dispatch queue, source or workloop.
- *
- * @discussion
- * The QOS class of workitems submitted to this object asynchronously will be
- * elevated to at least the specified QOS class floor. The QOS of the workitem
- * will be used if higher than the floor even when the workitem has been created
- * without "ENFORCE" semantics.
- *
- * Setting the QOS class floor is equivalent to the QOS effects of configuring
- * a queue whose target queue has a QoS class set to the same value.
- *
- * @param object
- * A dispatch queue, workloop, or source to configure.
- * The object must be inactive.
- *
- * Passing another object type or an object that has been activated is undefined
- * and will cause the process to be terminated.
- *
- * @param qos_class
- * A QOS class value:
- * - QOS_CLASS_USER_INTERACTIVE
- * - QOS_CLASS_USER_INITIATED
- * - QOS_CLASS_DEFAULT
- * - QOS_CLASS_UTILITY
- * - QOS_CLASS_BACKGROUND
- * Passing any other value is undefined.
- *
- * @param relative_priority
- * A relative priority within the QOS class. This value is a negative
- * offset from the maximum supported scheduler priority for the given class.
- * Passing a value greater than zero or less than QOS_MIN_RELATIVE_PRIORITY
- * is undefined.
- */
-API_AVAILABLE(macos(10.14), ios(12.0), tvos(12.0), watchos(5.0))
-DISPATCH_EXPORT DISPATCH_NOTHROW
-void
-dispatch_set_qos_class_floor(dispatch_object_t object,
- dispatch_qos_class_t qos_class, int relative_priority);
-
-#ifdef __BLOCKS__
-/*!
- * @function dispatch_wait
- *
- * @abstract
- * Wait synchronously for an object or until the specified timeout has elapsed.
- *
- * @discussion
- * Type-generic macro that maps to dispatch_block_wait, dispatch_group_wait or
- * dispatch_semaphore_wait, depending on the type of the first argument.
- * See documentation for these functions for more details.
- * This function is unavailable for any other object type.
- *
- * @param object
- * The object to wait on.
- * The result of passing NULL in this parameter is undefined.
- *
- * @param timeout
- * When to timeout (see dispatch_time). As a convenience, there are the
- * DISPATCH_TIME_NOW and DISPATCH_TIME_FOREVER constants.
- *
- * @result
- * Returns zero on success or non-zero on error (i.e. timed out).
- */
-DISPATCH_UNAVAILABLE
-DISPATCH_EXPORT DISPATCH_NONNULL1 DISPATCH_NOTHROW
-long
-dispatch_wait(void *object, dispatch_time_t timeout);
-#if __has_extension(c_generic_selections)
-#define dispatch_wait(object, timeout) \
- _Generic((object), \
- dispatch_block_t:dispatch_block_wait, \
- dispatch_group_t:dispatch_group_wait, \
- dispatch_semaphore_t:dispatch_semaphore_wait \
- )((object),(timeout))
-#endif
-
-/*!
- * @function dispatch_notify
- *
- * @abstract
- * Schedule a notification block to be submitted to a queue when the execution
- * of a specified object has completed.
- *
- * @discussion
- * Type-generic macro that maps to dispatch_block_notify or
- * dispatch_group_notify, depending on the type of the first argument.
- * See documentation for these functions for more details.
- * This function is unavailable for any other object type.
- *
- * @param object
- * The object to observe.
- * The result of passing NULL in this parameter is undefined.
- *
- * @param queue
- * The queue to which the supplied notification block will be submitted when
- * the observed object completes.
- *
- * @param notification_block
- * The block to submit when the observed object completes.
- */
-DISPATCH_UNAVAILABLE
-DISPATCH_EXPORT DISPATCH_NONNULL_ALL DISPATCH_NOTHROW
-void
-dispatch_notify(void *object, dispatch_object_t queue,
- dispatch_block_t notification_block);
-#if __has_extension(c_generic_selections)
-#define dispatch_notify(object, queue, notification_block) \
- _Generic((object), \
- dispatch_block_t:dispatch_block_notify, \
- dispatch_group_t:dispatch_group_notify \
- )((object),(queue), (notification_block))
-#endif
-
-/*!
- * @function dispatch_cancel
- *
- * @abstract
- * Cancel the specified object.
- *
- * @discussion
- * Type-generic macro that maps to dispatch_block_cancel or
- * dispatch_source_cancel, depending on the type of the first argument.
- * See documentation for these functions for more details.
- * This function is unavailable for any other object type.
- *
- * @param object
- * The object to cancel.
- * The result of passing NULL in this parameter is undefined.
- */
-DISPATCH_UNAVAILABLE
-DISPATCH_EXPORT DISPATCH_NONNULL_ALL DISPATCH_NOTHROW
-void
-dispatch_cancel(void *object);
-#if __has_extension(c_generic_selections)
-#define dispatch_cancel(object) \
- _Generic((object), \
- dispatch_block_t:dispatch_block_cancel, \
- dispatch_source_t:dispatch_source_cancel \
- )((object))
-#endif
-
-/*!
- * @function dispatch_testcancel
- *
- * @abstract
- * Test whether the specified object has been canceled
- *
- * @discussion
- * Type-generic macro that maps to dispatch_block_testcancel or
- * dispatch_source_testcancel, depending on the type of the first argument.
- * See documentation for these functions for more details.
- * This function is unavailable for any other object type.
- *
- * @param object
- * The object to test.
- * The result of passing NULL in this parameter is undefined.
- *
- * @result
- * Non-zero if canceled and zero if not canceled.
- */
-DISPATCH_UNAVAILABLE
-DISPATCH_EXPORT DISPATCH_NONNULL_ALL DISPATCH_WARN_RESULT DISPATCH_PURE
-DISPATCH_NOTHROW
-long
-dispatch_testcancel(void *object);
-#if __has_extension(c_generic_selections)
-#define dispatch_testcancel(object) \
- _Generic((object), \
- dispatch_block_t:dispatch_block_testcancel, \
- dispatch_source_t:dispatch_source_testcancel \
- )((object))
-#endif
-#endif // __BLOCKS__
-
-/*!
- * @function dispatch_debug
- *
- * @abstract
- * Programmatically log debug information about a dispatch object.
- *
- * @discussion
- * Programmatically log debug information about a dispatch object. By default,
- * the log output is sent to syslog at notice level. In the debug version of
- * the library, the log output is sent to a file in /var/tmp.
- * The log output destination can be configured via the LIBDISPATCH_LOG
- * environment variable, valid values are: YES, NO, syslog, stderr, file.
- *
- * This function is deprecated and will be removed in a future release.
- * Objective-C callers may use -debugDescription instead.
- *
- * @param object
- * The object to introspect.
- *
- * @param message
- * The message to log above and beyond the introspection.
- */
-API_DEPRECATED("unsupported interface", macos(10.6,10.9), ios(4.0,6.0))
-DISPATCH_EXPORT DISPATCH_NONNULL2 DISPATCH_NOTHROW DISPATCH_COLD
-__attribute__((__format__(printf,2,3)))
-void
-dispatch_debug(dispatch_object_t object, const char *message, ...);
-
-API_DEPRECATED("unsupported interface", macos(10.6,10.9), ios(4.0,6.0))
-DISPATCH_EXPORT DISPATCH_NONNULL2 DISPATCH_NOTHROW DISPATCH_COLD
-__attribute__((__format__(printf,2,0)))
-void
-dispatch_debugv(dispatch_object_t object, const char *message, va_list ap);
-
-__END_DECLS
-
-DISPATCH_ASSUME_NONNULL_END
-
-#endif
\ No newline at end of file
diff --git a/lib/libc/include/x86_64-macos-gnu/dispatch/queue.h b/lib/libc/include/x86_64-macos-gnu/dispatch/queue.h
deleted file mode 100644
index f644b0266d..0000000000
--- a/lib/libc/include/x86_64-macos-gnu/dispatch/queue.h
+++ /dev/null
@@ -1,1674 +0,0 @@
-/*
- * Copyright (c) 2008-2014 Apple Inc. All rights reserved.
- *
- * @APPLE_APACHE_LICENSE_HEADER_START@
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- * @APPLE_APACHE_LICENSE_HEADER_END@
- */
-
-#ifndef __DISPATCH_QUEUE__
-#define __DISPATCH_QUEUE__
-
-#ifndef __DISPATCH_INDIRECT__
-#error "Please #include instead of this file directly."
-#include // for HeaderDoc
-#endif
-
-DISPATCH_ASSUME_NONNULL_BEGIN
-
-/*!
- * @header
- *
- * Dispatch is an abstract model for expressing concurrency via simple but
- * powerful API.
- *
- * At the core, dispatch provides serial FIFO queues to which blocks may be
- * submitted. Blocks submitted to these dispatch queues are invoked on a pool
- * of threads fully managed by the system. No guarantee is made regarding
- * which thread a block will be invoked on; however, it is guaranteed that only
- * one block submitted to the FIFO dispatch queue will be invoked at a time.
- *
- * When multiple queues have blocks to be processed, the system is free to
- * allocate additional threads to invoke the blocks concurrently. When the
- * queues become empty, these threads are automatically released.
- */
-
-/*!
- * @typedef dispatch_queue_t
- *
- * @abstract
- * Dispatch queues invoke workitems submitted to them.
- *
- * @discussion
- * Dispatch queues come in many flavors, the most common one being the dispatch
- * serial queue (See dispatch_queue_serial_t).
- *
- * The system manages a pool of threads which process dispatch queues and invoke
- * workitems submitted to them.
- *
- * Conceptually a dispatch queue may have its own thread of execution, and
- * interaction between queues is highly asynchronous.
- *
- * Dispatch queues are reference counted via calls to dispatch_retain() and
- * dispatch_release(). Pending workitems submitted to a queue also hold a
- * reference to the queue until they have finished. Once all references to a
- * queue have been released, the queue will be deallocated by the system.
- */
-DISPATCH_DECL(dispatch_queue);
-
-/*!
- * @typedef dispatch_queue_global_t
- *
- * @abstract
- * Dispatch global concurrent queues are an abstraction around the system thread
- * pool which invokes workitems that are submitted to dispatch queues.
- *
- * @discussion
- * Dispatch global concurrent queues provide buckets of priorities on top of the
- * thread pool the system manages. The system will decide how many threads
- * to allocate to this pool depending on demand and system load. In particular,
- * the system tries to maintain a good level of concurrency for this resource,
- * and will create new threads when too many existing worker threads block in
- * system calls.
- *
- * The global concurrent queues are a shared resource and as such it is the
- * responsiblity of every user of this resource to not submit an unbounded
- * amount of work to this pool, especially work that may block, as this can
- * cause the system to spawn very large numbers of threads (aka. thread
- * explosion).
- *
- * Work items submitted to the global concurrent queues have no ordering
- * guarantee with respect to the order of submission, and workitems submitted
- * to these queues may be invoked concurrently.
- *
- * Dispatch global concurrent queues are well-known global objects that are
- * returned by dispatch_get_global_queue(). These objects cannot be modified.
- * Calls to dispatch_suspend(), dispatch_resume(), dispatch_set_context(), etc.,
- * will have no effect when used with queues of this type.
- */
-DISPATCH_DECL_SUBCLASS(dispatch_queue_global, dispatch_queue);
-
-/*!
- * @typedef dispatch_queue_serial_t
- *
- * @abstract
- * Dispatch serial queues invoke workitems submitted to them serially in FIFO
- * order.
- *
- * @discussion
- * Dispatch serial queues are lightweight objects to which workitems may be
- * submitted to be invoked in FIFO order. A serial queue will only invoke one
- * workitem at a time, but independent serial queues may each invoke their work
- * items concurrently with respect to each other.
- *
- * Serial queues can target each other (See dispatch_set_target_queue()). The
- * serial queue at the bottom of a queue hierarchy provides an exclusion
- * context: at most one workitem submitted to any of the queues in such
- * a hiearchy will run at any given time.
- *
- * Such hierarchies provide a natural construct to organize an application
- * subsystem around.
- *
- * Serial queues are created by passing a dispatch queue attribute derived from
- * DISPATCH_QUEUE_SERIAL to dispatch_queue_create_with_target().
- */
-DISPATCH_DECL_SUBCLASS(dispatch_queue_serial, dispatch_queue);
-
-/*!
- * @typedef dispatch_queue_main_t
- *
- * @abstract
- * The type of the default queue that is bound to the main thread.
- *
- * @discussion
- * The main queue is a serial queue (See dispatch_queue_serial_t) which is bound
- * to the main thread of an application.
- *
- * In order to invoke workitems submitted to the main queue, the application
- * must call dispatch_main(), NSApplicationMain(), or use a CFRunLoop on the
- * main thread.
- *
- * The main queue is a well known global object that is made automatically on
- * behalf of the main thread during process initialization and is returned by
- * dispatch_get_main_queue(). This object cannot be modified. Calls to
- * dispatch_suspend(), dispatch_resume(), dispatch_set_context(), etc., will
- * have no effect when used on the main queue.
- */
-DISPATCH_DECL_SUBCLASS(dispatch_queue_main, dispatch_queue_serial);
-
-/*!
- * @typedef dispatch_queue_concurrent_t
- *
- * @abstract
- * Dispatch concurrent queues invoke workitems submitted to them concurrently,
- * and admit a notion of barrier workitems.
- *
- * @discussion
- * Dispatch concurrent queues are lightweight objects to which regular and
- * barrier workitems may be submited. Barrier workitems are invoked in
- * exclusion of any other kind of workitem in FIFO order.
- *
- * Regular workitems can be invoked concurrently for the same concurrent queue,
- * in any order. However, regular workitems will not be invoked before any
- * barrier workitem submited ahead of them has been invoked.
- *
- * In other words, if a serial queue is equivalent to a mutex in the Dispatch
- * world, a concurrent queue is equivalent to a reader-writer lock, where
- * regular items are readers and barriers are writers.
- *
- * Concurrent queues are created by passing a dispatch queue attribute derived
- * from DISPATCH_QUEUE_CONCURRENT to dispatch_queue_create_with_target().
- *
- * Caveat:
- * Dispatch concurrent queues at this time do not implement priority inversion
- * avoidance when lower priority regular workitems (readers) are being invoked
- * and are preventing a higher priority barrier (writer) from being invoked.
- */
-DISPATCH_DECL_SUBCLASS(dispatch_queue_concurrent, dispatch_queue);
-
-__BEGIN_DECLS
-
-/*!
- * @function dispatch_async
- *
- * @abstract
- * Submits a block for asynchronous execution on a dispatch queue.
- *
- * @discussion
- * The dispatch_async() function is the fundamental mechanism for submitting
- * blocks to a dispatch queue.
- *
- * Calls to dispatch_async() always return immediately after the block has
- * been submitted, and never wait for the block to be invoked.
- *
- * The target queue determines whether the block will be invoked serially or
- * concurrently with respect to other blocks submitted to that same queue.
- * Serial queues are processed concurrently with respect to each other.
- *
- * @param queue
- * The target dispatch queue to which the block is submitted.
- * The system will hold a reference on the target queue until the block
- * has finished.
- * The result of passing NULL in this parameter is undefined.
- *
- * @param block
- * The block to submit to the target dispatch queue. This function performs
- * Block_copy() and Block_release() on behalf of callers.
- * The result of passing NULL in this parameter is undefined.
- */
-#ifdef __BLOCKS__
-API_AVAILABLE(macos(10.6), ios(4.0))
-DISPATCH_EXPORT DISPATCH_NONNULL_ALL DISPATCH_NOTHROW
-void
-dispatch_async(dispatch_queue_t queue, dispatch_block_t block);
-#endif
-
-/*!
- * @function dispatch_async_f
- *
- * @abstract
- * Submits a function for asynchronous execution on a dispatch queue.
- *
- * @discussion
- * See dispatch_async() for details.
- *
- * @param queue
- * The target dispatch queue to which the function is submitted.
- * The system will hold a reference on the target queue until the function
- * has returned.
- * The result of passing NULL in this parameter is undefined.
- *
- * @param context
- * The application-defined context parameter to pass to the function.
- *
- * @param work
- * The application-defined function to invoke on the target queue. The first
- * parameter passed to this function is the context provided to
- * dispatch_async_f().
- * The result of passing NULL in this parameter is undefined.
- */
-API_AVAILABLE(macos(10.6), ios(4.0))
-DISPATCH_EXPORT DISPATCH_NONNULL1 DISPATCH_NONNULL3 DISPATCH_NOTHROW
-void
-dispatch_async_f(dispatch_queue_t queue,
- void *_Nullable context, dispatch_function_t work);
-
-/*!
- * @function dispatch_sync
- *
- * @abstract
- * Submits a block for synchronous execution on a dispatch queue.
- *
- * @discussion
- * Submits a workitem to a dispatch queue like dispatch_async(), however
- * dispatch_sync() will not return until the workitem has finished.
- *
- * Work items submitted to a queue with dispatch_sync() do not observe certain
- * queue attributes of that queue when invoked (such as autorelease frequency
- * and QOS class).
- *
- * Calls to dispatch_sync() targeting the current queue will result
- * in dead-lock. Use of dispatch_sync() is also subject to the same
- * multi-party dead-lock problems that may result from the use of a mutex.
- * Use of dispatch_async() is preferred.
- *
- * Unlike dispatch_async(), no retain is performed on the target queue. Because
- * calls to this function are synchronous, the dispatch_sync() "borrows" the
- * reference of the caller.
- *
- * As an optimization, dispatch_sync() invokes the workitem on the thread which
- * submitted the workitem, except when the passed queue is the main queue or
- * a queue targetting it (See dispatch_queue_main_t,
- * dispatch_set_target_queue()).
- *
- * @param queue
- * The target dispatch queue to which the block is submitted.
- * The result of passing NULL in this parameter is undefined.
- *
- * @param block
- * The block to be invoked on the target dispatch queue.
- * The result of passing NULL in this parameter is undefined.
- */
-#ifdef __BLOCKS__
-API_AVAILABLE(macos(10.6), ios(4.0))
-DISPATCH_EXPORT DISPATCH_NONNULL_ALL DISPATCH_NOTHROW
-void
-dispatch_sync(dispatch_queue_t queue, DISPATCH_NOESCAPE dispatch_block_t block);
-#endif
-
-/*!
- * @function dispatch_sync_f
- *
- * @abstract
- * Submits a function for synchronous execution on a dispatch queue.
- *
- * @discussion
- * See dispatch_sync() for details.
- *
- * @param queue
- * The target dispatch queue to which the function is submitted.
- * The result of passing NULL in this parameter is undefined.
- *
- * @param context
- * The application-defined context parameter to pass to the function.
- *
- * @param work
- * The application-defined function to invoke on the target queue. The first
- * parameter passed to this function is the context provided to
- * dispatch_sync_f().
- * The result of passing NULL in this parameter is undefined.
- */
-API_AVAILABLE(macos(10.6), ios(4.0))
-DISPATCH_EXPORT DISPATCH_NONNULL1 DISPATCH_NONNULL3 DISPATCH_NOTHROW
-void
-dispatch_sync_f(dispatch_queue_t queue,
- void *_Nullable context, dispatch_function_t work);
-
-/*!
- * @function dispatch_async_and_wait
- *
- * @abstract
- * Submits a block for synchronous execution on a dispatch queue.
- *
- * @discussion
- * Submits a workitem to a dispatch queue like dispatch_async(), however
- * dispatch_async_and_wait() will not return until the workitem has finished.
- *
- * Like functions of the dispatch_sync family, dispatch_async_and_wait() is
- * subject to dead-lock (See dispatch_sync() for details).
- *
- * However, dispatch_async_and_wait() differs from functions of the
- * dispatch_sync family in two fundamental ways: how it respects queue
- * attributes and how it chooses the execution context invoking the workitem.
- *
- * Differences with dispatch_sync()
- *
- * Work items submitted to a queue with dispatch_async_and_wait() observe all
- * queue attributes of that queue when invoked (inluding autorelease frequency
- * or QOS class).
- *
- * When the runtime has brought up a thread to invoke the asynchronous workitems
- * already submitted to the specified queue, that servicing thread will also be
- * used to execute synchronous work submitted to the queue with
- * dispatch_async_and_wait().
- *
- * However, if the runtime has not brought up a thread to service the specified
- * queue (because it has no workitems enqueued, or only synchronous workitems),
- * then dispatch_async_and_wait() will invoke the workitem on the calling thread,
- * similar to the behaviour of functions in the dispatch_sync family.
- *
- * As an exception, if the queue the work is submitted to doesn't target
- * a global concurrent queue (for example because it targets the main queue),
- * then the workitem will never be invoked by the thread calling
- * dispatch_async_and_wait().
- *
- * In other words, dispatch_async_and_wait() is similar to submitting
- * a dispatch_block_create()d workitem to a queue and then waiting on it, as
- * shown in the code example below. However, dispatch_async_and_wait() is
- * significantly more efficient when a new thread is not required to execute
- * the workitem (as it will use the stack of the submitting thread instead of
- * requiring heap allocations).
- *
- *
- * dispatch_block_t b = dispatch_block_create(0, block);
- * dispatch_async(queue, b);
- * dispatch_block_wait(b, DISPATCH_TIME_FOREVER);
- * Block_release(b);
- *
- *
- * @param queue
- * The target dispatch queue to which the block is submitted.
- * The result of passing NULL in this parameter is undefined.
- *
- * @param block
- * The block to be invoked on the target dispatch queue.
- * The result of passing NULL in this parameter is undefined.
- */
-#ifdef __BLOCKS__
-API_AVAILABLE(macos(10.14), ios(12.0), tvos(12.0), watchos(5.0))
-DISPATCH_EXPORT DISPATCH_NONNULL_ALL DISPATCH_NOTHROW
-void
-dispatch_async_and_wait(dispatch_queue_t queue,
- DISPATCH_NOESCAPE dispatch_block_t block);
-#endif
-
-/*!
- * @function dispatch_async_and_wait_f
- *
- * @abstract
- * Submits a function for synchronous execution on a dispatch queue.
- *
- * @discussion
- * See dispatch_async_and_wait() for details.
- *
- * @param queue
- * The target dispatch queue to which the function is submitted.
- * The result of passing NULL in this parameter is undefined.
- *
- * @param context
- * The application-defined context parameter to pass to the function.
- *
- * @param work
- * The application-defined function to invoke on the target queue. The first
- * parameter passed to this function is the context provided to
- * dispatch_async_and_wait_f().
- * The result of passing NULL in this parameter is undefined.
- */
-API_AVAILABLE(macos(10.14), ios(12.0), tvos(12.0), watchos(5.0))
-DISPATCH_EXPORT DISPATCH_NONNULL1 DISPATCH_NONNULL3 DISPATCH_NOTHROW
-void
-dispatch_async_and_wait_f(dispatch_queue_t queue,
- void *_Nullable context, dispatch_function_t work);
-
-
-#if defined(__APPLE__) && \
- (defined(__IPHONE_OS_VERSION_MIN_REQUIRED) && \
- __IPHONE_OS_VERSION_MIN_REQUIRED < __IPHONE_7_0) || \
- (defined(__MAC_OS_X_VERSION_MIN_REQUIRED) && \
- __MAC_OS_X_VERSION_MIN_REQUIRED < __MAC_10_9)
-#define DISPATCH_APPLY_AUTO_AVAILABLE 0
-#define DISPATCH_APPLY_QUEUE_ARG_NULLABILITY _Nonnull
-#else
-#define DISPATCH_APPLY_AUTO_AVAILABLE 1
-#define DISPATCH_APPLY_QUEUE_ARG_NULLABILITY _Nullable
-#endif
-
-/*!
- * @constant DISPATCH_APPLY_AUTO
- *
- * @abstract
- * Constant to pass to dispatch_apply() or dispatch_apply_f() to request that
- * the system automatically use worker threads that match the configuration of
- * the current thread as closely as possible.
- *
- * @discussion
- * When submitting a block for parallel invocation, passing this constant as the
- * queue argument will automatically use the global concurrent queue that
- * matches the Quality of Service of the caller most closely.
- *
- * No assumptions should be made about which global concurrent queue will
- * actually be used.
- *
- * Using this constant deploys backward to macOS 10.9, iOS 7.0 and any tvOS or
- * watchOS version.
- */
-#if DISPATCH_APPLY_AUTO_AVAILABLE
-#define DISPATCH_APPLY_AUTO ((dispatch_queue_t _Nonnull)0)
-#endif
-
-/*!
- * @function dispatch_apply
- *
- * @abstract
- * Submits a block to a dispatch queue for parallel invocation.
- *
- * @discussion
- * Submits a block to a dispatch queue for parallel invocation. This function
- * waits for the task block to complete before returning. If the specified queue
- * is concurrent, the block may be invoked concurrently, and it must therefore
- * be reentrant safe.
- *
- * Each invocation of the block will be passed the current index of iteration.
- *
- * @param iterations
- * The number of iterations to perform.
- *
- * @param queue
- * The dispatch queue to which the block is submitted.
- * The preferred value to pass is DISPATCH_APPLY_AUTO to automatically use
- * a queue appropriate for the calling thread.
- *
- * @param block
- * The block to be invoked the specified number of iterations.
- * The result of passing NULL in this parameter is undefined.
- */
-#ifdef __BLOCKS__
-API_AVAILABLE(macos(10.6), ios(4.0))
-DISPATCH_EXPORT DISPATCH_NONNULL3 DISPATCH_NOTHROW
-void
-dispatch_apply(size_t iterations,
- dispatch_queue_t DISPATCH_APPLY_QUEUE_ARG_NULLABILITY queue,
- DISPATCH_NOESCAPE void (^block)(size_t));
-#endif
-
-/*!
- * @function dispatch_apply_f
- *
- * @abstract
- * Submits a function to a dispatch queue for parallel invocation.
- *
- * @discussion
- * See dispatch_apply() for details.
- *
- * @param iterations
- * The number of iterations to perform.
- *
- * @param queue
- * The dispatch queue to which the function is submitted.
- * The preferred value to pass is DISPATCH_APPLY_AUTO to automatically use
- * a queue appropriate for the calling thread.
- *
- * @param context
- * The application-defined context parameter to pass to the function.
- *
- * @param work
- * The application-defined function to invoke on the specified queue. The first
- * parameter passed to this function is the context provided to
- * dispatch_apply_f(). The second parameter passed to this function is the
- * current index of iteration.
- * The result of passing NULL in this parameter is undefined.
- */
-API_AVAILABLE(macos(10.6), ios(4.0))
-DISPATCH_EXPORT DISPATCH_NONNULL4 DISPATCH_NOTHROW
-void
-dispatch_apply_f(size_t iterations,
- dispatch_queue_t DISPATCH_APPLY_QUEUE_ARG_NULLABILITY queue,
- void *_Nullable context, void (*work)(void *_Nullable, size_t));
-
-/*!
- * @function dispatch_get_current_queue
- *
- * @abstract
- * Returns the queue on which the currently executing block is running.
- *
- * @discussion
- * Returns the queue on which the currently executing block is running.
- *
- * When dispatch_get_current_queue() is called outside of the context of a
- * submitted block, it will return the default concurrent queue.
- *
- * Recommended for debugging and logging purposes only:
- * The code must not make any assumptions about the queue returned, unless it
- * is one of the global queues or a queue the code has itself created.
- * The code must not assume that synchronous execution onto a queue is safe
- * from deadlock if that queue is not the one returned by
- * dispatch_get_current_queue().
- *
- * When dispatch_get_current_queue() is called on the main thread, it may
- * or may not return the same value as dispatch_get_main_queue(). Comparing
- * the two is not a valid way to test whether code is executing on the
- * main thread (see dispatch_assert_queue() and dispatch_assert_queue_not()).
- *
- * This function is deprecated and will be removed in a future release.
- *
- * @result
- * Returns the current queue.
- */
-API_DEPRECATED("unsupported interface", macos(10.6,10.9), ios(4.0,6.0))
-DISPATCH_EXPORT DISPATCH_PURE DISPATCH_WARN_RESULT DISPATCH_NOTHROW
-dispatch_queue_t
-dispatch_get_current_queue(void);
-
-API_AVAILABLE(macos(10.6), ios(4.0))
-DISPATCH_EXPORT
-struct dispatch_queue_s _dispatch_main_q;
-
-/*!
- * @function dispatch_get_main_queue
- *
- * @abstract
- * Returns the default queue that is bound to the main thread.
- *
- * @discussion
- * In order to invoke blocks submitted to the main queue, the application must
- * call dispatch_main(), NSApplicationMain(), or use a CFRunLoop on the main
- * thread.
- *
- * The main queue is meant to be used in application context to interact with
- * the main thread and the main runloop.
- *
- * Because the main queue doesn't behave entirely like a regular serial queue,
- * it may have unwanted side-effects when used in processes that are not UI apps
- * (daemons). For such processes, the main queue should be avoided.
- *
- * @see dispatch_queue_main_t
- *
- * @result
- * Returns the main queue. This queue is created automatically on behalf of
- * the main thread before main() is called.
- */
-DISPATCH_INLINE DISPATCH_ALWAYS_INLINE DISPATCH_CONST DISPATCH_NOTHROW
-dispatch_queue_main_t
-dispatch_get_main_queue(void)
-{
- return DISPATCH_GLOBAL_OBJECT(dispatch_queue_main_t, _dispatch_main_q);
-}
-
-/*!
- * @typedef dispatch_queue_priority_t
- * Type of dispatch_queue_priority
- *
- * @constant DISPATCH_QUEUE_PRIORITY_HIGH
- * Items dispatched to the queue will run at high priority,
- * i.e. the queue will be scheduled for execution before
- * any default priority or low priority queue.
- *
- * @constant DISPATCH_QUEUE_PRIORITY_DEFAULT
- * Items dispatched to the queue will run at the default
- * priority, i.e. the queue will be scheduled for execution
- * after all high priority queues have been scheduled, but
- * before any low priority queues have been scheduled.
- *
- * @constant DISPATCH_QUEUE_PRIORITY_LOW
- * Items dispatched to the queue will run at low priority,
- * i.e. the queue will be scheduled for execution after all
- * default priority and high priority queues have been
- * scheduled.
- *
- * @constant DISPATCH_QUEUE_PRIORITY_BACKGROUND
- * Items dispatched to the queue will run at background priority, i.e. the queue
- * will be scheduled for execution after all higher priority queues have been
- * scheduled and the system will run items on this queue on a thread with
- * background status as per setpriority(2) (i.e. disk I/O is throttled and the
- * thread's scheduling priority is set to lowest value).
- */
-#define DISPATCH_QUEUE_PRIORITY_HIGH 2
-#define DISPATCH_QUEUE_PRIORITY_DEFAULT 0
-#define DISPATCH_QUEUE_PRIORITY_LOW (-2)
-#define DISPATCH_QUEUE_PRIORITY_BACKGROUND INT16_MIN
-
-typedef long dispatch_queue_priority_t;
-
-/*!
- * @function dispatch_get_global_queue
- *
- * @abstract
- * Returns a well-known global concurrent queue of a given quality of service
- * class.
- *
- * @discussion
- * See dispatch_queue_global_t.
- *
- * @param identifier
- * A quality of service class defined in qos_class_t or a priority defined in
- * dispatch_queue_priority_t.
- *
- * It is recommended to use quality of service class values to identify the
- * well-known global concurrent queues:
- * - QOS_CLASS_USER_INTERACTIVE
- * - QOS_CLASS_USER_INITIATED
- * - QOS_CLASS_DEFAULT
- * - QOS_CLASS_UTILITY
- * - QOS_CLASS_BACKGROUND
- *
- * The global concurrent queues may still be identified by their priority,
- * which map to the following QOS classes:
- * - DISPATCH_QUEUE_PRIORITY_HIGH: QOS_CLASS_USER_INITIATED
- * - DISPATCH_QUEUE_PRIORITY_DEFAULT: QOS_CLASS_DEFAULT
- * - DISPATCH_QUEUE_PRIORITY_LOW: QOS_CLASS_UTILITY
- * - DISPATCH_QUEUE_PRIORITY_BACKGROUND: QOS_CLASS_BACKGROUND
- *
- * @param flags
- * Reserved for future use. Passing any value other than zero may result in
- * a NULL return value.
- *
- * @result
- * Returns the requested global queue or NULL if the requested global queue
- * does not exist.
- */
-API_AVAILABLE(macos(10.6), ios(4.0))
-DISPATCH_EXPORT DISPATCH_CONST DISPATCH_WARN_RESULT DISPATCH_NOTHROW
-dispatch_queue_global_t
-dispatch_get_global_queue(long identifier, unsigned long flags);
-
-/*!
- * @typedef dispatch_queue_attr_t
- *
- * @abstract
- * Attribute for dispatch queues.
- */
-DISPATCH_DECL(dispatch_queue_attr);
-
-/*!
- * @const DISPATCH_QUEUE_SERIAL
- *
- * @discussion
- * An attribute that can be used to create a dispatch queue that invokes blocks
- * serially in FIFO order.
- *
- * See dispatch_queue_serial_t.
- */
-#define DISPATCH_QUEUE_SERIAL NULL
-
-/*!
- * @const DISPATCH_QUEUE_SERIAL_INACTIVE
- *
- * @discussion
- * An attribute that can be used to create a dispatch queue that invokes blocks
- * serially in FIFO order, and that is initially inactive.
- *
- * See dispatch_queue_attr_make_initially_inactive().
- */
-#define DISPATCH_QUEUE_SERIAL_INACTIVE \
- dispatch_queue_attr_make_initially_inactive(DISPATCH_QUEUE_SERIAL)
-
-/*!
- * @const DISPATCH_QUEUE_CONCURRENT
- *
- * @discussion
- * An attribute that can be used to create a dispatch queue that may invoke
- * blocks concurrently and supports barrier blocks submitted with the dispatch
- * barrier API.
- *
- * See dispatch_queue_concurrent_t.
- */
-#define DISPATCH_QUEUE_CONCURRENT \
- DISPATCH_GLOBAL_OBJECT(dispatch_queue_attr_t, \
- _dispatch_queue_attr_concurrent)
-API_AVAILABLE(macos(10.7), ios(4.3))
-DISPATCH_EXPORT
-struct dispatch_queue_attr_s _dispatch_queue_attr_concurrent;
-
-/*!
- * @const DISPATCH_QUEUE_CONCURRENT_INACTIVE
- *
- * @discussion
- * An attribute that can be used to create a dispatch queue that may invoke
- * blocks concurrently and supports barrier blocks submitted with the dispatch
- * barrier API, and that is initially inactive.
- *
- * See dispatch_queue_attr_make_initially_inactive().
- */
-#define DISPATCH_QUEUE_CONCURRENT_INACTIVE \
- dispatch_queue_attr_make_initially_inactive(DISPATCH_QUEUE_CONCURRENT)
-
-/*!
- * @function dispatch_queue_attr_make_initially_inactive
- *
- * @abstract
- * Returns an attribute value which may be provided to dispatch_queue_create()
- * or dispatch_queue_create_with_target(), in order to make the created queue
- * initially inactive.
- *
- * @discussion
- * Dispatch queues may be created in an inactive state. Queues in this state
- * have to be activated before any blocks associated with them will be invoked.
- *
- * A queue in inactive state cannot be deallocated, dispatch_activate() must be
- * called before the last reference to a queue created with this attribute is
- * released.
- *
- * The target queue of a queue in inactive state can be changed using
- * dispatch_set_target_queue(). Change of target queue is no longer permitted
- * once an initially inactive queue has been activated.
- *
- * @param attr
- * A queue attribute value to be combined with the initially inactive attribute.
- *
- * @return
- * Returns an attribute value which may be provided to dispatch_queue_create()
- * and dispatch_queue_create_with_target().
- * The new value combines the attributes specified by the 'attr' parameter with
- * the initially inactive attribute.
- */
-API_AVAILABLE(macos(10.12), ios(10.0), tvos(10.0), watchos(3.0))
-DISPATCH_EXPORT DISPATCH_WARN_RESULT DISPATCH_PURE DISPATCH_NOTHROW
-dispatch_queue_attr_t
-dispatch_queue_attr_make_initially_inactive(
- dispatch_queue_attr_t _Nullable attr);
-
-/*!
- * @const DISPATCH_QUEUE_SERIAL_WITH_AUTORELEASE_POOL
- *
- * @discussion
- * A dispatch queue created with this attribute invokes blocks serially in FIFO
- * order, and surrounds execution of any block submitted asynchronously to it
- * with the equivalent of a individual Objective-C @autoreleasepool
- * scope.
- *
- * See dispatch_queue_attr_make_with_autorelease_frequency().
- */
-#define DISPATCH_QUEUE_SERIAL_WITH_AUTORELEASE_POOL \
- dispatch_queue_attr_make_with_autorelease_frequency(\
- DISPATCH_QUEUE_SERIAL, DISPATCH_AUTORELEASE_FREQUENCY_WORK_ITEM)
-
-/*!
- * @const DISPATCH_QUEUE_CONCURRENT_WITH_AUTORELEASE_POOL
- *
- * @discussion
- * A dispatch queue created with this attribute may invokes blocks concurrently
- * and supports barrier blocks submitted with the dispatch barrier API. It also
- * surrounds execution of any block submitted asynchronously to it with the
- * equivalent of a individual Objective-C @autoreleasepool
- *
- * See dispatch_queue_attr_make_with_autorelease_frequency().
- */
-#define DISPATCH_QUEUE_CONCURRENT_WITH_AUTORELEASE_POOL \
- dispatch_queue_attr_make_with_autorelease_frequency(\
- DISPATCH_QUEUE_CONCURRENT, DISPATCH_AUTORELEASE_FREQUENCY_WORK_ITEM)
-
-/*!
- * @typedef dispatch_autorelease_frequency_t
- * Values to pass to the dispatch_queue_attr_make_with_autorelease_frequency()
- * function.
- *
- * @const DISPATCH_AUTORELEASE_FREQUENCY_INHERIT
- * Dispatch queues with this autorelease frequency inherit the behavior from
- * their target queue. This is the default behavior for manually created queues.
- *
- * @const DISPATCH_AUTORELEASE_FREQUENCY_WORK_ITEM
- * Dispatch queues with this autorelease frequency push and pop an autorelease
- * pool around the execution of every block that was submitted to it
- * asynchronously.
- * @see dispatch_queue_attr_make_with_autorelease_frequency().
- *
- * @const DISPATCH_AUTORELEASE_FREQUENCY_NEVER
- * Dispatch queues with this autorelease frequency never set up an individual
- * autorelease pool around the execution of a block that is submitted to it
- * asynchronously. This is the behavior of the global concurrent queues.
- */
-DISPATCH_ENUM(dispatch_autorelease_frequency, unsigned long,
- DISPATCH_AUTORELEASE_FREQUENCY_INHERIT DISPATCH_ENUM_API_AVAILABLE(
- macos(10.12), ios(10.0), tvos(10.0), watchos(3.0)) = 0,
- DISPATCH_AUTORELEASE_FREQUENCY_WORK_ITEM DISPATCH_ENUM_API_AVAILABLE(
- macos(10.12), ios(10.0), tvos(10.0), watchos(3.0)) = 1,
- DISPATCH_AUTORELEASE_FREQUENCY_NEVER DISPATCH_ENUM_API_AVAILABLE(
- macos(10.12), ios(10.0), tvos(10.0), watchos(3.0)) = 2,
-);
-
-/*!
- * @function dispatch_queue_attr_make_with_autorelease_frequency
- *
- * @abstract
- * Returns a dispatch queue attribute value with the autorelease frequency
- * set to the specified value.
- *
- * @discussion
- * When a queue uses the per-workitem autorelease frequency (either directly
- * or inherithed from its target queue), any block submitted asynchronously to
- * this queue (via dispatch_async(), dispatch_barrier_async(),
- * dispatch_group_notify(), etc...) is executed as if surrounded by a individual
- * Objective-C @autoreleasepool scope.
- *
- * Autorelease frequency has no effect on blocks that are submitted
- * synchronously to a queue (via dispatch_sync(), dispatch_barrier_sync()).
- *
- * The global concurrent queues have the DISPATCH_AUTORELEASE_FREQUENCY_NEVER
- * behavior. Manually created dispatch queues use
- * DISPATCH_AUTORELEASE_FREQUENCY_INHERIT by default.
- *
- * Queues created with this attribute cannot change target queues after having
- * been activated. See dispatch_set_target_queue() and dispatch_activate().
- *
- * @param attr
- * A queue attribute value to be combined with the specified autorelease
- * frequency or NULL.
- *
- * @param frequency
- * The requested autorelease frequency.
- *
- * @return
- * Returns an attribute value which may be provided to dispatch_queue_create()
- * or NULL if an invalid autorelease frequency was requested.
- * This new value combines the attributes specified by the 'attr' parameter and
- * the chosen autorelease frequency.
- */
-API_AVAILABLE(macos(10.12), ios(10.0), tvos(10.0), watchos(3.0))
-DISPATCH_EXPORT DISPATCH_WARN_RESULT DISPATCH_PURE DISPATCH_NOTHROW
-dispatch_queue_attr_t
-dispatch_queue_attr_make_with_autorelease_frequency(
- dispatch_queue_attr_t _Nullable attr,
- dispatch_autorelease_frequency_t frequency);
-
-/*!
- * @function dispatch_queue_attr_make_with_qos_class
- *
- * @abstract
- * Returns an attribute value which may be provided to dispatch_queue_create()
- * or dispatch_queue_create_with_target(), in order to assign a QOS class and
- * relative priority to the queue.
- *
- * @discussion
- * When specified in this manner, the QOS class and relative priority take
- * precedence over those inherited from the dispatch queue's target queue (if
- * any) as long that does not result in a lower QOS class and relative priority.
- *
- * The global queue priorities map to the following QOS classes:
- * - DISPATCH_QUEUE_PRIORITY_HIGH: QOS_CLASS_USER_INITIATED
- * - DISPATCH_QUEUE_PRIORITY_DEFAULT: QOS_CLASS_DEFAULT
- * - DISPATCH_QUEUE_PRIORITY_LOW: QOS_CLASS_UTILITY
- * - DISPATCH_QUEUE_PRIORITY_BACKGROUND: QOS_CLASS_BACKGROUND
- *
- * Example:
- *
- * dispatch_queue_t queue;
- * dispatch_queue_attr_t attr;
- * attr = dispatch_queue_attr_make_with_qos_class(DISPATCH_QUEUE_SERIAL,
- * QOS_CLASS_UTILITY, 0);
- * queue = dispatch_queue_create("com.example.myqueue", attr);
- *
- *
- * The QOS class and relative priority set this way on a queue have no effect on
- * blocks that are submitted synchronously to a queue (via dispatch_sync(),
- * dispatch_barrier_sync()).
- *
- * @param attr
- * A queue attribute value to be combined with the QOS class, or NULL.
- *
- * @param qos_class
- * A QOS class value:
- * - QOS_CLASS_USER_INTERACTIVE
- * - QOS_CLASS_USER_INITIATED
- * - QOS_CLASS_DEFAULT
- * - QOS_CLASS_UTILITY
- * - QOS_CLASS_BACKGROUND
- * Passing any other value results in NULL being returned.
- *
- * @param relative_priority
- * A relative priority within the QOS class. This value is a negative
- * offset from the maximum supported scheduler priority for the given class.
- * Passing a value greater than zero or less than QOS_MIN_RELATIVE_PRIORITY
- * results in NULL being returned.
- *
- * @return
- * Returns an attribute value which may be provided to dispatch_queue_create()
- * and dispatch_queue_create_with_target(), or NULL if an invalid QOS class was
- * requested.
- * The new value combines the attributes specified by the 'attr' parameter and
- * the new QOS class and relative priority.
- */
-API_AVAILABLE(macos(10.10), ios(8.0))
-DISPATCH_EXPORT DISPATCH_WARN_RESULT DISPATCH_PURE DISPATCH_NOTHROW
-dispatch_queue_attr_t
-dispatch_queue_attr_make_with_qos_class(dispatch_queue_attr_t _Nullable attr,
- dispatch_qos_class_t qos_class, int relative_priority);
-
-/*!
- * @const DISPATCH_TARGET_QUEUE_DEFAULT
- * @discussion Constant to pass to the dispatch_queue_create_with_target(),
- * dispatch_set_target_queue() and dispatch_source_create() functions to
- * indicate that the default target queue for the object type in question
- * should be used.
- */
-#define DISPATCH_TARGET_QUEUE_DEFAULT NULL
-
-/*!
- * @function dispatch_queue_create_with_target
- *
- * @abstract
- * Creates a new dispatch queue with a specified target queue.
- *
- * @discussion
- * Dispatch queues created with the DISPATCH_QUEUE_SERIAL or a NULL attribute
- * invoke blocks serially in FIFO order.
- *
- * Dispatch queues created with the DISPATCH_QUEUE_CONCURRENT attribute may
- * invoke blocks concurrently (similarly to the global concurrent queues, but
- * potentially with more overhead), and support barrier blocks submitted with
- * the dispatch barrier API, which e.g. enables the implementation of efficient
- * reader-writer schemes.
- *
- * When a dispatch queue is no longer needed, it should be released with
- * dispatch_release(). Note that any pending blocks submitted asynchronously to
- * a queue will hold a reference to that queue. Therefore a queue will not be
- * deallocated until all pending blocks have finished.
- *
- * When using a dispatch queue attribute @a attr specifying a QoS class (derived
- * from the result of dispatch_queue_attr_make_with_qos_class()), passing the
- * result of dispatch_get_global_queue() in @a target will ignore the QoS class
- * of that global queue and will use the global queue with the QoS class
- * specified by attr instead.
- *
- * Queues created with dispatch_queue_create_with_target() cannot have their
- * target queue changed, unless created inactive (See
- * dispatch_queue_attr_make_initially_inactive()), in which case the target
- * queue can be changed until the newly created queue is activated with
- * dispatch_activate().
- *
- * @param label
- * A string label to attach to the queue.
- * This parameter is optional and may be NULL.
- *
- * @param attr
- * A predefined attribute such as DISPATCH_QUEUE_SERIAL,
- * DISPATCH_QUEUE_CONCURRENT, or the result of a call to
- * a dispatch_queue_attr_make_with_* function.
- *
- * @param target
- * The target queue for the newly created queue. The target queue is retained.
- * If this parameter is DISPATCH_TARGET_QUEUE_DEFAULT, sets the queue's target
- * queue to the default target queue for the given queue type.
- *
- * @result
- * The newly created dispatch queue.
- */
-API_AVAILABLE(macos(10.12), ios(10.0), tvos(10.0), watchos(3.0))
-DISPATCH_EXPORT DISPATCH_MALLOC DISPATCH_RETURNS_RETAINED DISPATCH_WARN_RESULT
-DISPATCH_NOTHROW
-dispatch_queue_t
-dispatch_queue_create_with_target(const char *_Nullable label,
- dispatch_queue_attr_t _Nullable attr, dispatch_queue_t _Nullable target)
- DISPATCH_ALIAS_V2(dispatch_queue_create_with_target);
-
-/*!
- * @function dispatch_queue_create
- *
- * @abstract
- * Creates a new dispatch queue to which blocks may be submitted.
- *
- * @discussion
- * Dispatch queues created with the DISPATCH_QUEUE_SERIAL or a NULL attribute
- * invoke blocks serially in FIFO order.
- *
- * Dispatch queues created with the DISPATCH_QUEUE_CONCURRENT attribute may
- * invoke blocks concurrently (similarly to the global concurrent queues, but
- * potentially with more overhead), and support barrier blocks submitted with
- * the dispatch barrier API, which e.g. enables the implementation of efficient
- * reader-writer schemes.
- *
- * When a dispatch queue is no longer needed, it should be released with
- * dispatch_release(). Note that any pending blocks submitted asynchronously to
- * a queue will hold a reference to that queue. Therefore a queue will not be
- * deallocated until all pending blocks have finished.
- *
- * Passing the result of the dispatch_queue_attr_make_with_qos_class() function
- * to the attr parameter of this function allows a quality of service class and
- * relative priority to be specified for the newly created queue.
- * The quality of service class so specified takes precedence over the quality
- * of service class of the newly created dispatch queue's target queue (if any)
- * as long that does not result in a lower QOS class and relative priority.
- *
- * When no quality of service class is specified, the target queue of a newly
- * created dispatch queue is the default priority global concurrent queue.
- *
- * @param label
- * A string label to attach to the queue.
- * This parameter is optional and may be NULL.
- *
- * @param attr
- * A predefined attribute such as DISPATCH_QUEUE_SERIAL,
- * DISPATCH_QUEUE_CONCURRENT, or the result of a call to
- * a dispatch_queue_attr_make_with_* function.
- *
- * @result
- * The newly created dispatch queue.
- */
-API_AVAILABLE(macos(10.6), ios(4.0))
-DISPATCH_EXPORT DISPATCH_MALLOC DISPATCH_RETURNS_RETAINED DISPATCH_WARN_RESULT
-DISPATCH_NOTHROW
-dispatch_queue_t
-dispatch_queue_create(const char *_Nullable label,
- dispatch_queue_attr_t _Nullable attr);
-
-/*!
- * @const DISPATCH_CURRENT_QUEUE_LABEL
- * @discussion Constant to pass to the dispatch_queue_get_label() function to
- * retrieve the label of the current queue.
- */
-#define DISPATCH_CURRENT_QUEUE_LABEL NULL
-
-/*!
- * @function dispatch_queue_get_label
- *
- * @abstract
- * Returns the label of the given queue, as specified when the queue was
- * created, or the empty string if a NULL label was specified.
- *
- * Passing DISPATCH_CURRENT_QUEUE_LABEL will return the label of the current
- * queue.
- *
- * @param queue
- * The queue to query, or DISPATCH_CURRENT_QUEUE_LABEL.
- *
- * @result
- * The label of the queue.
- */
-API_AVAILABLE(macos(10.6), ios(4.0))
-DISPATCH_EXPORT DISPATCH_PURE DISPATCH_WARN_RESULT DISPATCH_NOTHROW
-const char *
-dispatch_queue_get_label(dispatch_queue_t _Nullable queue);
-
-/*!
- * @function dispatch_queue_get_qos_class
- *
- * @abstract
- * Returns the QOS class and relative priority of the given queue.
- *
- * @discussion
- * If the given queue was created with an attribute value returned from
- * dispatch_queue_attr_make_with_qos_class(), this function returns the QOS
- * class and relative priority specified at that time; for any other attribute
- * value it returns a QOS class of QOS_CLASS_UNSPECIFIED and a relative
- * priority of 0.
- *
- * If the given queue is one of the global queues, this function returns its
- * assigned QOS class value as documented under dispatch_get_global_queue() and
- * a relative priority of 0; in the case of the main queue it returns the QOS
- * value provided by qos_class_main() and a relative priority of 0.
- *
- * @param queue
- * The queue to query.
- *
- * @param relative_priority_ptr
- * A pointer to an int variable to be filled with the relative priority offset
- * within the QOS class, or NULL.
- *
- * @return
- * A QOS class value:
- * - QOS_CLASS_USER_INTERACTIVE
- * - QOS_CLASS_USER_INITIATED
- * - QOS_CLASS_DEFAULT
- * - QOS_CLASS_UTILITY
- * - QOS_CLASS_BACKGROUND
- * - QOS_CLASS_UNSPECIFIED
- */
-API_AVAILABLE(macos(10.10), ios(8.0))
-DISPATCH_EXPORT DISPATCH_WARN_RESULT DISPATCH_NONNULL1 DISPATCH_NOTHROW
-dispatch_qos_class_t
-dispatch_queue_get_qos_class(dispatch_queue_t queue,
- int *_Nullable relative_priority_ptr);
-
-/*!
- * @function dispatch_set_target_queue
- *
- * @abstract
- * Sets the target queue for the given object.
- *
- * @discussion
- * An object's target queue is responsible for processing the object.
- *
- * When no quality of service class and relative priority is specified for a
- * dispatch queue at the time of creation, a dispatch queue's quality of service
- * class is inherited from its target queue. The dispatch_get_global_queue()
- * function may be used to obtain a target queue of a specific quality of
- * service class, however the use of dispatch_queue_attr_make_with_qos_class()
- * is recommended instead.
- *
- * Blocks submitted to a serial queue whose target queue is another serial
- * queue will not be invoked concurrently with blocks submitted to the target
- * queue or to any other queue with that same target queue.
- *
- * The result of introducing a cycle into the hierarchy of target queues is
- * undefined.
- *
- * A dispatch source's target queue specifies where its event handler and
- * cancellation handler blocks will be submitted.
- *
- * A dispatch I/O channel's target queue specifies where where its I/O
- * operations are executed. If the channel's target queue's priority is set to
- * DISPATCH_QUEUE_PRIORITY_BACKGROUND, then the I/O operations performed by
- * dispatch_io_read() or dispatch_io_write() on that queue will be
- * throttled when there is I/O contention.
- *
- * For all other dispatch object types, the only function of the target queue
- * is to determine where an object's finalizer function is invoked.
- *
- * In general, changing the target queue of an object is an asynchronous
- * operation that doesn't take effect immediately, and doesn't affect blocks
- * already associated with the specified object.
- *
- * However, if an object is inactive at the time dispatch_set_target_queue() is
- * called, then the target queue change takes effect immediately, and will
- * affect blocks already associated with the specified object. After an
- * initially inactive object has been activated, calling
- * dispatch_set_target_queue() results in an assertion and the process being
- * terminated.
- *
- * If a dispatch queue is active and targeted by other dispatch objects,
- * changing its target queue results in undefined behavior.
- *
- * @param object
- * The object to modify.
- * The result of passing NULL in this parameter is undefined.
- *
- * @param queue
- * The new target queue for the object. The queue is retained, and the
- * previous target queue, if any, is released.
- * If queue is DISPATCH_TARGET_QUEUE_DEFAULT, set the object's target queue
- * to the default target queue for the given object type.
- */
-API_AVAILABLE(macos(10.6), ios(4.0))
-DISPATCH_EXPORT DISPATCH_NOTHROW
-void
-dispatch_set_target_queue(dispatch_object_t object,
- dispatch_queue_t _Nullable queue);
-
-/*!
- * @function dispatch_main
- *
- * @abstract
- * Execute blocks submitted to the main queue.
- *
- * @discussion
- * This function "parks" the main thread and waits for blocks to be submitted
- * to the main queue. This function never returns.
- *
- * Applications that call NSApplicationMain() or CFRunLoopRun() on the
- * main thread do not need to call dispatch_main().
- */
-API_AVAILABLE(macos(10.6), ios(4.0))
-DISPATCH_EXPORT DISPATCH_NOTHROW DISPATCH_NORETURN
-void
-dispatch_main(void);
-
-/*!
- * @function dispatch_after
- *
- * @abstract
- * Schedule a block for execution on a given queue at a specified time.
- *
- * @discussion
- * Passing DISPATCH_TIME_NOW as the "when" parameter is supported, but not as
- * optimal as calling dispatch_async() instead. Passing DISPATCH_TIME_FOREVER
- * is undefined.
- *
- * @param when
- * A temporal milestone returned by dispatch_time() or dispatch_walltime().
- *
- * @param queue
- * A queue to which the given block will be submitted at the specified time.
- * The result of passing NULL in this parameter is undefined.
- *
- * @param block
- * The block of code to execute.
- * The result of passing NULL in this parameter is undefined.
- */
-#ifdef __BLOCKS__
-API_AVAILABLE(macos(10.6), ios(4.0))
-DISPATCH_EXPORT DISPATCH_NONNULL2 DISPATCH_NONNULL3 DISPATCH_NOTHROW
-void
-dispatch_after(dispatch_time_t when, dispatch_queue_t queue,
- dispatch_block_t block);
-#endif
-
-/*!
- * @function dispatch_after_f
- *
- * @abstract
- * Schedule a function for execution on a given queue at a specified time.
- *
- * @discussion
- * See dispatch_after() for details.
- *
- * @param when
- * A temporal milestone returned by dispatch_time() or dispatch_walltime().
- *
- * @param queue
- * A queue to which the given function will be submitted at the specified time.
- * The result of passing NULL in this parameter is undefined.
- *
- * @param context
- * The application-defined context parameter to pass to the function.
- *
- * @param work
- * The application-defined function to invoke on the target queue. The first
- * parameter passed to this function is the context provided to
- * dispatch_after_f().
- * The result of passing NULL in this parameter is undefined.
- */
-API_AVAILABLE(macos(10.6), ios(4.0))
-DISPATCH_EXPORT DISPATCH_NONNULL2 DISPATCH_NONNULL4 DISPATCH_NOTHROW
-void
-dispatch_after_f(dispatch_time_t when, dispatch_queue_t queue,
- void *_Nullable context, dispatch_function_t work);
-
-/*!
- * @functiongroup Dispatch Barrier API
- * The dispatch barrier API is a mechanism for submitting barrier blocks to a
- * dispatch queue, analogous to the dispatch_async()/dispatch_sync() API.
- * It enables the implementation of efficient reader/writer schemes.
- * Barrier blocks only behave specially when submitted to queues created with
- * the DISPATCH_QUEUE_CONCURRENT attribute; on such a queue, a barrier block
- * will not run until all blocks submitted to the queue earlier have completed,
- * and any blocks submitted to the queue after a barrier block will not run
- * until the barrier block has completed.
- * When submitted to a a global queue or to a queue not created with the
- * DISPATCH_QUEUE_CONCURRENT attribute, barrier blocks behave identically to
- * blocks submitted with the dispatch_async()/dispatch_sync() API.
- */
-
-/*!
- * @function dispatch_barrier_async
- *
- * @abstract
- * Submits a barrier block for asynchronous execution on a dispatch queue.
- *
- * @discussion
- * Submits a block to a dispatch queue like dispatch_async(), but marks that
- * block as a barrier (relevant only on DISPATCH_QUEUE_CONCURRENT queues).
- *
- * See dispatch_async() for details and "Dispatch Barrier API" for a description
- * of the barrier semantics.
- *
- * @param queue
- * The target dispatch queue to which the block is submitted.
- * The system will hold a reference on the target queue until the block
- * has finished.
- * The result of passing NULL in this parameter is undefined.
- *
- * @param block
- * The block to submit to the target dispatch queue. This function performs
- * Block_copy() and Block_release() on behalf of callers.
- * The result of passing NULL in this parameter is undefined.
- */
-#ifdef __BLOCKS__
-API_AVAILABLE(macos(10.7), ios(4.3))
-DISPATCH_EXPORT DISPATCH_NONNULL_ALL DISPATCH_NOTHROW
-void
-dispatch_barrier_async(dispatch_queue_t queue, dispatch_block_t block);
-#endif
-
-/*!
- * @function dispatch_barrier_async_f
- *
- * @abstract
- * Submits a barrier function for asynchronous execution on a dispatch queue.
- *
- * @discussion
- * Submits a function to a dispatch queue like dispatch_async_f(), but marks
- * that function as a barrier (relevant only on DISPATCH_QUEUE_CONCURRENT
- * queues).
- *
- * See dispatch_async_f() for details and "Dispatch Barrier API" for a
- * description of the barrier semantics.
- *
- * @param queue
- * The target dispatch queue to which the function is submitted.
- * The system will hold a reference on the target queue until the function
- * has returned.
- * The result of passing NULL in this parameter is undefined.
- *
- * @param context
- * The application-defined context parameter to pass to the function.
- *
- * @param work
- * The application-defined function to invoke on the target queue. The first
- * parameter passed to this function is the context provided to
- * dispatch_barrier_async_f().
- * The result of passing NULL in this parameter is undefined.
- */
-API_AVAILABLE(macos(10.7), ios(4.3))
-DISPATCH_EXPORT DISPATCH_NONNULL1 DISPATCH_NONNULL3 DISPATCH_NOTHROW
-void
-dispatch_barrier_async_f(dispatch_queue_t queue,
- void *_Nullable context, dispatch_function_t work);
-
-/*!
- * @function dispatch_barrier_sync
- *
- * @abstract
- * Submits a barrier block for synchronous execution on a dispatch queue.
- *
- * @discussion
- * Submits a block to a dispatch queue like dispatch_sync(), but marks that
- * block as a barrier (relevant only on DISPATCH_QUEUE_CONCURRENT queues).
- *
- * See dispatch_sync() for details and "Dispatch Barrier API" for a description
- * of the barrier semantics.
- *
- * @param queue
- * The target dispatch queue to which the block is submitted.
- * The result of passing NULL in this parameter is undefined.
- *
- * @param block
- * The block to be invoked on the target dispatch queue.
- * The result of passing NULL in this parameter is undefined.
- */
-#ifdef __BLOCKS__
-API_AVAILABLE(macos(10.7), ios(4.3))
-DISPATCH_EXPORT DISPATCH_NONNULL_ALL DISPATCH_NOTHROW
-void
-dispatch_barrier_sync(dispatch_queue_t queue,
- DISPATCH_NOESCAPE dispatch_block_t block);
-#endif
-
-/*!
- * @function dispatch_barrier_sync_f
- *
- * @abstract
- * Submits a barrier function for synchronous execution on a dispatch queue.
- *
- * @discussion
- * Submits a function to a dispatch queue like dispatch_sync_f(), but marks that
- * fuction as a barrier (relevant only on DISPATCH_QUEUE_CONCURRENT queues).
- *
- * See dispatch_sync_f() for details.
- *
- * @param queue
- * The target dispatch queue to which the function is submitted.
- * The result of passing NULL in this parameter is undefined.
- *
- * @param context
- * The application-defined context parameter to pass to the function.
- *
- * @param work
- * The application-defined function to invoke on the target queue. The first
- * parameter passed to this function is the context provided to
- * dispatch_barrier_sync_f().
- * The result of passing NULL in this parameter is undefined.
- */
-API_AVAILABLE(macos(10.7), ios(4.3))
-DISPATCH_EXPORT DISPATCH_NONNULL1 DISPATCH_NONNULL3 DISPATCH_NOTHROW
-void
-dispatch_barrier_sync_f(dispatch_queue_t queue,
- void *_Nullable context, dispatch_function_t work);
-
-/*!
- * @function dispatch_barrier_async_and_wait
- *
- * @abstract
- * Submits a block for synchronous execution on a dispatch queue.
- *
- * @discussion
- * Submits a block to a dispatch queue like dispatch_async_and_wait(), but marks
- * that block as a barrier (relevant only on DISPATCH_QUEUE_CONCURRENT
- * queues).
- *
- * See "Dispatch Barrier API" for a description of the barrier semantics.
- *
- * @param queue
- * The target dispatch queue to which the block is submitted.
- * The result of passing NULL in this parameter is undefined.
- *
- * @param work
- * The application-defined block to invoke on the target queue.
- * The result of passing NULL in this parameter is undefined.
- */
-#ifdef __BLOCKS__
-API_AVAILABLE(macos(10.14), ios(12.0), tvos(12.0), watchos(5.0))
-DISPATCH_EXPORT DISPATCH_NONNULL_ALL DISPATCH_NOTHROW
-void
-dispatch_barrier_async_and_wait(dispatch_queue_t queue,
- DISPATCH_NOESCAPE dispatch_block_t block);
-#endif
-
-/*!
- * @function dispatch_barrier_async_and_wait_f
- *
- * @abstract
- * Submits a function for synchronous execution on a dispatch queue.
- *
- * @discussion
- * Submits a function to a dispatch queue like dispatch_async_and_wait_f(), but
- * marks that function as a barrier (relevant only on DISPATCH_QUEUE_CONCURRENT
- * queues).
- *
- * See "Dispatch Barrier API" for a description of the barrier semantics.
- *
- * @param queue
- * The target dispatch queue to which the function is submitted.
- * The result of passing NULL in this parameter is undefined.
- *
- * @param context
- * The application-defined context parameter to pass to the function.
- *
- * @param work
- * The application-defined function to invoke on the target queue. The first
- * parameter passed to this function is the context provided to
- * dispatch_barrier_async_and_wait_f().
- * The result of passing NULL in this parameter is undefined.
- */
-API_AVAILABLE(macos(10.14), ios(12.0), tvos(12.0), watchos(5.0))
-DISPATCH_EXPORT DISPATCH_NONNULL1 DISPATCH_NONNULL3 DISPATCH_NOTHROW
-void
-dispatch_barrier_async_and_wait_f(dispatch_queue_t queue,
- void *_Nullable context, dispatch_function_t work);
-
-/*!
- * @functiongroup Dispatch queue-specific contexts
- * This API allows different subsystems to associate context to a shared queue
- * without risk of collision and to retrieve that context from blocks executing
- * on that queue or any of its child queues in the target queue hierarchy.
- */
-
-/*!
- * @function dispatch_queue_set_specific
- *
- * @abstract
- * Associates a subsystem-specific context with a dispatch queue, for a key
- * unique to the subsystem.
- *
- * @discussion
- * The specified destructor will be invoked with the context on the default
- * priority global concurrent queue when a new context is set for the same key,
- * or after all references to the queue have been released.
- *
- * @param queue
- * The dispatch queue to modify.
- * The result of passing NULL in this parameter is undefined.
- *
- * @param key
- * The key to set the context for, typically a pointer to a static variable
- * specific to the subsystem. Keys are only compared as pointers and never
- * dereferenced. Passing a string constant directly is not recommended.
- * The NULL key is reserved and attempts to set a context for it are ignored.
- *
- * @param context
- * The new subsystem-specific context for the object. This may be NULL.
- *
- * @param destructor
- * The destructor function pointer. This may be NULL and is ignored if context
- * is NULL.
- */
-API_AVAILABLE(macos(10.7), ios(5.0))
-DISPATCH_EXPORT DISPATCH_NONNULL1 DISPATCH_NOTHROW
-void
-dispatch_queue_set_specific(dispatch_queue_t queue, const void *key,
- void *_Nullable context, dispatch_function_t _Nullable destructor);
-
-/*!
- * @function dispatch_queue_get_specific
- *
- * @abstract
- * Returns the subsystem-specific context associated with a dispatch queue, for
- * a key unique to the subsystem.
- *
- * @discussion
- * Returns the context for the specified key if it has been set on the specified
- * queue.
- *
- * @param queue
- * The dispatch queue to query.
- * The result of passing NULL in this parameter is undefined.
- *
- * @param key
- * The key to get the context for, typically a pointer to a static variable
- * specific to the subsystem. Keys are only compared as pointers and never
- * dereferenced. Passing a string constant directly is not recommended.
- *
- * @result
- * The context for the specified key or NULL if no context was found.
- */
-API_AVAILABLE(macos(10.7), ios(5.0))
-DISPATCH_EXPORT DISPATCH_NONNULL1 DISPATCH_PURE DISPATCH_WARN_RESULT
-DISPATCH_NOTHROW
-void *_Nullable
-dispatch_queue_get_specific(dispatch_queue_t queue, const void *key);
-
-/*!
- * @function dispatch_get_specific
- *
- * @abstract
- * Returns the current subsystem-specific context for a key unique to the
- * subsystem.
- *
- * @discussion
- * When called from a block executing on a queue, returns the context for the
- * specified key if it has been set on the queue, otherwise returns the result
- * of dispatch_get_specific() executed on the queue's target queue or NULL
- * if the current queue is a global concurrent queue.
- *
- * @param key
- * The key to get the context for, typically a pointer to a static variable
- * specific to the subsystem. Keys are only compared as pointers and never
- * dereferenced. Passing a string constant directly is not recommended.
- *
- * @result
- * The context for the specified key or NULL if no context was found.
- */
-API_AVAILABLE(macos(10.7), ios(5.0))
-DISPATCH_EXPORT DISPATCH_PURE DISPATCH_WARN_RESULT DISPATCH_NOTHROW
-void *_Nullable
-dispatch_get_specific(const void *key);
-
-/*!
- * @functiongroup Dispatch assertion API
- *
- * This API asserts at runtime that code is executing in (or out of) the context
- * of a given queue. It can be used to check that a block accessing a resource
- * does so from the proper queue protecting the resource. It also can be used
- * to verify that a block that could cause a deadlock if run on a given queue
- * never executes on that queue.
- */
-
-/*!
- * @function dispatch_assert_queue
- *
- * @abstract
- * Verifies that the current block is executing on a given dispatch queue.
- *
- * @discussion
- * Some code expects to be run on a specific dispatch queue. This function
- * verifies that that expectation is true.
- *
- * If the currently executing block was submitted to the specified queue or to
- * any queue targeting it (see dispatch_set_target_queue()), this function
- * returns.
- *
- * If the currently executing block was submitted with a synchronous API
- * (dispatch_sync(), dispatch_barrier_sync(), ...), the context of the
- * submitting block is also evaluated (recursively).
- * If a synchronously submitting block is found that was itself submitted to
- * the specified queue or to any queue targeting it, this function returns.
- *
- * Otherwise this function asserts: it logs an explanation to the system log and
- * terminates the application.
- *
- * Passing the result of dispatch_get_main_queue() to this function verifies
- * that the current block was submitted to the main queue, or to a queue
- * targeting it, or is running on the main thread (in any context).
- *
- * When dispatch_assert_queue() is called outside of the context of a
- * submitted block (for example from the context of a thread created manually
- * with pthread_create()) then this function will also assert and terminate
- * the application.
- *
- * The variant dispatch_assert_queue_debug() is compiled out when the
- * preprocessor macro NDEBUG is defined. (See also assert(3)).
- *
- * @param queue
- * The dispatch queue that the current block is expected to run on.
- * The result of passing NULL in this parameter is undefined.
- */
-API_AVAILABLE(macos(10.12), ios(10.0), tvos(10.0), watchos(3.0))
-DISPATCH_EXPORT DISPATCH_NONNULL1
-void
-dispatch_assert_queue(dispatch_queue_t queue)
- DISPATCH_ALIAS_V2(dispatch_assert_queue);
-
-/*!
- * @function dispatch_assert_queue_barrier
- *
- * @abstract
- * Verifies that the current block is executing on a given dispatch queue,
- * and that the block acts as a barrier on that queue.
- *
- * @discussion
- * This behaves exactly like dispatch_assert_queue(), with the additional check
- * that the current block acts as a barrier on the specified queue, which is
- * always true if the specified queue is serial (see DISPATCH_BLOCK_BARRIER or
- * dispatch_barrier_async() for details).
- *
- * The variant dispatch_assert_queue_barrier_debug() is compiled out when the
- * preprocessor macro NDEBUG is defined. (See also assert()).
- *
- * @param queue
- * The dispatch queue that the current block is expected to run as a barrier on.
- * The result of passing NULL in this parameter is undefined.
- */
-API_AVAILABLE(macos(10.12), ios(10.0), tvos(10.0), watchos(3.0))
-DISPATCH_EXPORT DISPATCH_NONNULL1
-void
-dispatch_assert_queue_barrier(dispatch_queue_t queue);
-
-/*!
- * @function dispatch_assert_queue_not
- *
- * @abstract
- * Verifies that the current block is not executing on a given dispatch queue.
- *
- * @discussion
- * This function is the equivalent of dispatch_assert_queue() with the test for
- * equality inverted. That means that it will terminate the application when
- * dispatch_assert_queue() would return, and vice-versa. See discussion there.
- *
- * The variant dispatch_assert_queue_not_debug() is compiled out when the
- * preprocessor macro NDEBUG is defined. (See also assert(3)).
- *
- * @param queue
- * The dispatch queue that the current block is expected not to run on.
- * The result of passing NULL in this parameter is undefined.
- */
-API_AVAILABLE(macos(10.12), ios(10.0), tvos(10.0), watchos(3.0))
-DISPATCH_EXPORT DISPATCH_NONNULL1
-void
-dispatch_assert_queue_not(dispatch_queue_t queue)
- DISPATCH_ALIAS_V2(dispatch_assert_queue_not);
-
-#ifdef NDEBUG
-#define dispatch_assert_queue_debug(q) ((void)(0 && (q)))
-#define dispatch_assert_queue_barrier_debug(q) ((void)(0 && (q)))
-#define dispatch_assert_queue_not_debug(q) ((void)(0 && (q)))
-#else
-#define dispatch_assert_queue_debug(q) dispatch_assert_queue(q)
-#define dispatch_assert_queue_barrier_debug(q) dispatch_assert_queue_barrier(q)
-#define dispatch_assert_queue_not_debug(q) dispatch_assert_queue_not(q)
-#endif
-
-__END_DECLS
-
-DISPATCH_ASSUME_NONNULL_END
-
-#endif
\ No newline at end of file
diff --git a/lib/libc/include/x86_64-macos-gnu/dispatch/semaphore.h b/lib/libc/include/x86_64-macos-gnu/dispatch/semaphore.h
deleted file mode 100644
index 156fb800f3..0000000000
--- a/lib/libc/include/x86_64-macos-gnu/dispatch/semaphore.h
+++ /dev/null
@@ -1,117 +0,0 @@
-/*
- * Copyright (c) 2008-2013 Apple Inc. All rights reserved.
- *
- * @APPLE_APACHE_LICENSE_HEADER_START@
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- * @APPLE_APACHE_LICENSE_HEADER_END@
- */
-
-#ifndef __DISPATCH_SEMAPHORE__
-#define __DISPATCH_SEMAPHORE__
-
-#ifndef __DISPATCH_INDIRECT__
-#error "Please #include instead of this file directly."
-#include // for HeaderDoc
-#endif
-
-DISPATCH_ASSUME_NONNULL_BEGIN
-
-/*!
- * @typedef dispatch_semaphore_t
- *
- * @abstract
- * A counting semaphore.
- */
-DISPATCH_DECL(dispatch_semaphore);
-
-__BEGIN_DECLS
-
-/*!
- * @function dispatch_semaphore_create
- *
- * @abstract
- * Creates new counting semaphore with an initial value.
- *
- * @discussion
- * Passing zero for the value is useful for when two threads need to reconcile
- * the completion of a particular event. Passing a value greater than zero is
- * useful for managing a finite pool of resources, where the pool size is equal
- * to the value.
- *
- * @param value
- * The starting value for the semaphore. Passing a value less than zero will
- * cause NULL to be returned.
- *
- * @result
- * The newly created semaphore, or NULL on failure.
- */
-API_AVAILABLE(macos(10.6), ios(4.0))
-DISPATCH_EXPORT DISPATCH_MALLOC DISPATCH_RETURNS_RETAINED DISPATCH_WARN_RESULT
-DISPATCH_NOTHROW
-dispatch_semaphore_t
-dispatch_semaphore_create(long value);
-
-/*!
- * @function dispatch_semaphore_wait
- *
- * @abstract
- * Wait (decrement) for a semaphore.
- *
- * @discussion
- * Decrement the counting semaphore. If the resulting value is less than zero,
- * this function waits for a signal to occur before returning.
- *
- * @param dsema
- * The semaphore. The result of passing NULL in this parameter is undefined.
- *
- * @param timeout
- * When to timeout (see dispatch_time). As a convenience, there are the
- * DISPATCH_TIME_NOW and DISPATCH_TIME_FOREVER constants.
- *
- * @result
- * Returns zero on success, or non-zero if the timeout occurred.
- */
-API_AVAILABLE(macos(10.6), ios(4.0))
-DISPATCH_EXPORT DISPATCH_NONNULL_ALL DISPATCH_NOTHROW
-long
-dispatch_semaphore_wait(dispatch_semaphore_t dsema, dispatch_time_t timeout);
-
-/*!
- * @function dispatch_semaphore_signal
- *
- * @abstract
- * Signal (increment) a semaphore.
- *
- * @discussion
- * Increment the counting semaphore. If the previous value was less than zero,
- * this function wakes a waiting thread before returning.
- *
- * @param dsema The counting semaphore.
- * The result of passing NULL in this parameter is undefined.
- *
- * @result
- * This function returns non-zero if a thread is woken. Otherwise, zero is
- * returned.
- */
-API_AVAILABLE(macos(10.6), ios(4.0))
-DISPATCH_EXPORT DISPATCH_NONNULL_ALL DISPATCH_NOTHROW
-long
-dispatch_semaphore_signal(dispatch_semaphore_t dsema);
-
-__END_DECLS
-
-DISPATCH_ASSUME_NONNULL_END
-
-#endif /* __DISPATCH_SEMAPHORE__ */
\ No newline at end of file
diff --git a/lib/libc/include/x86_64-macos-gnu/dispatch/source.h b/lib/libc/include/x86_64-macos-gnu/dispatch/source.h
deleted file mode 100644
index 968b9ff89e..0000000000
--- a/lib/libc/include/x86_64-macos-gnu/dispatch/source.h
+++ /dev/null
@@ -1,780 +0,0 @@
-/*
- * Copyright (c) 2008-2013 Apple Inc. All rights reserved.
- *
- * @APPLE_APACHE_LICENSE_HEADER_START@
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- * @APPLE_APACHE_LICENSE_HEADER_END@
- */
-
-#ifndef __DISPATCH_SOURCE__
-#define __DISPATCH_SOURCE__
-
-#ifndef __DISPATCH_INDIRECT__
-#error "Please #include instead of this file directly."
-#include // for HeaderDoc
-#endif
-
-#if TARGET_OS_MAC
-#include
-#include
-#endif
-
-#if !defined(_WIN32)
-#include
-#endif
-
-DISPATCH_ASSUME_NONNULL_BEGIN
-
-/*!
- * @header
- * The dispatch framework provides a suite of interfaces for monitoring low-
- * level system objects (file descriptors, Mach ports, signals, VFS nodes, etc.)
- * for activity and automatically submitting event handler blocks to dispatch
- * queues when such activity occurs.
- *
- * This suite of interfaces is known as the Dispatch Source API.
- */
-
-/*!
- * @typedef dispatch_source_t
- *
- * @abstract
- * Dispatch sources are used to automatically submit event handler blocks to
- * dispatch queues in response to external events.
- */
-DISPATCH_SOURCE_DECL(dispatch_source);
-
-__BEGIN_DECLS
-
-/*!
- * @typedef dispatch_source_type_t
- *
- * @abstract
- * Constants of this type represent the class of low-level system object that
- * is being monitored by the dispatch source. Constants of this type are
- * passed as a parameter to dispatch_source_create() and determine how the
- * handle argument is interpreted (i.e. as a file descriptor, mach port,
- * signal number, process identifier, etc.), and how the mask argument is
- * interpreted.
- */
-typedef const struct dispatch_source_type_s *dispatch_source_type_t;
-
-/*!
- * @const DISPATCH_SOURCE_TYPE_DATA_ADD
- * @discussion A dispatch source that coalesces data obtained via calls to
- * dispatch_source_merge_data(). An ADD is used to coalesce the data.
- * The handle is unused (pass zero for now).
- * The mask is unused (pass zero for now).
- */
-#define DISPATCH_SOURCE_TYPE_DATA_ADD (&_dispatch_source_type_data_add)
-API_AVAILABLE(macos(10.6), ios(4.0))
-DISPATCH_SOURCE_TYPE_DECL(data_add);
-
-/*!
- * @const DISPATCH_SOURCE_TYPE_DATA_OR
- * @discussion A dispatch source that coalesces data obtained via calls to
- * dispatch_source_merge_data(). A bitwise OR is used to coalesce the data.
- * The handle is unused (pass zero for now).
- * The mask is unused (pass zero for now).
- */
-#define DISPATCH_SOURCE_TYPE_DATA_OR (&_dispatch_source_type_data_or)
-API_AVAILABLE(macos(10.6), ios(4.0))
-DISPATCH_SOURCE_TYPE_DECL(data_or);
-
-/*!
- * @const DISPATCH_SOURCE_TYPE_DATA_REPLACE
- * @discussion A dispatch source that tracks data obtained via calls to
- * dispatch_source_merge_data(). Newly obtained data values replace existing
- * data values not yet delivered to the source handler
- *
- * A data value of zero will cause the source handler to not be invoked.
- *
- * The handle is unused (pass zero for now).
- * The mask is unused (pass zero for now).
- */
-#define DISPATCH_SOURCE_TYPE_DATA_REPLACE (&_dispatch_source_type_data_replace)
-API_AVAILABLE(macos(10.13), ios(11.0), tvos(11.0), watchos(4.0))
-DISPATCH_SOURCE_TYPE_DECL(data_replace);
-
-/*!
- * @const DISPATCH_SOURCE_TYPE_MACH_SEND
- * @discussion A dispatch source that monitors a Mach port for dead name
- * notifications (send right no longer has any corresponding receive right).
- * The handle is a Mach port with a send or send-once right (mach_port_t).
- * The mask is a mask of desired events from dispatch_source_mach_send_flags_t.
- */
-#define DISPATCH_SOURCE_TYPE_MACH_SEND (&_dispatch_source_type_mach_send)
-API_AVAILABLE(macos(10.6), ios(4.0)) DISPATCH_LINUX_UNAVAILABLE()
-DISPATCH_SOURCE_TYPE_DECL(mach_send);
-
-/*!
- * @const DISPATCH_SOURCE_TYPE_MACH_RECV
- * @discussion A dispatch source that monitors a Mach port for pending messages.
- * The handle is a Mach port with a receive right (mach_port_t).
- * The mask is a mask of desired events from dispatch_source_mach_recv_flags_t,
- * but no flags are currently defined (pass zero for now).
- */
-#define DISPATCH_SOURCE_TYPE_MACH_RECV (&_dispatch_source_type_mach_recv)
-API_AVAILABLE(macos(10.6), ios(4.0)) DISPATCH_LINUX_UNAVAILABLE()
-DISPATCH_SOURCE_TYPE_DECL(mach_recv);
-
-/*!
- * @const DISPATCH_SOURCE_TYPE_MEMORYPRESSURE
- * @discussion A dispatch source that monitors the system for changes in
- * memory pressure condition.
- * The handle is unused (pass zero for now).
- * The mask is a mask of desired events from
- * dispatch_source_memorypressure_flags_t.
- */
-#define DISPATCH_SOURCE_TYPE_MEMORYPRESSURE \
- (&_dispatch_source_type_memorypressure)
-API_AVAILABLE(macos(10.9), ios(8.0)) DISPATCH_LINUX_UNAVAILABLE()
-DISPATCH_SOURCE_TYPE_DECL(memorypressure);
-
-/*!
- * @const DISPATCH_SOURCE_TYPE_PROC
- * @discussion A dispatch source that monitors an external process for events
- * defined by dispatch_source_proc_flags_t.
- * The handle is a process identifier (pid_t).
- * The mask is a mask of desired events from dispatch_source_proc_flags_t.
- */
-#define DISPATCH_SOURCE_TYPE_PROC (&_dispatch_source_type_proc)
-API_AVAILABLE(macos(10.6), ios(4.0)) DISPATCH_LINUX_UNAVAILABLE()
-DISPATCH_SOURCE_TYPE_DECL(proc);
-
-/*!
- * @const DISPATCH_SOURCE_TYPE_READ
- * @discussion A dispatch source that monitors a file descriptor for pending
- * bytes available to be read.
- * The handle is a file descriptor (int).
- * The mask is unused (pass zero for now).
- */
-#define DISPATCH_SOURCE_TYPE_READ (&_dispatch_source_type_read)
-API_AVAILABLE(macos(10.6), ios(4.0))
-DISPATCH_SOURCE_TYPE_DECL(read);
-
-/*!
- * @const DISPATCH_SOURCE_TYPE_SIGNAL
- * @discussion A dispatch source that monitors the current process for signals.
- * The handle is a signal number (int).
- * The mask is unused (pass zero for now).
- */
-#define DISPATCH_SOURCE_TYPE_SIGNAL (&_dispatch_source_type_signal)
-API_AVAILABLE(macos(10.6), ios(4.0))
-DISPATCH_SOURCE_TYPE_DECL(signal);
-
-/*!
- * @const DISPATCH_SOURCE_TYPE_TIMER
- * @discussion A dispatch source that submits the event handler block based
- * on a timer.
- * The handle is unused (pass zero for now).
- * The mask specifies which flags from dispatch_source_timer_flags_t to apply.
- */
-#define DISPATCH_SOURCE_TYPE_TIMER (&_dispatch_source_type_timer)
-API_AVAILABLE(macos(10.6), ios(4.0))
-DISPATCH_SOURCE_TYPE_DECL(timer);
-
-/*!
- * @const DISPATCH_SOURCE_TYPE_VNODE
- * @discussion A dispatch source that monitors a file descriptor for events
- * defined by dispatch_source_vnode_flags_t.
- * The handle is a file descriptor (int).
- * The mask is a mask of desired events from dispatch_source_vnode_flags_t.
- */
-#define DISPATCH_SOURCE_TYPE_VNODE (&_dispatch_source_type_vnode)
-API_AVAILABLE(macos(10.6), ios(4.0)) DISPATCH_LINUX_UNAVAILABLE()
-DISPATCH_SOURCE_TYPE_DECL(vnode);
-
-/*!
- * @const DISPATCH_SOURCE_TYPE_WRITE
- * @discussion A dispatch source that monitors a file descriptor for available
- * buffer space to write bytes.
- * The handle is a file descriptor (int).
- * The mask is unused (pass zero for now).
- */
-#define DISPATCH_SOURCE_TYPE_WRITE (&_dispatch_source_type_write)
-API_AVAILABLE(macos(10.6), ios(4.0))
-DISPATCH_SOURCE_TYPE_DECL(write);
-
-/*!
- * @typedef dispatch_source_mach_send_flags_t
- * Type of dispatch_source_mach_send flags
- *
- * @constant DISPATCH_MACH_SEND_DEAD
- * The receive right corresponding to the given send right was destroyed.
- */
-#define DISPATCH_MACH_SEND_DEAD 0x1
-
-typedef unsigned long dispatch_source_mach_send_flags_t;
-
-/*!
- * @typedef dispatch_source_mach_recv_flags_t
- * Type of dispatch_source_mach_recv flags
- */
-typedef unsigned long dispatch_source_mach_recv_flags_t;
-
-/*!
- * @typedef dispatch_source_memorypressure_flags_t
- * Type of dispatch_source_memorypressure flags
- *
- * @constant DISPATCH_MEMORYPRESSURE_NORMAL
- * The system memory pressure condition has returned to normal.
- *
- * @constant DISPATCH_MEMORYPRESSURE_WARN
- * The system memory pressure condition has changed to warning.
- *
- * @constant DISPATCH_MEMORYPRESSURE_CRITICAL
- * The system memory pressure condition has changed to critical.
- *
- * @discussion
- * Elevated memory pressure is a system-wide condition that applications
- * registered for this source should react to by changing their future memory
- * use behavior, e.g. by reducing cache sizes of newly initiated operations
- * until memory pressure returns back to normal.
- * NOTE: applications should NOT traverse and discard existing caches for past
- * operations when the system memory pressure enters an elevated state, as that
- * is likely to trigger VM operations that will further aggravate system memory
- * pressure.
- */
-
-#define DISPATCH_MEMORYPRESSURE_NORMAL 0x01
-#define DISPATCH_MEMORYPRESSURE_WARN 0x02
-#define DISPATCH_MEMORYPRESSURE_CRITICAL 0x04
-
-typedef unsigned long dispatch_source_memorypressure_flags_t;
-
-/*!
- * @typedef dispatch_source_proc_flags_t
- * Type of dispatch_source_proc flags
- *
- * @constant DISPATCH_PROC_EXIT
- * The process has exited (perhaps cleanly, perhaps not).
- *
- * @constant DISPATCH_PROC_FORK
- * The process has created one or more child processes.
- *
- * @constant DISPATCH_PROC_EXEC
- * The process has become another executable image via
- * exec*() or posix_spawn*().
- *
- * @constant DISPATCH_PROC_SIGNAL
- * A Unix signal was delivered to the process.
- */
-#define DISPATCH_PROC_EXIT 0x80000000
-#define DISPATCH_PROC_FORK 0x40000000
-#define DISPATCH_PROC_EXEC 0x20000000
-#define DISPATCH_PROC_SIGNAL 0x08000000
-
-typedef unsigned long dispatch_source_proc_flags_t;
-
-/*!
- * @typedef dispatch_source_vnode_flags_t
- * Type of dispatch_source_vnode flags
- *
- * @constant DISPATCH_VNODE_DELETE
- * The filesystem object was deleted from the namespace.
- *
- * @constant DISPATCH_VNODE_WRITE
- * The filesystem object data changed.
- *
- * @constant DISPATCH_VNODE_EXTEND
- * The filesystem object changed in size.
- *
- * @constant DISPATCH_VNODE_ATTRIB
- * The filesystem object metadata changed.
- *
- * @constant DISPATCH_VNODE_LINK
- * The filesystem object link count changed.
- *
- * @constant DISPATCH_VNODE_RENAME
- * The filesystem object was renamed in the namespace.
- *
- * @constant DISPATCH_VNODE_REVOKE
- * The filesystem object was revoked.
- *
- * @constant DISPATCH_VNODE_FUNLOCK
- * The filesystem object was unlocked.
- */
-
-#define DISPATCH_VNODE_DELETE 0x1
-#define DISPATCH_VNODE_WRITE 0x2
-#define DISPATCH_VNODE_EXTEND 0x4
-#define DISPATCH_VNODE_ATTRIB 0x8
-#define DISPATCH_VNODE_LINK 0x10
-#define DISPATCH_VNODE_RENAME 0x20
-#define DISPATCH_VNODE_REVOKE 0x40
-#define DISPATCH_VNODE_FUNLOCK 0x100
-
-typedef unsigned long dispatch_source_vnode_flags_t;
-
-/*!
- * @typedef dispatch_source_timer_flags_t
- * Type of dispatch_source_timer flags
- *
- * @constant DISPATCH_TIMER_STRICT
- * Specifies that the system should make a best effort to strictly observe the
- * leeway value specified for the timer via dispatch_source_set_timer(), even
- * if that value is smaller than the default leeway value that would be applied
- * to the timer otherwise. A minimal amount of leeway will be applied to the
- * timer even if this flag is specified.
- *
- * CAUTION: Use of this flag may override power-saving techniques employed by
- * the system and cause higher power consumption, so it must be used with care
- * and only when absolutely necessary.
- */
-
-#define DISPATCH_TIMER_STRICT 0x1
-
-typedef unsigned long dispatch_source_timer_flags_t;
-
-/*!
- * @function dispatch_source_create
- *
- * @abstract
- * Creates a new dispatch source to monitor low-level system objects and auto-
- * matically submit a handler block to a dispatch queue in response to events.
- *
- * @discussion
- * Dispatch sources are not reentrant. Any events received while the dispatch
- * source is suspended or while the event handler block is currently executing
- * will be coalesced and delivered after the dispatch source is resumed or the
- * event handler block has returned.
- *
- * Dispatch sources are created in an inactive state. After creating the
- * source and setting any desired attributes (i.e. the handler, context, etc.),
- * a call must be made to dispatch_activate() in order to begin event delivery.
- *
- * Calling dispatch_set_target_queue() on a source once it has been activated
- * is not allowed (see dispatch_activate() and dispatch_set_target_queue()).
- *
- * For backward compatibility reasons, dispatch_resume() on an inactive,
- * and not otherwise suspended source has the same effect as calling
- * dispatch_activate(). For new code, using dispatch_activate() is preferred.
- *
- * @param type
- * Declares the type of the dispatch source. Must be one of the defined
- * dispatch_source_type_t constants.
- *
- * @param handle
- * The underlying system handle to monitor. The interpretation of this argument
- * is determined by the constant provided in the type parameter.
- *
- * @param mask
- * A mask of flags specifying which events are desired. The interpretation of
- * this argument is determined by the constant provided in the type parameter.
- *
- * @param queue
- * The dispatch queue to which the event handler block will be submitted.
- * If queue is DISPATCH_TARGET_QUEUE_DEFAULT, the source will submit the event
- * handler block to the default priority global queue.
- *
- * @result
- * The newly created dispatch source. Or NULL if invalid arguments are passed.
- */
-API_AVAILABLE(macos(10.6), ios(4.0))
-DISPATCH_EXPORT DISPATCH_MALLOC DISPATCH_RETURNS_RETAINED DISPATCH_WARN_RESULT
-DISPATCH_NOTHROW
-dispatch_source_t
-dispatch_source_create(dispatch_source_type_t type,
- uintptr_t handle,
- unsigned long mask,
- dispatch_queue_t _Nullable queue);
-
-/*!
- * @function dispatch_source_set_event_handler
- *
- * @abstract
- * Sets the event handler block for the given dispatch source.
- *
- * @param source
- * The dispatch source to modify.
- * The result of passing NULL in this parameter is undefined.
- *
- * @param handler
- * The event handler block to submit to the source's target queue.
- */
-#ifdef __BLOCKS__
-API_AVAILABLE(macos(10.6), ios(4.0))
-DISPATCH_EXPORT DISPATCH_NONNULL1 DISPATCH_NOTHROW
-void
-dispatch_source_set_event_handler(dispatch_source_t source,
- dispatch_block_t _Nullable handler);
-#endif /* __BLOCKS__ */
-
-/*!
- * @function dispatch_source_set_event_handler_f
- *
- * @abstract
- * Sets the event handler function for the given dispatch source.
- *
- * @param source
- * The dispatch source to modify.
- * The result of passing NULL in this parameter is undefined.
- *
- * @param handler
- * The event handler function to submit to the source's target queue.
- * The context parameter passed to the event handler function is the context of
- * the dispatch source current at the time the event handler was set.
- */
-API_AVAILABLE(macos(10.6), ios(4.0))
-DISPATCH_EXPORT DISPATCH_NONNULL1 DISPATCH_NOTHROW
-void
-dispatch_source_set_event_handler_f(dispatch_source_t source,
- dispatch_function_t _Nullable handler);
-
-/*!
- * @function dispatch_source_set_cancel_handler
- *
- * @abstract
- * Sets the cancellation handler block for the given dispatch source.
- *
- * @discussion
- * The cancellation handler (if specified) will be submitted to the source's
- * target queue in response to a call to dispatch_source_cancel() once the
- * system has released all references to the source's underlying handle and
- * the source's event handler block has returned.
- *
- * IMPORTANT:
- * Source cancellation and a cancellation handler are required for file
- * descriptor and mach port based sources in order to safely close the
- * descriptor or destroy the port.
- * Closing the descriptor or port before the cancellation handler is invoked may
- * result in a race condition. If a new descriptor is allocated with the same
- * value as the recently closed descriptor while the source's event handler is
- * still running, the event handler may read/write data to the wrong descriptor.
- *
- * @param source
- * The dispatch source to modify.
- * The result of passing NULL in this parameter is undefined.
- *
- * @param handler
- * The cancellation handler block to submit to the source's target queue.
- */
-#ifdef __BLOCKS__
-API_AVAILABLE(macos(10.6), ios(4.0))
-DISPATCH_EXPORT DISPATCH_NONNULL1 DISPATCH_NOTHROW
-void
-dispatch_source_set_cancel_handler(dispatch_source_t source,
- dispatch_block_t _Nullable handler);
-#endif /* __BLOCKS__ */
-
-/*!
- * @function dispatch_source_set_cancel_handler_f
- *
- * @abstract
- * Sets the cancellation handler function for the given dispatch source.
- *
- * @discussion
- * See dispatch_source_set_cancel_handler() for more details.
- *
- * @param source
- * The dispatch source to modify.
- * The result of passing NULL in this parameter is undefined.
- *
- * @param handler
- * The cancellation handler function to submit to the source's target queue.
- * The context parameter passed to the event handler function is the current
- * context of the dispatch source at the time the handler call is made.
- */
-API_AVAILABLE(macos(10.6), ios(4.0))
-DISPATCH_EXPORT DISPATCH_NONNULL1 DISPATCH_NOTHROW
-void
-dispatch_source_set_cancel_handler_f(dispatch_source_t source,
- dispatch_function_t _Nullable handler);
-
-/*!
- * @function dispatch_source_cancel
- *
- * @abstract
- * Asynchronously cancel the dispatch source, preventing any further invocation
- * of its event handler block.
- *
- * @discussion
- * Cancellation prevents any further invocation of the event handler block for
- * the specified dispatch source, but does not interrupt an event handler
- * block that is already in progress.
- *
- * The cancellation handler is submitted to the source's target queue once the
- * the source's event handler has finished, indicating it is now safe to close
- * the source's handle (i.e. file descriptor or mach port).
- *
- * See dispatch_source_set_cancel_handler() for more information.
- *
- * @param source
- * The dispatch source to be canceled.
- * The result of passing NULL in this parameter is undefined.
- */
-API_AVAILABLE(macos(10.6), ios(4.0))
-DISPATCH_EXPORT DISPATCH_NONNULL_ALL DISPATCH_NOTHROW
-void
-dispatch_source_cancel(dispatch_source_t source);
-
-/*!
- * @function dispatch_source_testcancel
- *
- * @abstract
- * Tests whether the given dispatch source has been canceled.
- *
- * @param source
- * The dispatch source to be tested.
- * The result of passing NULL in this parameter is undefined.
- *
- * @result
- * Non-zero if canceled and zero if not canceled.
- */
-API_AVAILABLE(macos(10.6), ios(4.0))
-DISPATCH_EXPORT DISPATCH_NONNULL_ALL DISPATCH_WARN_RESULT DISPATCH_PURE
-DISPATCH_NOTHROW
-long
-dispatch_source_testcancel(dispatch_source_t source);
-
-/*!
- * @function dispatch_source_get_handle
- *
- * @abstract
- * Returns the underlying system handle associated with this dispatch source.
- *
- * @param source
- * The result of passing NULL in this parameter is undefined.
- *
- * @result
- * The return value should be interpreted according to the type of the dispatch
- * source, and may be one of the following handles:
- *
- * DISPATCH_SOURCE_TYPE_DATA_ADD: n/a
- * DISPATCH_SOURCE_TYPE_DATA_OR: n/a
- * DISPATCH_SOURCE_TYPE_DATA_REPLACE: n/a
- * DISPATCH_SOURCE_TYPE_MACH_SEND: mach port (mach_port_t)
- * DISPATCH_SOURCE_TYPE_MACH_RECV: mach port (mach_port_t)
- * DISPATCH_SOURCE_TYPE_MEMORYPRESSURE n/a
- * DISPATCH_SOURCE_TYPE_PROC: process identifier (pid_t)
- * DISPATCH_SOURCE_TYPE_READ: file descriptor (int)
- * DISPATCH_SOURCE_TYPE_SIGNAL: signal number (int)
- * DISPATCH_SOURCE_TYPE_TIMER: n/a
- * DISPATCH_SOURCE_TYPE_VNODE: file descriptor (int)
- * DISPATCH_SOURCE_TYPE_WRITE: file descriptor (int)
- */
-API_AVAILABLE(macos(10.6), ios(4.0))
-DISPATCH_EXPORT DISPATCH_NONNULL_ALL DISPATCH_WARN_RESULT DISPATCH_PURE
-DISPATCH_NOTHROW
-uintptr_t
-dispatch_source_get_handle(dispatch_source_t source);
-
-/*!
- * @function dispatch_source_get_mask
- *
- * @abstract
- * Returns the mask of events monitored by the dispatch source.
- *
- * @param source
- * The result of passing NULL in this parameter is undefined.
- *
- * @result
- * The return value should be interpreted according to the type of the dispatch
- * source, and may be one of the following flag sets:
- *
- * DISPATCH_SOURCE_TYPE_DATA_ADD: n/a
- * DISPATCH_SOURCE_TYPE_DATA_OR: n/a
- * DISPATCH_SOURCE_TYPE_DATA_REPLACE: n/a
- * DISPATCH_SOURCE_TYPE_MACH_SEND: dispatch_source_mach_send_flags_t
- * DISPATCH_SOURCE_TYPE_MACH_RECV: dispatch_source_mach_recv_flags_t
- * DISPATCH_SOURCE_TYPE_MEMORYPRESSURE dispatch_source_memorypressure_flags_t
- * DISPATCH_SOURCE_TYPE_PROC: dispatch_source_proc_flags_t
- * DISPATCH_SOURCE_TYPE_READ: n/a
- * DISPATCH_SOURCE_TYPE_SIGNAL: n/a
- * DISPATCH_SOURCE_TYPE_TIMER: dispatch_source_timer_flags_t
- * DISPATCH_SOURCE_TYPE_VNODE: dispatch_source_vnode_flags_t
- * DISPATCH_SOURCE_TYPE_WRITE: n/a
- */
-API_AVAILABLE(macos(10.6), ios(4.0))
-DISPATCH_EXPORT DISPATCH_NONNULL_ALL DISPATCH_WARN_RESULT DISPATCH_PURE
-DISPATCH_NOTHROW
-unsigned long
-dispatch_source_get_mask(dispatch_source_t source);
-
-/*!
- * @function dispatch_source_get_data
- *
- * @abstract
- * Returns pending data for the dispatch source.
- *
- * @discussion
- * This function is intended to be called from within the event handler block.
- * The result of calling this function outside of the event handler callback is
- * undefined.
- *
- * @param source
- * The result of passing NULL in this parameter is undefined.
- *
- * @result
- * The return value should be interpreted according to the type of the dispatch
- * source, and may be one of the following:
- *
- * DISPATCH_SOURCE_TYPE_DATA_ADD: application defined data
- * DISPATCH_SOURCE_TYPE_DATA_OR: application defined data
- * DISPATCH_SOURCE_TYPE_DATA_REPLACE: application defined data
- * DISPATCH_SOURCE_TYPE_MACH_SEND: dispatch_source_mach_send_flags_t
- * DISPATCH_SOURCE_TYPE_MACH_RECV: dispatch_source_mach_recv_flags_t
- * DISPATCH_SOURCE_TYPE_MEMORYPRESSURE dispatch_source_memorypressure_flags_t
- * DISPATCH_SOURCE_TYPE_PROC: dispatch_source_proc_flags_t
- * DISPATCH_SOURCE_TYPE_READ: estimated bytes available to read
- * DISPATCH_SOURCE_TYPE_SIGNAL: number of signals delivered since
- * the last handler invocation
- * DISPATCH_SOURCE_TYPE_TIMER: number of times the timer has fired
- * since the last handler invocation
- * DISPATCH_SOURCE_TYPE_VNODE: dispatch_source_vnode_flags_t
- * DISPATCH_SOURCE_TYPE_WRITE: estimated buffer space available
- */
-API_AVAILABLE(macos(10.6), ios(4.0))
-DISPATCH_EXPORT DISPATCH_NONNULL_ALL DISPATCH_WARN_RESULT DISPATCH_PURE
-DISPATCH_NOTHROW
-unsigned long
-dispatch_source_get_data(dispatch_source_t source);
-
-/*!
- * @function dispatch_source_merge_data
- *
- * @abstract
- * Merges data into a dispatch source of type DISPATCH_SOURCE_TYPE_DATA_ADD,
- * DISPATCH_SOURCE_TYPE_DATA_OR or DISPATCH_SOURCE_TYPE_DATA_REPLACE,
- * and submits its event handler block to its target queue.
- *
- * @param source
- * The result of passing NULL in this parameter is undefined.
- *
- * @param value
- * The value to coalesce with the pending data using a logical OR or an ADD
- * as specified by the dispatch source type. A value of zero has no effect
- * and will not result in the submission of the event handler block.
- */
-API_AVAILABLE(macos(10.6), ios(4.0))
-DISPATCH_EXPORT DISPATCH_NONNULL_ALL DISPATCH_NOTHROW
-void
-dispatch_source_merge_data(dispatch_source_t source, unsigned long value);
-
-/*!
- * @function dispatch_source_set_timer
- *
- * @abstract
- * Sets a start time, interval, and leeway value for a timer source.
- *
- * @discussion
- * Once this function returns, any pending source data accumulated for the
- * previous timer values has been cleared; the next fire of the timer will
- * occur at 'start', and every 'interval' nanoseconds thereafter until the
- * timer source is canceled.
- *
- * Any fire of the timer may be delayed by the system in order to improve power
- * consumption and system performance. The upper limit to the allowable delay
- * may be configured with the 'leeway' argument, the lower limit is under the
- * control of the system.
- *
- * For the initial timer fire at 'start', the upper limit to the allowable
- * delay is set to 'leeway' nanoseconds. For the subsequent timer fires at
- * 'start' + N * 'interval', the upper limit is MIN('leeway','interval'/2).
- *
- * The lower limit to the allowable delay may vary with process state such as
- * visibility of application UI. If the specified timer source was created with
- * a mask of DISPATCH_TIMER_STRICT, the system will make a best effort to
- * strictly observe the provided 'leeway' value even if it is smaller than the
- * current lower limit. Note that a minimal amount of delay is to be expected
- * even if this flag is specified.
- *
- * The 'start' argument also determines which clock will be used for the timer:
- * If 'start' is DISPATCH_TIME_NOW or was created with dispatch_time(3), the
- * timer is based on up time (which is obtained from mach_absolute_time() on
- * Apple platforms). If 'start' was created with dispatch_walltime(3), the
- * timer is based on gettimeofday(3).
- *
- * Calling this function has no effect if the timer source has already been
- * canceled.
- *
- * @param start
- * The start time of the timer. See dispatch_time() and dispatch_walltime()
- * for more information.
- *
- * @param interval
- * The nanosecond interval for the timer. Use DISPATCH_TIME_FOREVER for a
- * one-shot timer.
- *
- * @param leeway
- * The nanosecond leeway for the timer.
- */
-API_AVAILABLE(macos(10.6), ios(4.0))
-DISPATCH_EXPORT DISPATCH_NONNULL_ALL DISPATCH_NOTHROW
-void
-dispatch_source_set_timer(dispatch_source_t source,
- dispatch_time_t start,
- uint64_t interval,
- uint64_t leeway);
-
-/*!
- * @function dispatch_source_set_registration_handler
- *
- * @abstract
- * Sets the registration handler block for the given dispatch source.
- *
- * @discussion
- * The registration handler (if specified) will be submitted to the source's
- * target queue once the corresponding kevent() has been registered with the
- * system, following the initial dispatch_resume() of the source.
- *
- * If a source is already registered when the registration handler is set, the
- * registration handler will be invoked immediately.
- *
- * @param source
- * The dispatch source to modify.
- * The result of passing NULL in this parameter is undefined.
- *
- * @param handler
- * The registration handler block to submit to the source's target queue.
- */
-#ifdef __BLOCKS__
-API_AVAILABLE(macos(10.7), ios(4.3))
-DISPATCH_EXPORT DISPATCH_NONNULL1 DISPATCH_NOTHROW
-void
-dispatch_source_set_registration_handler(dispatch_source_t source,
- dispatch_block_t _Nullable handler);
-#endif /* __BLOCKS__ */
-
-/*!
- * @function dispatch_source_set_registration_handler_f
- *
- * @abstract
- * Sets the registration handler function for the given dispatch source.
- *
- * @discussion
- * See dispatch_source_set_registration_handler() for more details.
- *
- * @param source
- * The dispatch source to modify.
- * The result of passing NULL in this parameter is undefined.
- *
- * @param handler
- * The registration handler function to submit to the source's target queue.
- * The context parameter passed to the registration handler function is the
- * current context of the dispatch source at the time the handler call is made.
- */
-API_AVAILABLE(macos(10.7), ios(4.3))
-DISPATCH_EXPORT DISPATCH_NONNULL1 DISPATCH_NOTHROW
-void
-dispatch_source_set_registration_handler_f(dispatch_source_t source,
- dispatch_function_t _Nullable handler);
-
-__END_DECLS
-
-DISPATCH_ASSUME_NONNULL_END
-
-#endif
\ No newline at end of file
diff --git a/lib/libc/include/x86_64-macos-gnu/dispatch/workloop.h b/lib/libc/include/x86_64-macos-gnu/dispatch/workloop.h
deleted file mode 100644
index dcd1db43cc..0000000000
--- a/lib/libc/include/x86_64-macos-gnu/dispatch/workloop.h
+++ /dev/null
@@ -1,136 +0,0 @@
-/*
- * Copyright (c) 2017-2019 Apple Inc. All rights reserved.
- *
- * @APPLE_APACHE_LICENSE_HEADER_START@
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- * @APPLE_APACHE_LICENSE_HEADER_END@
- */
-
-#ifndef __DISPATCH_WORKLOOP__
-#define __DISPATCH_WORKLOOP__
-
-#ifndef __DISPATCH_INDIRECT__
-#error "Please #include instead of this file directly."
-#include // for HeaderDoc
-#endif
-
-DISPATCH_ASSUME_NONNULL_BEGIN
-
-__BEGIN_DECLS
-
-/*!
- * @typedef dispatch_workloop_t
- *
- * @abstract
- * Dispatch workloops invoke workitems submitted to them in priority order.
- *
- * @discussion
- * A dispatch workloop is a flavor of dispatch_queue_t that is a priority
- * ordered queue (using the QOS class of the submitted workitems as the
- * ordering).
- *
- * Between each workitem invocation, the workloop will evaluate whether higher
- * priority workitems have since been submitted, either directly to the
- * workloop or to any queues that target the workloop, and execute these first.
- *
- * Serial queues targeting a workloop maintain FIFO execution of their
- * workitems. However, the workloop may reorder workitems submitted to
- * independent serial queues targeting it with respect to each other,
- * based on their priorities, while preserving FIFO execution with respect to
- * each serial queue.
- *
- * A dispatch workloop is a "subclass" of dispatch_queue_t which can be passed
- * to all APIs accepting a dispatch queue, except for functions from the
- * dispatch_sync() family. dispatch_async_and_wait() must be used for workloop
- * objects. Functions from the dispatch_sync() family on queues targeting
- * a workloop are still permitted but discouraged for performance reasons.
- */
-DISPATCH_DECL_SUBCLASS(dispatch_workloop, dispatch_queue);
-
-/*!
- * @function dispatch_workloop_create
- *
- * @abstract
- * Creates a new dispatch workloop to which workitems may be submitted.
- *
- * @param label
- * A string label to attach to the workloop.
- *
- * @result
- * The newly created dispatch workloop.
- */
-API_AVAILABLE(macos(10.14), ios(12.0), tvos(12.0), watchos(5.0))
-DISPATCH_EXPORT DISPATCH_MALLOC DISPATCH_RETURNS_RETAINED DISPATCH_WARN_RESULT
-DISPATCH_NOTHROW
-dispatch_workloop_t
-dispatch_workloop_create(const char *_Nullable label);
-
-/*!
- * @function dispatch_workloop_create_inactive
- *
- * @abstract
- * Creates a new inactive dispatch workloop that can be setup and then
- * activated.
- *
- * @discussion
- * Creating an inactive workloop allows for it to receive further configuration
- * before it is activated, and workitems can be submitted to it.
- *
- * Submitting workitems to an inactive workloop is undefined and will cause the
- * process to be terminated.
- *
- * @param label
- * A string label to attach to the workloop.
- *
- * @result
- * The newly created dispatch workloop.
- */
-API_AVAILABLE(macos(10.14), ios(12.0), tvos(12.0), watchos(5.0))
-DISPATCH_EXPORT DISPATCH_MALLOC DISPATCH_RETURNS_RETAINED DISPATCH_WARN_RESULT
-DISPATCH_NOTHROW
-dispatch_workloop_t
-dispatch_workloop_create_inactive(const char *_Nullable label);
-
-/*!
- * @function dispatch_workloop_set_autorelease_frequency
- *
- * @abstract
- * Sets the autorelease frequency of the workloop.
- *
- * @discussion
- * See dispatch_queue_attr_make_with_autorelease_frequency().
- * The default policy for a workloop is
- * DISPATCH_AUTORELEASE_FREQUENCY_WORK_ITEM.
- *
- * @param workloop
- * The dispatch workloop to modify.
- *
- * This workloop must be inactive, passing an activated object is undefined
- * and will cause the process to be terminated.
- *
- * @param frequency
- * The requested autorelease frequency.
- */
-API_AVAILABLE(macos(10.14), ios(12.0), tvos(12.0), watchos(5.0))
-DISPATCH_EXPORT DISPATCH_NONNULL_ALL DISPATCH_NOTHROW
-void
-dispatch_workloop_set_autorelease_frequency(dispatch_workloop_t workloop,
- dispatch_autorelease_frequency_t frequency);
-
-__END_DECLS
-
-DISPATCH_ASSUME_NONNULL_END
-
-#endif
\ No newline at end of file
diff --git a/lib/libc/include/x86_64-macos-gnu/i386/_param.h b/lib/libc/include/x86_64-macos-gnu/i386/_param.h
index d8f7b3d4bf..b89bc39692 100644
--- a/lib/libc/include/x86_64-macos-gnu/i386/_param.h
+++ b/lib/libc/include/x86_64-macos-gnu/i386/_param.h
@@ -37,10 +37,10 @@
* cast to any desired pointer type.
*/
#define __DARWIN_ALIGNBYTES (sizeof(__darwin_size_t) - 1)
-#define __DARWIN_ALIGN(p) ((__darwin_size_t)((char *)(__darwin_size_t)(p) + __DARWIN_ALIGNBYTES) &~ __DARWIN_ALIGNBYTES)
+#define __DARWIN_ALIGN(p) ((__darwin_size_t)((__darwin_size_t)(p) + __DARWIN_ALIGNBYTES) &~ __DARWIN_ALIGNBYTES)
#define __DARWIN_ALIGNBYTES32 (sizeof(__uint32_t) - 1)
-#define __DARWIN_ALIGN32(p) ((__darwin_size_t)((char *)(__darwin_size_t)(p) + __DARWIN_ALIGNBYTES32) &~ __DARWIN_ALIGNBYTES32)
+#define __DARWIN_ALIGN32(p) ((__darwin_size_t)((__darwin_size_t)(p) + __DARWIN_ALIGNBYTES32) &~ __DARWIN_ALIGNBYTES32)
#endif /* _I386__PARAM_H_ */
\ No newline at end of file
diff --git a/lib/libc/include/x86_64-macos-gnu/libkern/OSAtomicDeprecated.h b/lib/libc/include/x86_64-macos-gnu/libkern/OSAtomicDeprecated.h
index aef009bc04..6dc880b0d4 100644
--- a/lib/libc/include/x86_64-macos-gnu/libkern/OSAtomicDeprecated.h
+++ b/lib/libc/include/x86_64-macos-gnu/libkern/OSAtomicDeprecated.h
@@ -35,13 +35,14 @@
* is preferred.
*/
+#include
+
#if !(defined(OSATOMIC_USE_INLINED) && OSATOMIC_USE_INLINED)
#include
#include
#include
#include
-#include
#ifndef OSATOMIC_DEPRECATED
#define OSATOMIC_DEPRECATED 1
@@ -161,7 +162,7 @@ __OSX_AVAILABLE_STARTING(__MAC_10_4, __IPHONE_2_0)
int32_t OSAtomicAdd32Barrier( int32_t __theAmount, volatile int32_t *__theValue );
-#if __MAC_OS_X_VERSION_MIN_REQUIRED >= __MAC_10_10 || __IPHONE_OS_VERSION_MIN_REQUIRED >= __IPHONE_7_1
+#if __MAC_OS_X_VERSION_MIN_REQUIRED >= __MAC_10_10 || __IPHONE_OS_VERSION_MIN_REQUIRED >= __IPHONE_7_1 || TARGET_OS_DRIVERKIT
/*! @abstract Atomically increments a 32-bit value.
@result Returns the new value.
@@ -248,7 +249,7 @@ int64_t OSAtomicAdd64Barrier( int64_t __theAmount,
volatile OSAtomic_int64_aligned64_t *__theValue );
-#if __MAC_OS_X_VERSION_MIN_REQUIRED >= __MAC_10_10 || __IPHONE_OS_VERSION_MIN_REQUIRED >= __IPHONE_7_1
+#if __MAC_OS_X_VERSION_MIN_REQUIRED >= __MAC_10_10 || __IPHONE_OS_VERSION_MIN_REQUIRED >= __IPHONE_7_1 || TARGET_OS_DRIVERKIT
/*! @abstract Atomically increments a 64-bit value.
@result Returns the new value.
@@ -361,7 +362,7 @@ int32_t OSAtomicOr32Orig( uint32_t __theMask, volatile uint32_t *__theValue );
This function performs the bitwise OR of the value given by __theMask
with the value in the memory location referenced by __theValue,
storing the result back to that memory location atomically.
-
+
This function is equivalent to {@link OSAtomicOr32Orig}
except that it also introduces a barrier.
@result Returns the original value referenced by __theValue.
@@ -481,7 +482,7 @@ int32_t OSAtomicXor32Orig( uint32_t __theMask, volatile uint32_t *__theValue );
OSATOMIC_BARRIER_DEPRECATED_REPLACE_WITH(atomic_fetch_xor)
__OSX_AVAILABLE_STARTING(__MAC_10_5, __IPHONE_3_2)
int32_t OSAtomicXor32OrigBarrier( uint32_t __theMask, volatile uint32_t *__theValue );
-
+
/*! @group Compare and swap
* Functions in this group return true if the swap occured. There are several versions,
@@ -587,7 +588,7 @@ bool OSAtomicCompareAndSwapIntBarrier( int __oldValue, int __newValue, volatile
match, this function stores the value from __newValue into
that memory location atomically.
- This function is equivalent to {@link OSAtomicCompareAndSwap32} on 32-bit architectures,
+ This function is equivalent to {@link OSAtomicCompareAndSwap32} on 32-bit architectures,
or {@link OSAtomicCompareAndSwap64} on 64-bit architectures.
@result Returns TRUE on a match, FALSE otherwise.
*/
@@ -606,7 +607,7 @@ bool OSAtomicCompareAndSwapLong( long __oldValue, long __newValue, volatile long
This function is equivalent to {@link OSAtomicCompareAndSwapLong}
except that it also introduces a barrier.
- This function is equivalent to {@link OSAtomicCompareAndSwap32} on 32-bit architectures,
+ This function is equivalent to {@link OSAtomicCompareAndSwap32} on 32-bit architectures,
or {@link OSAtomicCompareAndSwap64} on 64-bit architectures.
@result Returns TRUE on a match, FALSE otherwise.
*/
@@ -706,7 +707,7 @@ bool OSAtomicTestAndSetBarrier( uint32_t __n, volatile void *__theAddress );
For example, if __theAddress points to a 64-bit value,
to compare the value of the most significant bit, you would specify
56 for __n.
-
+
@result
Returns the original value of the bit being tested.
*/
@@ -719,15 +720,15 @@ bool OSAtomicTestAndClear( uint32_t __n, volatile void *__theAddress );
@discussion
This function tests a bit in the value referenced by __theAddress
and if it is not cleared, clears it.
-
+
The bit is chosen by the value of __n such that the
operation will be performed on bit (0x80 >> (__n & 7))
of byte ((char *)__theAddress + (n >> 3)).
-
+
For example, if __theAddress points to a 64-bit value,
to compare the value of the most significant bit, you would specify
56 for __n.
-
+
This function is equivalent to {@link OSAtomicTestAndSet}
except that it also introduces a barrier.
@result
@@ -736,7 +737,7 @@ bool OSAtomicTestAndClear( uint32_t __n, volatile void *__theAddress );
OSATOMIC_BARRIER_DEPRECATED_REPLACE_WITH(atomic_fetch_and)
__OSX_AVAILABLE_STARTING(__MAC_10_4, __IPHONE_2_0)
bool OSAtomicTestAndClearBarrier( uint32_t __n, volatile void *__theAddress );
-
+
/*! @group Memory barriers */
@@ -1174,4 +1175,92 @@ __END_DECLS
#endif // defined(OSATOMIC_USE_INLINED) && OSATOMIC_USE_INLINED
+#if TARGET_OS_OSX || TARGET_OS_DRIVERKIT
+
+__BEGIN_DECLS
+
+/*! @group Lockless atomic fifo enqueue and dequeue
+ * These routines manipulate singly-linked FIFO lists.
+ *
+ * This API is deprecated and no longer recommended
+ */
+
+/*! @abstract The data structure for a fifo queue head.
+ @discussion
+ You should always initialize a fifo queue head structure with the
+ initialization vector {@link OS_ATOMIC_FIFO_QUEUE_INIT} before use.
+ */
+#if defined(__LP64__)
+
+typedef volatile struct {
+ void *opaque1;
+ void *opaque2;
+ int opaque3;
+} __attribute__ ((aligned (16))) OSFifoQueueHead;
+
+#else
+
+typedef volatile struct {
+ void *opaque1;
+ void *opaque2;
+ int opaque3;
+} OSFifoQueueHead;
+
+#endif
+/*! @abstract The initialization vector for a fifo queue head. */
+#define OS_ATOMIC_FIFO_QUEUE_INIT { NULL, NULL, 0 }
+
+/*! @abstract Enqueue an element onto a list.
+ @discussion
+ Memory barriers are incorporated as needed to permit thread-safe access
+ to the queue element.
+ @param __list
+ The list on which you want to enqueue the element.
+ @param __new
+ The element to add.
+ @param __offset
+ The "offset" parameter is the offset (in bytes) of the link field
+ from the beginning of the data structure being queued (__new).
+ The link field should be a pointer type.
+ The __offset value needs to be same for all enqueuing and
+ dequeuing operations on the same list, even if different structure types
+ are enqueued on that list. The use of offsetset(), defined in
+ stddef.h is the common way to specify the __offset
+ value.
+
+ @note
+ This API is deprecated and no longer recommended
+ */
+__API_DEPRECATED("No longer supported", macos(10.7, 11.0))
+void OSAtomicFifoEnqueue( OSFifoQueueHead *__list, void *__new, size_t __offset);
+
+/*! @abstract Dequeue an element from a list.
+ @discussion
+ Memory barriers are incorporated as needed to permit thread-safe access
+ to the queue element.
+ @param __list
+ The list from which you want to dequeue an element.
+ @param __offset
+ The "offset" parameter is the offset (in bytes) of the link field
+ from the beginning of the data structure being dequeued (__new).
+ The link field should be a pointer type.
+ The __offset value needs to be same for all enqueuing and
+ dequeuing operations on the same list, even if different structure types
+ are enqueued on that list. The use of offsetset(), defined in
+ stddef.h is the common way to specify the __offset
+ value.
+ @result
+ Returns the oldest enqueued element, or NULL if the
+ list is empty.
+
+ @note
+ This API is deprecated and no longer recommended
+ */
+__API_DEPRECATED("No longer supported", macos(10.7, 11.0))
+void* OSAtomicFifoDequeue( OSFifoQueueHead *__list, size_t __offset);
+
+__END_DECLS
+
+#endif /* TARGET_OS_OSX || TARGET_OS_DRIVERKIT */
+
#endif /* _OSATOMIC_DEPRECATED_H_ */
\ No newline at end of file
diff --git a/lib/libc/include/x86_64-macos-gnu/libkern/OSAtomicQueue.h b/lib/libc/include/x86_64-macos-gnu/libkern/OSAtomicQueue.h
index 3f673861e3..66033fc834 100644
--- a/lib/libc/include/x86_64-macos-gnu/libkern/OSAtomicQueue.h
+++ b/lib/libc/include/x86_64-macos-gnu/libkern/OSAtomicQueue.h
@@ -28,6 +28,7 @@
#include
#include
#include
+#include "OSAtomicDeprecated.h"
#include
@@ -109,83 +110,6 @@ void OSAtomicEnqueue( OSQueueHead *__list, void *__new, size_t __offset);
__OSX_AVAILABLE_STARTING(__MAC_10_5, __IPHONE_4_0)
void* OSAtomicDequeue( OSQueueHead *__list, size_t __offset);
-#if defined(__x86_64__) || defined(__i386__)
-
-/*! @group Lockless atomic fifo enqueue and dequeue
- * These routines manipulate singly-linked FIFO lists.
- */
-
-/*! @abstract The data structure for a fifo queue head.
- @discussion
- You should always initialize a fifo queue head structure with the
- initialization vector {@link OS_ATOMIC_FIFO_QUEUE_INIT} before use.
- */
-#if defined(__x86_64__)
-
-typedef volatile struct {
- void *opaque1;
- void *opaque2;
- int opaque3;
-} __attribute__ ((aligned (16))) OSFifoQueueHead;
-
-#else
-
-typedef volatile struct {
- void *opaque1;
- void *opaque2;
- int opaque3;
-} OSFifoQueueHead;
-
-#endif
-
-/*! @abstract The initialization vector for a fifo queue head. */
-#define OS_ATOMIC_FIFO_QUEUE_INIT { NULL, NULL, 0 }
-
-/*! @abstract Enqueue an element onto a list.
- @discussion
- Memory barriers are incorporated as needed to permit thread-safe access
- to the queue element.
- @param __list
- The list on which you want to enqueue the element.
- @param __new
- The element to add.
- @param __offset
- The "offset" parameter is the offset (in bytes) of the link field
- from the beginning of the data structure being queued (__new).
- The link field should be a pointer type.
- The __offset value needs to be same for all enqueuing and
- dequeuing operations on the same list, even if different structure types
- are enqueued on that list. The use of offsetset(), defined in
- stddef.h is the common way to specify the __offset
- value.
- */
-__OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_NA)
-void OSAtomicFifoEnqueue( OSFifoQueueHead *__list, void *__new, size_t __offset);
-
-/*! @abstract Dequeue an element from a list.
- @discussion
- Memory barriers are incorporated as needed to permit thread-safe access
- to the queue element.
- @param __list
- The list from which you want to dequeue an element.
- @param __offset
- The "offset" parameter is the offset (in bytes) of the link field
- from the beginning of the data structure being dequeued (__new).
- The link field should be a pointer type.
- The __offset value needs to be same for all enqueuing and
- dequeuing operations on the same list, even if different structure types
- are enqueued on that list. The use of offsetset(), defined in
- stddef.h is the common way to specify the __offset
- value.
- @result
- Returns the oldest enqueued element, or NULL if the
- list is empty.
- */
-__OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_NA)
-void* OSAtomicFifoDequeue( OSFifoQueueHead *__list, size_t __offset);
-
-#endif /* __i386__ || __x86_64__ */
-
__END_DECLS
#endif /* _OSATOMICQUEUE_H_ */
\ No newline at end of file
diff --git a/lib/libc/include/x86_64-macos-gnu/libkern/OSByteOrder.h b/lib/libc/include/x86_64-macos-gnu/libkern/OSByteOrder.h
deleted file mode 100644
index 25563e26e7..0000000000
--- a/lib/libc/include/x86_64-macos-gnu/libkern/OSByteOrder.h
+++ /dev/null
@@ -1,305 +0,0 @@
-/*
- * Copyright (c) 2000-2006 Apple Computer, Inc. All rights reserved.
- *
- * @APPLE_OSREFERENCE_LICENSE_HEADER_START@
- *
- * This file contains Original Code and/or Modifications of Original Code
- * as defined in and that are subject to the Apple Public Source License
- * Version 2.0 (the 'License'). You may not use this file except in
- * compliance with the License. The rights granted to you under the License
- * may not be used to create, or enable the creation or redistribution of,
- * unlawful or unlicensed copies of an Apple operating system, or to
- * circumvent, violate, or enable the circumvention or violation of, any
- * terms of an Apple operating system software license agreement.
- *
- * Please obtain a copy of the License at
- * http://www.opensource.apple.com/apsl/ and read it before using this file.
- *
- * The Original Code and all software distributed under the License are
- * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
- * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
- * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
- * Please see the License for the specific language governing rights and
- * limitations under the License.
- *
- * @APPLE_OSREFERENCE_LICENSE_HEADER_END@
- */
-
-#ifndef _OS_OSBYTEORDER_H
-#define _OS_OSBYTEORDER_H
-
-#include
-#include
-
-/* Macros for swapping constant values in the preprocessing stage. */
-#define OSSwapConstInt16(x) __DARWIN_OSSwapConstInt16(x)
-#define OSSwapConstInt32(x) __DARWIN_OSSwapConstInt32(x)
-#define OSSwapConstInt64(x) __DARWIN_OSSwapConstInt64(x)
-
-#if defined(__GNUC__)
-
-#if (defined(__i386__) || defined(__x86_64__))
-#include
-#else
-#include
-#endif
-
-#else /* ! __GNUC__ */
-
-#include
-
-#endif /* __GNUC__ */
-
-#define OSSwapInt16(x) __DARWIN_OSSwapInt16(x)
-#define OSSwapInt32(x) __DARWIN_OSSwapInt32(x)
-#define OSSwapInt64(x) __DARWIN_OSSwapInt64(x)
-
-enum {
- OSUnknownByteOrder,
- OSLittleEndian,
- OSBigEndian
-};
-
-OS_INLINE
-int32_t
-OSHostByteOrder(void)
-{
-#if defined(__LITTLE_ENDIAN__)
- return OSLittleEndian;
-#elif defined(__BIG_ENDIAN__)
- return OSBigEndian;
-#else
- return OSUnknownByteOrder;
-#endif
-}
-
-#define OSReadBigInt(x, y) OSReadBigInt32(x, y)
-#define OSWriteBigInt(x, y, z) OSWriteBigInt32(x, y, z)
-#define OSSwapBigToHostInt(x) OSSwapBigToHostInt32(x)
-#define OSSwapHostToBigInt(x) OSSwapHostToBigInt32(x)
-#define OSReadLittleInt(x, y) OSReadLittleInt32(x, y)
-#define OSWriteLittleInt(x, y, z) OSWriteLittleInt32(x, y, z)
-#define OSSwapHostToLittleInt(x) OSSwapHostToLittleInt32(x)
-#define OSSwapLittleToHostInt(x) OSSwapLittleToHostInt32(x)
-
-/* Functions for loading native endian values. */
-
-OS_INLINE
-uint16_t
-_OSReadInt16(
- const volatile void * base,
- uintptr_t byteOffset
- )
-{
- return *(volatile uint16_t *)((uintptr_t)base + byteOffset);
-}
-
-OS_INLINE
-uint32_t
-_OSReadInt32(
- const volatile void * base,
- uintptr_t byteOffset
- )
-{
- return *(volatile uint32_t *)((uintptr_t)base + byteOffset);
-}
-
-OS_INLINE
-uint64_t
-_OSReadInt64(
- const volatile void * base,
- uintptr_t byteOffset
- )
-{
- return *(volatile uint64_t *)((uintptr_t)base + byteOffset);
-}
-
-/* Functions for storing native endian values. */
-
-OS_INLINE
-void
-_OSWriteInt16(
- volatile void * base,
- uintptr_t byteOffset,
- uint16_t data
- )
-{
- *(volatile uint16_t *)((uintptr_t)base + byteOffset) = data;
-}
-
-OS_INLINE
-void
-_OSWriteInt32(
- volatile void * base,
- uintptr_t byteOffset,
- uint32_t data
- )
-{
- *(volatile uint32_t *)((uintptr_t)base + byteOffset) = data;
-}
-
-OS_INLINE
-void
-_OSWriteInt64(
- volatile void * base,
- uintptr_t byteOffset,
- uint64_t data
- )
-{
- *(volatile uint64_t *)((uintptr_t)base + byteOffset) = data;
-}
-
-#if defined(__BIG_ENDIAN__)
-
-/* Functions for loading big endian to host endianess. */
-
-#define OSReadBigInt16(base, byteOffset) _OSReadInt16(base, byteOffset)
-#define OSReadBigInt32(base, byteOffset) _OSReadInt32(base, byteOffset)
-#define OSReadBigInt64(base, byteOffset) _OSReadInt64(base, byteOffset)
-
-/* Functions for storing host endianess to big endian. */
-
-#define OSWriteBigInt16(base, byteOffset, data) _OSWriteInt16(base, byteOffset, data)
-#define OSWriteBigInt32(base, byteOffset, data) _OSWriteInt32(base, byteOffset, data)
-#define OSWriteBigInt64(base, byteOffset, data) _OSWriteInt64(base, byteOffset, data)
-
-/* Functions for loading little endian to host endianess. */
-
-#define OSReadLittleInt16(base, byteOffset) OSReadSwapInt16(base, byteOffset)
-#define OSReadLittleInt32(base, byteOffset) OSReadSwapInt32(base, byteOffset)
-#define OSReadLittleInt64(base, byteOffset) OSReadSwapInt64(base, byteOffset)
-
-/* Functions for storing host endianess to little endian. */
-
-#define OSWriteLittleInt16(base, byteOffset, data) OSWriteSwapInt16(base, byteOffset, data)
-#define OSWriteLittleInt32(base, byteOffset, data) OSWriteSwapInt32(base, byteOffset, data)
-#define OSWriteLittleInt64(base, byteOffset, data) OSWriteSwapInt64(base, byteOffset, data)
-
-/* Host endianess to big endian byte swapping macros for constants. */
-
-#define OSSwapHostToBigConstInt16(x) ((uint16_t)(x))
-#define OSSwapHostToBigConstInt32(x) ((uint32_t)(x))
-#define OSSwapHostToBigConstInt64(x) ((uint64_t)(x))
-
-/* Generic host endianess to big endian byte swapping functions. */
-
-#define OSSwapHostToBigInt16(x) ((uint16_t)(x))
-#define OSSwapHostToBigInt32(x) ((uint32_t)(x))
-#define OSSwapHostToBigInt64(x) ((uint64_t)(x))
-
-/* Host endianess to little endian byte swapping macros for constants. */
-
-#define OSSwapHostToLittleConstInt16(x) OSSwapConstInt16(x)
-#define OSSwapHostToLittleConstInt32(x) OSSwapConstInt32(x)
-#define OSSwapHostToLittleConstInt64(x) OSSwapConstInt64(x)
-
-/* Generic host endianess to little endian byte swapping functions. */
-
-#define OSSwapHostToLittleInt16(x) OSSwapInt16(x)
-#define OSSwapHostToLittleInt32(x) OSSwapInt32(x)
-#define OSSwapHostToLittleInt64(x) OSSwapInt64(x)
-
-/* Big endian to host endianess byte swapping macros for constants. */
-
-#define OSSwapBigToHostConstInt16(x) ((uint16_t)(x))
-#define OSSwapBigToHostConstInt32(x) ((uint32_t)(x))
-#define OSSwapBigToHostConstInt64(x) ((uint64_t)(x))
-
-/* Generic big endian to host endianess byte swapping functions. */
-
-#define OSSwapBigToHostInt16(x) ((uint16_t)(x))
-#define OSSwapBigToHostInt32(x) ((uint32_t)(x))
-#define OSSwapBigToHostInt64(x) ((uint64_t)(x))
-
-/* Little endian to host endianess byte swapping macros for constants. */
-
-#define OSSwapLittleToHostConstInt16(x) OSSwapConstInt16(x)
-#define OSSwapLittleToHostConstInt32(x) OSSwapConstInt32(x)
-#define OSSwapLittleToHostConstInt64(x) OSSwapConstInt64(x)
-
-/* Generic little endian to host endianess byte swapping functions. */
-
-#define OSSwapLittleToHostInt16(x) OSSwapInt16(x)
-#define OSSwapLittleToHostInt32(x) OSSwapInt32(x)
-#define OSSwapLittleToHostInt64(x) OSSwapInt64(x)
-
-#elif defined(__LITTLE_ENDIAN__)
-
-/* Functions for loading big endian to host endianess. */
-
-#define OSReadBigInt16(base, byteOffset) OSReadSwapInt16(base, byteOffset)
-#define OSReadBigInt32(base, byteOffset) OSReadSwapInt32(base, byteOffset)
-#define OSReadBigInt64(base, byteOffset) OSReadSwapInt64(base, byteOffset)
-
-/* Functions for storing host endianess to big endian. */
-
-#define OSWriteBigInt16(base, byteOffset, data) OSWriteSwapInt16(base, byteOffset, data)
-#define OSWriteBigInt32(base, byteOffset, data) OSWriteSwapInt32(base, byteOffset, data)
-#define OSWriteBigInt64(base, byteOffset, data) OSWriteSwapInt64(base, byteOffset, data)
-
-/* Functions for loading little endian to host endianess. */
-
-#define OSReadLittleInt16(base, byteOffset) _OSReadInt16(base, byteOffset)
-#define OSReadLittleInt32(base, byteOffset) _OSReadInt32(base, byteOffset)
-#define OSReadLittleInt64(base, byteOffset) _OSReadInt64(base, byteOffset)
-
-/* Functions for storing host endianess to little endian. */
-
-#define OSWriteLittleInt16(base, byteOffset, data) _OSWriteInt16(base, byteOffset, data)
-#define OSWriteLittleInt32(base, byteOffset, data) _OSWriteInt32(base, byteOffset, data)
-#define OSWriteLittleInt64(base, byteOffset, data) _OSWriteInt64(base, byteOffset, data)
-
-/* Host endianess to big endian byte swapping macros for constants. */
-
-#define OSSwapHostToBigConstInt16(x) OSSwapConstInt16(x)
-#define OSSwapHostToBigConstInt32(x) OSSwapConstInt32(x)
-#define OSSwapHostToBigConstInt64(x) OSSwapConstInt64(x)
-
-/* Generic host endianess to big endian byte swapping functions. */
-
-#define OSSwapHostToBigInt16(x) OSSwapInt16(x)
-#define OSSwapHostToBigInt32(x) OSSwapInt32(x)
-#define OSSwapHostToBigInt64(x) OSSwapInt64(x)
-
-/* Host endianess to little endian byte swapping macros for constants. */
-
-#define OSSwapHostToLittleConstInt16(x) ((uint16_t)(x))
-#define OSSwapHostToLittleConstInt32(x) ((uint32_t)(x))
-#define OSSwapHostToLittleConstInt64(x) ((uint64_t)(x))
-
-/* Generic host endianess to little endian byte swapping functions. */
-
-#define OSSwapHostToLittleInt16(x) ((uint16_t)(x))
-#define OSSwapHostToLittleInt32(x) ((uint32_t)(x))
-#define OSSwapHostToLittleInt64(x) ((uint64_t)(x))
-
-/* Big endian to host endianess byte swapping macros for constants. */
-
-#define OSSwapBigToHostConstInt16(x) OSSwapConstInt16(x)
-#define OSSwapBigToHostConstInt32(x) OSSwapConstInt32(x)
-#define OSSwapBigToHostConstInt64(x) OSSwapConstInt64(x)
-
-/* Generic big endian to host endianess byte swapping functions. */
-
-#define OSSwapBigToHostInt16(x) OSSwapInt16(x)
-#define OSSwapBigToHostInt32(x) OSSwapInt32(x)
-#define OSSwapBigToHostInt64(x) OSSwapInt64(x)
-
-/* Little endian to host endianess byte swapping macros for constants. */
-
-#define OSSwapLittleToHostConstInt16(x) ((uint16_t)(x))
-#define OSSwapLittleToHostConstInt32(x) ((uint32_t)(x))
-#define OSSwapLittleToHostConstInt64(x) ((uint64_t)(x))
-
-/* Generic little endian to host endianess byte swapping functions. */
-
-#define OSSwapLittleToHostInt16(x) ((uint16_t)(x))
-#define OSSwapLittleToHostInt32(x) ((uint32_t)(x))
-#define OSSwapLittleToHostInt64(x) ((uint64_t)(x))
-
-#else
-#error Unknown endianess.
-#endif
-
-#endif /* ! _OS_OSBYTEORDER_H */
\ No newline at end of file
diff --git a/lib/libc/include/x86_64-macos-gnu/libkern/_OSByteOrder.h b/lib/libc/include/x86_64-macos-gnu/libkern/_OSByteOrder.h
deleted file mode 100644
index 06614c63ea..0000000000
--- a/lib/libc/include/x86_64-macos-gnu/libkern/_OSByteOrder.h
+++ /dev/null
@@ -1,130 +0,0 @@
-/*
- * Copyright (c) 2006 Apple Computer, Inc. All rights reserved.
- *
- * @APPLE_OSREFERENCE_LICENSE_HEADER_START@
- *
- * This file contains Original Code and/or Modifications of Original Code
- * as defined in and that are subject to the Apple Public Source License
- * Version 2.0 (the 'License'). You may not use this file except in
- * compliance with the License. The rights granted to you under the License
- * may not be used to create, or enable the creation or redistribution of,
- * unlawful or unlicensed copies of an Apple operating system, or to
- * circumvent, violate, or enable the circumvention or violation of, any
- * terms of an Apple operating system software license agreement.
- *
- * Please obtain a copy of the License at
- * http://www.opensource.apple.com/apsl/ and read it before using this file.
- *
- * The Original Code and all software distributed under the License are
- * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
- * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
- * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
- * Please see the License for the specific language governing rights and
- * limitations under the License.
- *
- * @APPLE_OSREFERENCE_LICENSE_HEADER_END@
- */
-
-#ifndef _OS__OSBYTEORDER_H
-#define _OS__OSBYTEORDER_H
-
-/*
- * This header is normally included from . However,
- * also includes this in the case of little-endian
- * architectures, so that we can map OSByteOrder routines to the hton* and ntoh*
- * macros. This results in the asymmetry below; we only include
- * for little-endian architectures.
- */
-
-#include
-
-/* Macros for swapping constant values in the preprocessing stage. */
-#define __DARWIN_OSSwapConstInt16(x) \
- ((__uint16_t)((((__uint16_t)(x) & 0xff00) >> 8) | \
- (((__uint16_t)(x) & 0x00ff) << 8)))
-
-#define __DARWIN_OSSwapConstInt32(x) \
- ((__uint32_t)((((__uint32_t)(x) & 0xff000000) >> 24) | \
- (((__uint32_t)(x) & 0x00ff0000) >> 8) | \
- (((__uint32_t)(x) & 0x0000ff00) << 8) | \
- (((__uint32_t)(x) & 0x000000ff) << 24)))
-
-#define __DARWIN_OSSwapConstInt64(x) \
- ((__uint64_t)((((__uint64_t)(x) & 0xff00000000000000ULL) >> 56) | \
- (((__uint64_t)(x) & 0x00ff000000000000ULL) >> 40) | \
- (((__uint64_t)(x) & 0x0000ff0000000000ULL) >> 24) | \
- (((__uint64_t)(x) & 0x000000ff00000000ULL) >> 8) | \
- (((__uint64_t)(x) & 0x00000000ff000000ULL) << 8) | \
- (((__uint64_t)(x) & 0x0000000000ff0000ULL) << 24) | \
- (((__uint64_t)(x) & 0x000000000000ff00ULL) << 40) | \
- (((__uint64_t)(x) & 0x00000000000000ffULL) << 56)))
-
-#if defined(__GNUC__)
-
-#if defined(__i386__) || defined(__x86_64__)
-#include
-#endif
-
-
-
-#define __DARWIN_OSSwapInt16(x) \
- ((__uint16_t)(__builtin_constant_p(x) ? __DARWIN_OSSwapConstInt16(x) : _OSSwapInt16(x)))
-
-#define __DARWIN_OSSwapInt32(x) \
- (__builtin_constant_p(x) ? __DARWIN_OSSwapConstInt32(x) : _OSSwapInt32(x))
-
-#define __DARWIN_OSSwapInt64(x) \
- (__builtin_constant_p(x) ? __DARWIN_OSSwapConstInt64(x) : _OSSwapInt64(x))
-
-#else /* ! __GNUC__ */
-
-#if defined(__i386__) || defined(__x86_64__)
-
-#if !defined(__DARWIN_OS_INLINE)
-# if defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
-# define __DARWIN_OS_INLINE static inline
-# elif defined(__MWERKS__) || defined(__cplusplus)
-# define __DARWIN_OS_INLINE static inline
-# else
-# define __DARWIN_OS_INLINE static __inline__
-# endif
-#endif
-
-__DARWIN_OS_INLINE
-uint16_t
-_OSSwapInt16(
- uint16_t data
- )
-{
- return __DARWIN_OSSwapConstInt16(data);
-}
-
-__DARWIN_OS_INLINE
-uint32_t
-_OSSwapInt32(
- uint32_t data
- )
-{
- return __DARWIN_OSSwapConstInt32(data);
-}
-
-__DARWIN_OS_INLINE
-uint64_t
-_OSSwapInt64(
- uint64_t data
- )
-{
- return __DARWIN_OSSwapConstInt64(data);
-}
-#endif
-
-#define __DARWIN_OSSwapInt16(x) _OSSwapInt16(x)
-
-#define __DARWIN_OSSwapInt32(x) _OSSwapInt32(x)
-
-#define __DARWIN_OSSwapInt64(x) _OSSwapInt64(x)
-
-#endif /* __GNUC__ */
-
-#endif /* ! _OS__OSBYTEORDER_H */
\ No newline at end of file
diff --git a/lib/libc/include/x86_64-macos-gnu/libproc.h b/lib/libc/include/x86_64-macos-gnu/libproc.h
deleted file mode 100644
index 4094fe40ef..0000000000
--- a/lib/libc/include/x86_64-macos-gnu/libproc.h
+++ /dev/null
@@ -1,187 +0,0 @@
-/*
- * Copyright (c) 2006, 2007, 2010 Apple Inc. All rights reserved.
- *
- * @APPLE_LICENSE_HEADER_START@
- *
- * This file contains Original Code and/or Modifications of Original Code
- * as defined in and that are subject to the Apple Public Source License
- * Version 2.0 (the 'License'). You may not use this file except in
- * compliance with the License. Please obtain a copy of the License at
- * http://www.opensource.apple.com/apsl/ and read it before using this
- * file.
- *
- * The Original Code and all software distributed under the License are
- * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
- * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
- * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
- * Please see the License for the specific language governing rights and
- * limitations under the License.
- *
- * @APPLE_LICENSE_HEADER_END@
- */
-#ifndef _LIBPROC_H_
-#define _LIBPROC_H_
-
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include /* for audit_token_t */
-
-#include
-
-#include
-#include
-
-/*
- * This header file contains private interfaces to obtain process information.
- * These interfaces are subject to change in future releases.
- */
-
-/*!
- * @define PROC_LISTPIDSPATH_PATH_IS_VOLUME
- * @discussion This flag indicates that all processes that hold open
- * file references on the volume associated with the specified
- * path should be returned.
- */
-#define PROC_LISTPIDSPATH_PATH_IS_VOLUME 1
-
-
-/*!
- * @define PROC_LISTPIDSPATH_EXCLUDE_EVTONLY
- * @discussion This flag indicates that file references that were opened
- * with the O_EVTONLY flag should be excluded from the matching
- * criteria.
- */
-#define PROC_LISTPIDSPATH_EXCLUDE_EVTONLY 2
-
-__BEGIN_DECLS
-
-
-/*!
- * @function proc_listpidspath
- * @discussion A function which will search through the current
- * processes looking for open file references which match
- * a specified path or volume.
- * @param type types of processes to be searched (see proc_listpids)
- * @param typeinfo adjunct information for type
- * @param path file or volume path
- * @param pathflags flags to control which files should be considered
- * during the process search.
- * @param buffer a C array of int-sized values to be filled with
- * process identifiers that hold an open file reference
- * matching the specified path or volume. Pass NULL to
- * obtain the minimum buffer size needed to hold the
- * currently active processes.
- * @param buffersize the size (in bytes) of the provided buffer.
- * @result the number of bytes of data returned in the provided buffer;
- * -1 if an error was encountered;
- */
-int proc_listpidspath(uint32_t type,
- uint32_t typeinfo,
- const char *path,
- uint32_t pathflags,
- void *buffer,
- int buffersize) __OSX_AVAILABLE_STARTING(__MAC_10_5, __IPHONE_2_0);
-
-int proc_listpids(uint32_t type, uint32_t typeinfo, void *buffer, int buffersize) __OSX_AVAILABLE_STARTING(__MAC_10_5, __IPHONE_2_0);
-int proc_listallpids(void * buffer, int buffersize) __OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_4_1);
-int proc_listpgrppids(pid_t pgrpid, void * buffer, int buffersize) __OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_4_1);
-int proc_listchildpids(pid_t ppid, void * buffer, int buffersize) __OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_4_1);
-int proc_pidinfo(int pid, int flavor, uint64_t arg, void *buffer, int buffersize) __OSX_AVAILABLE_STARTING(__MAC_10_5, __IPHONE_2_0);
-int proc_pidfdinfo(int pid, int fd, int flavor, void * buffer, int buffersize) __OSX_AVAILABLE_STARTING(__MAC_10_5, __IPHONE_2_0);
-int proc_pidfileportinfo(int pid, uint32_t fileport, int flavor, void *buffer, int buffersize) __OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_4_3);
-int proc_name(int pid, void * buffer, uint32_t buffersize) __OSX_AVAILABLE_STARTING(__MAC_10_5, __IPHONE_2_0);
-int proc_regionfilename(int pid, uint64_t address, void * buffer, uint32_t buffersize) __OSX_AVAILABLE_STARTING(__MAC_10_5, __IPHONE_2_0);
-int proc_kmsgbuf(void * buffer, uint32_t buffersize) __OSX_AVAILABLE_STARTING(__MAC_10_5, __IPHONE_2_0);
-int proc_pidpath(int pid, void * buffer, uint32_t buffersize) __OSX_AVAILABLE_STARTING(__MAC_10_5, __IPHONE_2_0);
-int proc_pidpath_audittoken(audit_token_t *audittoken, void * buffer, uint32_t buffersize) API_AVAILABLE(macos(11.0), ios(14.0), watchos(7.0), tvos(14.0));
-int proc_libversion(int *major, int * minor) __OSX_AVAILABLE_STARTING(__MAC_10_5, __IPHONE_2_0);
-
-/*
- * Return resource usage information for the given pid, which can be a live process or a zombie.
- *
- * Returns 0 on success; or -1 on failure, with errno set to indicate the specific error.
- */
-int proc_pid_rusage(int pid, int flavor, rusage_info_t *buffer) __OSX_AVAILABLE_STARTING(__MAC_10_9, __IPHONE_7_0);
-
-/*
- * A process can use the following api to set its own process control
- * state on resoure starvation. The argument can have one of the PROC_SETPC_XX values
- */
-#define PROC_SETPC_NONE 0
-#define PROC_SETPC_THROTTLEMEM 1
-#define PROC_SETPC_SUSPEND 2
-#define PROC_SETPC_TERMINATE 3
-
-int proc_setpcontrol(const int control) __OSX_AVAILABLE_STARTING(__MAC_10_6, __IPHONE_3_2);
-int proc_setpcontrol(const int control);
-
-int proc_track_dirty(pid_t pid, uint32_t flags);
-int proc_set_dirty(pid_t pid, bool dirty);
-int proc_get_dirty(pid_t pid, uint32_t *flags);
-int proc_clear_dirty(pid_t pid, uint32_t flags);
-
-int proc_terminate(pid_t pid, int *sig);
-
-/*
- * NO_SMT means that on an SMT CPU, this thread must be scheduled alone,
- * with the paired CPU idle.
- *
- * Set NO_SMT on the current proc (all existing and future threads)
- * This attribute is inherited on fork and exec
- */
-int proc_set_no_smt(void) __API_AVAILABLE(macos(11.0));
-
-/* Set NO_SMT on the current thread */
-int proc_setthread_no_smt(void) __API_AVAILABLE(macos(11.0));
-
-/*
- * CPU Security Mitigation APIs
- *
- * Set CPU security mitigation on the current proc (all existing and future threads)
- * This attribute is inherited on fork and exec
- */
-int proc_set_csm(uint32_t flags) __API_AVAILABLE(macos(11.0));
-
-/* Set CPU security mitigation on the current thread */
-int proc_setthread_csm(uint32_t flags) __API_AVAILABLE(macos(11.0));
-
-/*
- * flags for CPU Security Mitigation APIs
- * PROC_CSM_ALL should be used in most cases,
- * the individual flags are provided only for performance evaluation etc
- */
-#define PROC_CSM_ALL 0x0001 /* Set all available mitigations */
-#define PROC_CSM_NOSMT 0x0002 /* Set NO_SMT - see above */
-#define PROC_CSM_TECS 0x0004 /* Execute VERW on every return to user mode */
-
-#ifdef PRIVATE
-#include
-/*
- * Enumerate potential userspace pointers embedded in kernel data structures.
- * Currently inspects kqueues only.
- *
- * NOTE: returned "pointers" are opaque user-supplied values and thus not
- * guaranteed to address valid objects or be pointers at all.
- *
- * Returns the number of pointers found (which may exceed buffersize), or -1 on
- * failure and errno set appropriately.
- */
-int proc_list_uptrs(pid_t pid, uint64_t *buffer, uint32_t buffersize);
-
-int proc_list_dynkqueueids(int pid, kqueue_id_t *buf, uint32_t bufsz);
-int proc_piddynkqueueinfo(int pid, int flavor, kqueue_id_t kq_id, void *buffer,
- int buffersize);
-#endif /* PRIVATE */
-
-int proc_udata_info(int pid, int flavor, void *buffer, int buffersize);
-
-__END_DECLS
-
-#endif /*_LIBPROC_H_ */
diff --git a/lib/libc/include/x86_64-macos-gnu/mach-o/dyld.h b/lib/libc/include/x86_64-macos-gnu/mach-o/dyld.h
deleted file mode 100644
index 0b293cbd09..0000000000
--- a/lib/libc/include/x86_64-macos-gnu/mach-o/dyld.h
+++ /dev/null
@@ -1,263 +0,0 @@
-/*
- * Copyright (c) 1999-2008 Apple Inc. All rights reserved.
- *
- * @APPLE_LICENSE_HEADER_START@
- *
- * This file contains Original Code and/or Modifications of Original Code
- * as defined in and that are subject to the Apple Public Source License
- * Version 2.0 (the 'License'). You may not use this file except in
- * compliance with the License. Please obtain a copy of the License at
- * http://www.opensource.apple.com/apsl/ and read it before using this
- * file.
- *
- * The Original Code and all software distributed under the License are
- * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
- * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
- * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
- * Please see the License for the specific language governing rights and
- * limitations under the License.
- *
- * @APPLE_LICENSE_HEADER_END@
- */
-#ifndef _MACH_O_DYLD_H_
-#define _MACH_O_DYLD_H_
-
-
-#include
-#include
-#include
-
-#include
-#include
-
-#if __cplusplus
-extern "C" {
-#endif
-
-#ifdef __DRIVERKIT_19_0
- #define DYLD_DRIVERKIT_UNAVAILABLE __API_UNAVAILABLE(driverkit)
-#else
- #define DYLD_DRIVERKIT_UNAVAILABLE
-#endif
-
-/*
- * The following functions allow you to iterate through all loaded images.
- * This is not a thread safe operation. Another thread can add or remove
- * an image during the iteration.
- *
- * Many uses of these routines can be replace by a call to dladdr() which
- * will return the mach_header and name of an image, given an address in
- * the image. dladdr() is thread safe.
- */
-extern uint32_t _dyld_image_count(void) __OSX_AVAILABLE_STARTING(__MAC_10_1, __IPHONE_2_0);
-extern const struct mach_header* _dyld_get_image_header(uint32_t image_index) __OSX_AVAILABLE_STARTING(__MAC_10_1, __IPHONE_2_0);
-extern intptr_t _dyld_get_image_vmaddr_slide(uint32_t image_index) __OSX_AVAILABLE_STARTING(__MAC_10_1, __IPHONE_2_0);
-extern const char* _dyld_get_image_name(uint32_t image_index) __OSX_AVAILABLE_STARTING(__MAC_10_1, __IPHONE_2_0);
-
-
-/*
- * The following functions allow you to install callbacks which will be called
- * by dyld whenever an image is loaded or unloaded. During a call to _dyld_register_func_for_add_image()
- * the callback func is called for every existing image. Later, it is called as each new image
- * is loaded and bound (but initializers not yet run). The callback registered with
- * _dyld_register_func_for_remove_image() is called after any terminators in an image are run
- * and before the image is un-memory-mapped.
- */
-extern void _dyld_register_func_for_add_image(void (*func)(const struct mach_header* mh, intptr_t vmaddr_slide)) __OSX_AVAILABLE_STARTING(__MAC_10_1, __IPHONE_2_0);
-extern void _dyld_register_func_for_remove_image(void (*func)(const struct mach_header* mh, intptr_t vmaddr_slide)) __OSX_AVAILABLE_STARTING(__MAC_10_1, __IPHONE_2_0);
-
-
-/*
- * NSVersionOfRunTimeLibrary() returns the current_version number of the currently dylib
- * specifed by the libraryName. The libraryName parameter would be "bar" for /path/libbar.3.dylib and
- * "Foo" for /path/Foo.framework/Versions/A/Foo. It returns -1 if no such library is loaded.
- */
-extern int32_t NSVersionOfRunTimeLibrary(const char* libraryName) __OSX_AVAILABLE_STARTING(__MAC_10_1, __IPHONE_2_0);
-
-
-/*
- * NSVersionOfLinkTimeLibrary() returns the current_version number that the main executable was linked
- * against at build time. The libraryName parameter would be "bar" for /path/libbar.3.dylib and
- * "Foo" for /path/Foo.framework/Versions/A/Foo. It returns -1 if the main executable did not link
- * against the specified library.
- */
-extern int32_t NSVersionOfLinkTimeLibrary(const char* libraryName) __OSX_AVAILABLE_STARTING(__MAC_10_1, __IPHONE_2_0);
-
-
-/*
- * _NSGetExecutablePath() copies the path of the main executable into the buffer. The bufsize parameter
- * should initially be the size of the buffer. The function returns 0 if the path was successfully copied,
- * and *bufsize is left unchanged. It returns -1 if the buffer is not large enough, and *bufsize is set
- * to the size required.
- *
- * Note that _NSGetExecutablePath will return "a path" to the executable not a "real path" to the executable.
- * That is the path may be a symbolic link and not the real file. With deep directories the total bufsize
- * needed could be more than MAXPATHLEN.
- */
-extern int _NSGetExecutablePath(char* buf, uint32_t* bufsize) __OSX_AVAILABLE_STARTING(__MAC_10_2, __IPHONE_2_0);
-
-
-
-/*
- * Registers a function to be called when the current thread terminates.
- * Called by c++ compiler to implement destructors on thread_local object variables.
- */
-extern void _tlv_atexit(void (*termFunc)(void* objAddr), void* objAddr) __OSX_AVAILABLE_STARTING(__MAC_10_10, __IPHONE_8_0);
-
-
-/*
- * Never called. On-disk thread local variables contain a pointer to this. Once
- * the thread local is prepared, the pointer changes to a real handler such as tlv_get_addr.
- */
-extern void _tlv_bootstrap(void) __OSX_AVAILABLE_STARTING(__MAC_10_10, __IPHONE_8_0) DYLD_DRIVERKIT_UNAVAILABLE ;
-
-/*
- * The following dyld API's are deprecated as of Mac OS X 10.5. They are either
- * no longer necessary or are superceeded by dlopen and friends in .
- * dlopen/dlsym/dlclose have been available since Mac OS X 10.3 and work with
- * dylibs and bundles.
- *
- * NSAddImage -> dlopen
- * NSLookupSymbolInImage -> dlsym
- * NSCreateObjectFileImageFromFile -> dlopen
- * NSDestroyObjectFileImage -> dlclose
- * NSLinkModule -> not needed when dlopen used
- * NSUnLinkModule -> not needed when dlclose used
- * NSLookupSymbolInModule -> dlsym
- * _dyld_image_containing_address -> dladdr
- * NSLinkEditError -> dlerror
- *
- */
-
-#ifndef ENUM_DYLD_BOOL
-#define ENUM_DYLD_BOOL
- #undef FALSE
- #undef TRUE
- enum DYLD_BOOL { FALSE, TRUE };
-#endif /* ENUM_DYLD_BOOL */
-
-
-/* Object file image API */
-typedef enum {
- NSObjectFileImageFailure, /* for this a message is printed on stderr */
- NSObjectFileImageSuccess,
- NSObjectFileImageInappropriateFile,
- NSObjectFileImageArch,
- NSObjectFileImageFormat, /* for this a message is printed on stderr */
- NSObjectFileImageAccess
-} NSObjectFileImageReturnCode;
-
-typedef struct __NSObjectFileImage* NSObjectFileImage;
-
-
-
-/* NSObjectFileImage can only be used with MH_BUNDLE files */
-extern NSObjectFileImageReturnCode NSCreateObjectFileImageFromFile(const char* pathName, NSObjectFileImage *objectFileImage) __API_UNAVAILABLE(ios, tvos, watchos) DYLD_DRIVERKIT_UNAVAILABLE __OSX_DEPRECATED(10.1, 10.5, "dlopen()");
-extern NSObjectFileImageReturnCode NSCreateObjectFileImageFromMemory(const void *address, size_t size, NSObjectFileImage *objectFileImage) __API_UNAVAILABLE(ios, tvos, watchos) DYLD_DRIVERKIT_UNAVAILABLE __OSX_DEPRECATED(10.1, 10.5, "");
-extern bool NSDestroyObjectFileImage(NSObjectFileImage objectFileImage) __API_UNAVAILABLE(ios, tvos, watchos) DYLD_DRIVERKIT_UNAVAILABLE __OSX_DEPRECATED(10.1, 10.5, "dlclose()");
-
-extern uint32_t NSSymbolDefinitionCountInObjectFileImage(NSObjectFileImage objectFileImage) __API_UNAVAILABLE(ios, tvos, watchos) DYLD_DRIVERKIT_UNAVAILABLE __OSX_DEPRECATED(10.1, 10.5, "");
-extern const char* NSSymbolDefinitionNameInObjectFileImage(NSObjectFileImage objectFileImage, uint32_t ordinal) __API_UNAVAILABLE(ios, tvos, watchos) DYLD_DRIVERKIT_UNAVAILABLE __OSX_DEPRECATED(10.1, 10.5, "");
-extern uint32_t NSSymbolReferenceCountInObjectFileImage(NSObjectFileImage objectFileImage) __API_UNAVAILABLE(ios, tvos, watchos) DYLD_DRIVERKIT_UNAVAILABLE __OSX_DEPRECATED(10.1, 10.5, "");
-extern const char* NSSymbolReferenceNameInObjectFileImage(NSObjectFileImage objectFileImage, uint32_t ordinal, bool *tentative_definition) __API_UNAVAILABLE(ios, tvos, watchos) DYLD_DRIVERKIT_UNAVAILABLE __OSX_DEPRECATED(10.1, 10.5, "");
-extern bool NSIsSymbolDefinedInObjectFileImage(NSObjectFileImage objectFileImage, const char* symbolName) __API_UNAVAILABLE(ios, tvos, watchos) DYLD_DRIVERKIT_UNAVAILABLE __OSX_DEPRECATED(10.1, 10.4, "dlsym()");
-extern void* NSGetSectionDataInObjectFileImage(NSObjectFileImage objectFileImage, const char* segmentName, const char* sectionName, size_t *size) __API_UNAVAILABLE(ios, tvos, watchos) DYLD_DRIVERKIT_UNAVAILABLE __OSX_DEPRECATED(10.1, 10.5, "getsectiondata()");
-
-typedef struct __NSModule* NSModule;
-extern const char* NSNameOfModule(NSModule m) __API_UNAVAILABLE(ios, tvos, watchos) DYLD_DRIVERKIT_UNAVAILABLE __OSX_DEPRECATED(10.1, 10.5, "");
-extern const char* NSLibraryNameForModule(NSModule m) __API_UNAVAILABLE(ios, tvos, watchos) DYLD_DRIVERKIT_UNAVAILABLE __OSX_DEPRECATED(10.1, 10.5, "");
-
-extern NSModule NSLinkModule(NSObjectFileImage objectFileImage, const char* moduleName, uint32_t options) __API_UNAVAILABLE(ios, tvos, watchos) DYLD_DRIVERKIT_UNAVAILABLE __OSX_DEPRECATED(10.1, 10.5, "dlopen()");
-#define NSLINKMODULE_OPTION_NONE 0x0
-#define NSLINKMODULE_OPTION_BINDNOW 0x1
-#define NSLINKMODULE_OPTION_PRIVATE 0x2
-#define NSLINKMODULE_OPTION_RETURN_ON_ERROR 0x4
-#define NSLINKMODULE_OPTION_DONT_CALL_MOD_INIT_ROUTINES 0x8
-#define NSLINKMODULE_OPTION_TRAILING_PHYS_NAME 0x10
-
-extern bool NSUnLinkModule(NSModule module, uint32_t options) __API_UNAVAILABLE(ios, tvos, watchos) DYLD_DRIVERKIT_UNAVAILABLE __OSX_DEPRECATED(10.1, 10.5, "");
-#define NSUNLINKMODULE_OPTION_NONE 0x0
-#define NSUNLINKMODULE_OPTION_KEEP_MEMORY_MAPPED 0x1
-#define NSUNLINKMODULE_OPTION_RESET_LAZY_REFERENCES 0x2
-
-/* symbol API */
-typedef struct __NSSymbol* NSSymbol;
-extern bool NSIsSymbolNameDefined(const char* symbolName) __API_UNAVAILABLE(ios, tvos, watchos) DYLD_DRIVERKIT_UNAVAILABLE __OSX_DEPRECATED(10.1, 10.4, "dlsym()");
-extern bool NSIsSymbolNameDefinedWithHint(const char* symbolName, const char* libraryNameHint) __API_UNAVAILABLE(ios, tvos, watchos) DYLD_DRIVERKIT_UNAVAILABLE __OSX_DEPRECATED(10.1, 10.4, "dlsym()");
-extern bool NSIsSymbolNameDefinedInImage(const struct mach_header* image, const char* symbolName) __API_UNAVAILABLE(ios, tvos, watchos) DYLD_DRIVERKIT_UNAVAILABLE __OSX_DEPRECATED(10.1, 10.4, "dlsym()");
-extern NSSymbol NSLookupAndBindSymbol(const char* symbolName) __API_UNAVAILABLE(ios, tvos, watchos) DYLD_DRIVERKIT_UNAVAILABLE __OSX_DEPRECATED(10.1, 10.4, "dlsym()");
-extern NSSymbol NSLookupAndBindSymbolWithHint(const char* symbolName, const char* libraryNameHint) __API_UNAVAILABLE(ios, tvos, watchos) DYLD_DRIVERKIT_UNAVAILABLE __OSX_DEPRECATED(10.1, 10.4, "dlsym()");
-extern NSSymbol NSLookupSymbolInModule(NSModule module, const char* symbolName) __API_UNAVAILABLE(ios, tvos, watchos) DYLD_DRIVERKIT_UNAVAILABLE __OSX_DEPRECATED(10.1, 10.5, "dlsym()");
-extern NSSymbol NSLookupSymbolInImage(const struct mach_header* image, const char* symbolName, uint32_t options) __API_UNAVAILABLE(ios, tvos, watchos) DYLD_DRIVERKIT_UNAVAILABLE __OSX_DEPRECATED(10.1, 10.5, "dlsym()");
-#define NSLOOKUPSYMBOLINIMAGE_OPTION_BIND 0x0
-#define NSLOOKUPSYMBOLINIMAGE_OPTION_BIND_NOW 0x1
-#define NSLOOKUPSYMBOLINIMAGE_OPTION_BIND_FULLY 0x2
-#define NSLOOKUPSYMBOLINIMAGE_OPTION_RETURN_ON_ERROR 0x4
-extern const char* NSNameOfSymbol(NSSymbol symbol) __API_UNAVAILABLE(ios, tvos, watchos) DYLD_DRIVERKIT_UNAVAILABLE __OSX_DEPRECATED(10.1, 10.5, "");
-extern void * NSAddressOfSymbol(NSSymbol symbol) __API_UNAVAILABLE(ios, tvos, watchos) DYLD_DRIVERKIT_UNAVAILABLE __OSX_DEPRECATED(10.1, 10.5, "dlsym()");
-extern NSModule NSModuleForSymbol(NSSymbol symbol) __API_UNAVAILABLE(ios, tvos, watchos) DYLD_DRIVERKIT_UNAVAILABLE __OSX_DEPRECATED(10.1, 10.5, "dladdr()");
-
-/* error handling API */
-typedef enum {
- NSLinkEditFileAccessError,
- NSLinkEditFileFormatError,
- NSLinkEditMachResourceError,
- NSLinkEditUnixResourceError,
- NSLinkEditOtherError,
- NSLinkEditWarningError,
- NSLinkEditMultiplyDefinedError,
- NSLinkEditUndefinedError
-} NSLinkEditErrors;
-
-/*
- * For the NSLinkEditErrors value NSLinkEditOtherError these are the values
- * passed to the link edit error handler as the errorNumber (what would be an
- * errno value for NSLinkEditUnixResourceError or a kern_return_t value for
- * NSLinkEditMachResourceError).
- */
-typedef enum {
- NSOtherErrorRelocation,
- NSOtherErrorLazyBind,
- NSOtherErrorIndrLoop,
- NSOtherErrorLazyInit,
- NSOtherErrorInvalidArgs
-} NSOtherErrorNumbers;
-
-extern void NSLinkEditError(NSLinkEditErrors *c, int *errorNumber, const char** fileName, const char** errorString) __API_UNAVAILABLE(ios, tvos, watchos) DYLD_DRIVERKIT_UNAVAILABLE __OSX_DEPRECATED(10.1, 10.5, "dlerror()");
-
-typedef struct {
- void (*undefined)(const char* symbolName);
- NSModule (*multiple)(NSSymbol s, NSModule oldModule, NSModule newModule);
- void (*linkEdit)(NSLinkEditErrors errorClass, int errorNumber,
- const char* fileName, const char* errorString);
-} NSLinkEditErrorHandlers;
-
-extern void NSInstallLinkEditErrorHandlers(const NSLinkEditErrorHandlers *handlers) __API_UNAVAILABLE(ios, tvos, watchos) DYLD_DRIVERKIT_UNAVAILABLE __OSX_DEPRECATED(10.1, 10.5, "");
-
-extern bool NSAddLibrary(const char* pathName) __API_UNAVAILABLE(ios, tvos, watchos) DYLD_DRIVERKIT_UNAVAILABLE __OSX_DEPRECATED(10.1, 10.4, "dlopen()");
-extern bool NSAddLibraryWithSearching(const char* pathName) __API_UNAVAILABLE(ios, tvos, watchos) DYLD_DRIVERKIT_UNAVAILABLE __OSX_DEPRECATED(10.1, 10.4, "dlopen()");
-extern const struct mach_header* NSAddImage(const char* image_name, uint32_t options) __API_UNAVAILABLE(ios, tvos, watchos) DYLD_DRIVERKIT_UNAVAILABLE __OSX_DEPRECATED(10.1, 10.5, "dlopen()");
-#define NSADDIMAGE_OPTION_NONE 0x0
-#define NSADDIMAGE_OPTION_RETURN_ON_ERROR 0x1
-#define NSADDIMAGE_OPTION_WITH_SEARCHING 0x2
-#define NSADDIMAGE_OPTION_RETURN_ONLY_IF_LOADED 0x4
-#define NSADDIMAGE_OPTION_MATCH_FILENAME_BY_INSTALLNAME 0x8
-
-extern bool _dyld_present(void) __API_UNAVAILABLE(ios, tvos, watchos) DYLD_DRIVERKIT_UNAVAILABLE __OSX_DEPRECATED(10.1, 10.5, "always true");
-extern bool _dyld_launched_prebound(void) __API_UNAVAILABLE(ios, tvos, watchos) DYLD_DRIVERKIT_UNAVAILABLE __OSX_DEPRECATED(10.1, 10.5, "moot");
-extern bool _dyld_all_twolevel_modules_prebound(void) __API_UNAVAILABLE(ios, tvos, watchos) DYLD_DRIVERKIT_UNAVAILABLE __OSX_DEPRECATED(10.3, 10.5, "moot");
-extern bool _dyld_bind_fully_image_containing_address(const void* address) __API_UNAVAILABLE(ios, tvos, watchos) DYLD_DRIVERKIT_UNAVAILABLE __OSX_DEPRECATED(10.1, 10.5, "dlopen(RTLD_NOW)");
-extern bool _dyld_image_containing_address(const void* address) __API_UNAVAILABLE(ios, tvos, watchos) DYLD_DRIVERKIT_UNAVAILABLE __OSX_DEPRECATED(10.3, 10.5, "dladdr()");
-extern void _dyld_lookup_and_bind(const char* symbol_name, void **address, NSModule* module) __API_UNAVAILABLE(ios, tvos, watchos) DYLD_DRIVERKIT_UNAVAILABLE __OSX_DEPRECATED(10.1, 10.4, "dlsym()");
-extern void _dyld_lookup_and_bind_with_hint(const char* symbol_name, const char* library_name_hint, void** address, NSModule* module) __API_UNAVAILABLE(ios, tvos, watchos) DYLD_DRIVERKIT_UNAVAILABLE __OSX_DEPRECATED(10.1, 10.4, "dlsym()");
-extern void _dyld_lookup_and_bind_fully(const char* symbol_name, void** address, NSModule* module) __API_UNAVAILABLE(ios, tvos, watchos) DYLD_DRIVERKIT_UNAVAILABLE __OSX_DEPRECATED(10.1, 10.5, "dlsym()");
-
-extern const struct mach_header* _dyld_get_image_header_containing_address(const void* address) __API_UNAVAILABLE(ios, tvos, watchos) DYLD_DRIVERKIT_UNAVAILABLE __OSX_DEPRECATED(10.3, 10.5, "dladdr()");
-
-
-#if __cplusplus
-}
-#endif
-
-#endif /* _MACH_O_DYLD_H_ */
\ No newline at end of file
diff --git a/lib/libc/include/x86_64-macos-gnu/mach-o/loader.h b/lib/libc/include/x86_64-macos-gnu/mach-o/loader.h
deleted file mode 100644
index a088105205..0000000000
--- a/lib/libc/include/x86_64-macos-gnu/mach-o/loader.h
+++ /dev/null
@@ -1,1577 +0,0 @@
-/*
- * Copyright (c) 1999-2010 Apple Inc. All Rights Reserved.
- *
- * @APPLE_LICENSE_HEADER_START@
- *
- * This file contains Original Code and/or Modifications of Original Code
- * as defined in and that are subject to the Apple Public Source License
- * Version 2.0 (the 'License'). You may not use this file except in
- * compliance with the License. Please obtain a copy of the License at
- * http://www.opensource.apple.com/apsl/ and read it before using this
- * file.
- *
- * The Original Code and all software distributed under the License are
- * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
- * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
- * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
- * Please see the License for the specific language governing rights and
- * limitations under the License.
- *
- * @APPLE_LICENSE_HEADER_END@
- */
-#ifndef _MACHO_LOADER_H_
-#define _MACHO_LOADER_H_
-
-/*
- * This file describes the format of mach object files.
- */
-#include
-
-/*
- * is needed here for the cpu_type_t and cpu_subtype_t types
- * and contains the constants for the possible values of these types.
- */
-#include
-
-/*
- * is needed here for the vm_prot_t type and contains the
- * constants that are or'ed together for the possible values of this type.
- */
-#include
-
-/*
- * is expected to define the flavors of the thread
- * states and the structures of those flavors for each machine.
- */
-#include
-#include
-
-/*
- * The 32-bit mach header appears at the very beginning of the object file for
- * 32-bit architectures.
- */
-struct mach_header {
- uint32_t magic; /* mach magic number identifier */
- cpu_type_t cputype; /* cpu specifier */
- cpu_subtype_t cpusubtype; /* machine specifier */
- uint32_t filetype; /* type of file */
- uint32_t ncmds; /* number of load commands */
- uint32_t sizeofcmds; /* the size of all the load commands */
- uint32_t flags; /* flags */
-};
-
-/* Constant for the magic field of the mach_header (32-bit architectures) */
-#define MH_MAGIC 0xfeedface /* the mach magic number */
-#define MH_CIGAM 0xcefaedfe /* NXSwapInt(MH_MAGIC) */
-
-/*
- * The 64-bit mach header appears at the very beginning of object files for
- * 64-bit architectures.
- */
-struct mach_header_64 {
- uint32_t magic; /* mach magic number identifier */
- cpu_type_t cputype; /* cpu specifier */
- cpu_subtype_t cpusubtype; /* machine specifier */
- uint32_t filetype; /* type of file */
- uint32_t ncmds; /* number of load commands */
- uint32_t sizeofcmds; /* the size of all the load commands */
- uint32_t flags; /* flags */
- uint32_t reserved; /* reserved */
-};
-
-/* Constant for the magic field of the mach_header_64 (64-bit architectures) */
-#define MH_MAGIC_64 0xfeedfacf /* the 64-bit mach magic number */
-#define MH_CIGAM_64 0xcffaedfe /* NXSwapInt(MH_MAGIC_64) */
-
-/*
- * The layout of the file depends on the filetype. For all but the MH_OBJECT
- * file type the segments are padded out and aligned on a segment alignment
- * boundary for efficient demand pageing. The MH_EXECUTE, MH_FVMLIB, MH_DYLIB,
- * MH_DYLINKER and MH_BUNDLE file types also have the headers included as part
- * of their first segment.
- *
- * The file type MH_OBJECT is a compact format intended as output of the
- * assembler and input (and possibly output) of the link editor (the .o
- * format). All sections are in one unnamed segment with no segment padding.
- * This format is used as an executable format when the file is so small the
- * segment padding greatly increases its size.
- *
- * The file type MH_PRELOAD is an executable format intended for things that
- * are not executed under the kernel (proms, stand alones, kernels, etc). The
- * format can be executed under the kernel but may demand paged it and not
- * preload it before execution.
- *
- * A core file is in MH_CORE format and can be any in an arbritray legal
- * Mach-O file.
- *
- * Constants for the filetype field of the mach_header
- */
-#define MH_OBJECT 0x1 /* relocatable object file */
-#define MH_EXECUTE 0x2 /* demand paged executable file */
-#define MH_FVMLIB 0x3 /* fixed VM shared library file */
-#define MH_CORE 0x4 /* core file */
-#define MH_PRELOAD 0x5 /* preloaded executable file */
-#define MH_DYLIB 0x6 /* dynamically bound shared library */
-#define MH_DYLINKER 0x7 /* dynamic link editor */
-#define MH_BUNDLE 0x8 /* dynamically bound bundle file */
-#define MH_DYLIB_STUB 0x9 /* shared library stub for static */
- /* linking only, no section contents */
-#define MH_DSYM 0xa /* companion file with only debug */
- /* sections */
-#define MH_KEXT_BUNDLE 0xb /* x86_64 kexts */
-
-/* Constants for the flags field of the mach_header */
-#define MH_NOUNDEFS 0x1 /* the object file has no undefined
- references */
-#define MH_INCRLINK 0x2 /* the object file is the output of an
- incremental link against a base file
- and can't be link edited again */
-#define MH_DYLDLINK 0x4 /* the object file is input for the
- dynamic linker and can't be staticly
- link edited again */
-#define MH_BINDATLOAD 0x8 /* the object file's undefined
- references are bound by the dynamic
- linker when loaded. */
-#define MH_PREBOUND 0x10 /* the file has its dynamic undefined
- references prebound. */
-#define MH_SPLIT_SEGS 0x20 /* the file has its read-only and
- read-write segments split */
-#define MH_LAZY_INIT 0x40 /* the shared library init routine is
- to be run lazily via catching memory
- faults to its writeable segments
- (obsolete) */
-#define MH_TWOLEVEL 0x80 /* the image is using two-level name
- space bindings */
-#define MH_FORCE_FLAT 0x100 /* the executable is forcing all images
- to use flat name space bindings */
-#define MH_NOMULTIDEFS 0x200 /* this umbrella guarantees no multiple
- defintions of symbols in its
- sub-images so the two-level namespace
- hints can always be used. */
-#define MH_NOFIXPREBINDING 0x400 /* do not have dyld notify the
- prebinding agent about this
- executable */
-#define MH_PREBINDABLE 0x800 /* the binary is not prebound but can
- have its prebinding redone. only used
- when MH_PREBOUND is not set. */
-#define MH_ALLMODSBOUND 0x1000 /* indicates that this binary binds to
- all two-level namespace modules of
- its dependent libraries. only used
- when MH_PREBINDABLE and MH_TWOLEVEL
- are both set. */
-#define MH_SUBSECTIONS_VIA_SYMBOLS 0x2000/* safe to divide up the sections into
- sub-sections via symbols for dead
- code stripping */
-#define MH_CANONICAL 0x4000 /* the binary has been canonicalized
- via the unprebind operation */
-#define MH_WEAK_DEFINES 0x8000 /* the final linked image contains
- external weak symbols */
-#define MH_BINDS_TO_WEAK 0x10000 /* the final linked image uses
- weak symbols */
-
-#define MH_ALLOW_STACK_EXECUTION 0x20000/* When this bit is set, all stacks
- in the task will be given stack
- execution privilege. Only used in
- MH_EXECUTE filetypes. */
-#define MH_ROOT_SAFE 0x40000 /* When this bit is set, the binary
- declares it is safe for use in
- processes with uid zero */
-
-#define MH_SETUID_SAFE 0x80000 /* When this bit is set, the binary
- declares it is safe for use in
- processes when issetugid() is true */
-
-#define MH_NO_REEXPORTED_DYLIBS 0x100000 /* When this bit is set on a dylib,
- the static linker does not need to
- examine dependent dylibs to see
- if any are re-exported */
-#define MH_PIE 0x200000 /* When this bit is set, the OS will
- load the main executable at a
- random address. Only used in
- MH_EXECUTE filetypes. */
-#define MH_DEAD_STRIPPABLE_DYLIB 0x400000 /* Only for use on dylibs. When
- linking against a dylib that
- has this bit set, the static linker
- will automatically not create a
- LC_LOAD_DYLIB load command to the
- dylib if no symbols are being
- referenced from the dylib. */
-#define MH_HAS_TLV_DESCRIPTORS 0x800000 /* Contains a section of type
- S_THREAD_LOCAL_VARIABLES */
-
-#define MH_NO_HEAP_EXECUTION 0x1000000 /* When this bit is set, the OS will
- run the main executable with
- a non-executable heap even on
- platforms (e.g. i386) that don't
- require it. Only used in MH_EXECUTE
- filetypes. */
-
-#define MH_APP_EXTENSION_SAFE 0x02000000 /* The code was linked for use in an
- application extension. */
-
-#define MH_NLIST_OUTOFSYNC_WITH_DYLDINFO 0x04000000 /* The external symbols
- listed in the nlist symbol table do
- not include all the symbols listed in
- the dyld info. */
-
-#define MH_SIM_SUPPORT 0x08000000 /* Allow LC_MIN_VERSION_MACOS and
- LC_BUILD_VERSION load commands with
- the platforms macOS, macCatalyst,
- iOSSimulator, tvOSSimulator and
- watchOSSimulator. */
-
-#define MH_DYLIB_IN_CACHE 0x80000000 /* Only for use on dylibs. When this bit
- is set, the dylib is part of the dyld
- shared cache, rather than loose in
- the filesystem. */
-
-/*
- * The load commands directly follow the mach_header. The total size of all
- * of the commands is given by the sizeofcmds field in the mach_header. All
- * load commands must have as their first two fields cmd and cmdsize. The cmd
- * field is filled in with a constant for that command type. Each command type
- * has a structure specifically for it. The cmdsize field is the size in bytes
- * of the particular load command structure plus anything that follows it that
- * is a part of the load command (i.e. section structures, strings, etc.). To
- * advance to the next load command the cmdsize can be added to the offset or
- * pointer of the current load command. The cmdsize for 32-bit architectures
- * MUST be a multiple of 4 bytes and for 64-bit architectures MUST be a multiple
- * of 8 bytes (these are forever the maximum alignment of any load commands).
- * The padded bytes must be zero. All tables in the object file must also
- * follow these rules so the file can be memory mapped. Otherwise the pointers
- * to these tables will not work well or at all on some machines. With all
- * padding zeroed like objects will compare byte for byte.
- */
-struct load_command {
- uint32_t cmd; /* type of load command */
- uint32_t cmdsize; /* total size of command in bytes */
-};
-
-/*
- * After MacOS X 10.1 when a new load command is added that is required to be
- * understood by the dynamic linker for the image to execute properly the
- * LC_REQ_DYLD bit will be or'ed into the load command constant. If the dynamic
- * linker sees such a load command it it does not understand will issue a
- * "unknown load command required for execution" error and refuse to use the
- * image. Other load commands without this bit that are not understood will
- * simply be ignored.
- */
-#define LC_REQ_DYLD 0x80000000
-
-/* Constants for the cmd field of all load commands, the type */
-#define LC_SEGMENT 0x1 /* segment of this file to be mapped */
-#define LC_SYMTAB 0x2 /* link-edit stab symbol table info */
-#define LC_SYMSEG 0x3 /* link-edit gdb symbol table info (obsolete) */
-#define LC_THREAD 0x4 /* thread */
-#define LC_UNIXTHREAD 0x5 /* unix thread (includes a stack) */
-#define LC_LOADFVMLIB 0x6 /* load a specified fixed VM shared library */
-#define LC_IDFVMLIB 0x7 /* fixed VM shared library identification */
-#define LC_IDENT 0x8 /* object identification info (obsolete) */
-#define LC_FVMFILE 0x9 /* fixed VM file inclusion (internal use) */
-#define LC_PREPAGE 0xa /* prepage command (internal use) */
-#define LC_DYSYMTAB 0xb /* dynamic link-edit symbol table info */
-#define LC_LOAD_DYLIB 0xc /* load a dynamically linked shared library */
-#define LC_ID_DYLIB 0xd /* dynamically linked shared lib ident */
-#define LC_LOAD_DYLINKER 0xe /* load a dynamic linker */
-#define LC_ID_DYLINKER 0xf /* dynamic linker identification */
-#define LC_PREBOUND_DYLIB 0x10 /* modules prebound for a dynamically */
- /* linked shared library */
-#define LC_ROUTINES 0x11 /* image routines */
-#define LC_SUB_FRAMEWORK 0x12 /* sub framework */
-#define LC_SUB_UMBRELLA 0x13 /* sub umbrella */
-#define LC_SUB_CLIENT 0x14 /* sub client */
-#define LC_SUB_LIBRARY 0x15 /* sub library */
-#define LC_TWOLEVEL_HINTS 0x16 /* two-level namespace lookup hints */
-#define LC_PREBIND_CKSUM 0x17 /* prebind checksum */
-
-/*
- * load a dynamically linked shared library that is allowed to be missing
- * (all symbols are weak imported).
- */
-#define LC_LOAD_WEAK_DYLIB (0x18 | LC_REQ_DYLD)
-
-#define LC_SEGMENT_64 0x19 /* 64-bit segment of this file to be
- mapped */
-#define LC_ROUTINES_64 0x1a /* 64-bit image routines */
-#define LC_UUID 0x1b /* the uuid */
-#define LC_RPATH (0x1c | LC_REQ_DYLD) /* runpath additions */
-#define LC_CODE_SIGNATURE 0x1d /* local of code signature */
-#define LC_SEGMENT_SPLIT_INFO 0x1e /* local of info to split segments */
-#define LC_REEXPORT_DYLIB (0x1f | LC_REQ_DYLD) /* load and re-export dylib */
-#define LC_LAZY_LOAD_DYLIB 0x20 /* delay load of dylib until first use */
-#define LC_ENCRYPTION_INFO 0x21 /* encrypted segment information */
-#define LC_DYLD_INFO 0x22 /* compressed dyld information */
-#define LC_DYLD_INFO_ONLY (0x22|LC_REQ_DYLD) /* compressed dyld information only */
-#define LC_LOAD_UPWARD_DYLIB (0x23 | LC_REQ_DYLD) /* load upward dylib */
-#define LC_VERSION_MIN_MACOSX 0x24 /* build for MacOSX min OS version */
-#define LC_VERSION_MIN_IPHONEOS 0x25 /* build for iPhoneOS min OS version */
-#define LC_FUNCTION_STARTS 0x26 /* compressed table of function start addresses */
-#define LC_DYLD_ENVIRONMENT 0x27 /* string for dyld to treat
- like environment variable */
-#define LC_MAIN (0x28|LC_REQ_DYLD) /* replacement for LC_UNIXTHREAD */
-#define LC_DATA_IN_CODE 0x29 /* table of non-instructions in __text */
-#define LC_SOURCE_VERSION 0x2A /* source version used to build binary */
-#define LC_DYLIB_CODE_SIGN_DRS 0x2B /* Code signing DRs copied from linked dylibs */
-#define LC_ENCRYPTION_INFO_64 0x2C /* 64-bit encrypted segment information */
-#define LC_LINKER_OPTION 0x2D /* linker options in MH_OBJECT files */
-#define LC_LINKER_OPTIMIZATION_HINT 0x2E /* optimization hints in MH_OBJECT files */
-#define LC_VERSION_MIN_TVOS 0x2F /* build for AppleTV min OS version */
-#define LC_VERSION_MIN_WATCHOS 0x30 /* build for Watch min OS version */
-#define LC_NOTE 0x31 /* arbitrary data included within a Mach-O file */
-#define LC_BUILD_VERSION 0x32 /* build for platform min OS version */
-#define LC_DYLD_EXPORTS_TRIE (0x33 | LC_REQ_DYLD) /* used with linkedit_data_command, payload is trie */
-#define LC_DYLD_CHAINED_FIXUPS (0x34 | LC_REQ_DYLD) /* used with linkedit_data_command */
-
-/*
- * A variable length string in a load command is represented by an lc_str
- * union. The strings are stored just after the load command structure and
- * the offset is from the start of the load command structure. The size
- * of the string is reflected in the cmdsize field of the load command.
- * Once again any padded bytes to bring the cmdsize field to a multiple
- * of 4 bytes must be zero.
- */
-union lc_str {
- uint32_t offset; /* offset to the string */
-#ifndef __LP64__
- char *ptr; /* pointer to the string */
-#endif
-};
-
-/*
- * The segment load command indicates that a part of this file is to be
- * mapped into the task's address space. The size of this segment in memory,
- * vmsize, maybe equal to or larger than the amount to map from this file,
- * filesize. The file is mapped starting at fileoff to the beginning of
- * the segment in memory, vmaddr. The rest of the memory of the segment,
- * if any, is allocated zero fill on demand. The segment's maximum virtual
- * memory protection and initial virtual memory protection are specified
- * by the maxprot and initprot fields. If the segment has sections then the
- * section structures directly follow the segment command and their size is
- * reflected in cmdsize.
- */
-struct segment_command { /* for 32-bit architectures */
- uint32_t cmd; /* LC_SEGMENT */
- uint32_t cmdsize; /* includes sizeof section structs */
- char segname[16]; /* segment name */
- uint32_t vmaddr; /* memory address of this segment */
- uint32_t vmsize; /* memory size of this segment */
- uint32_t fileoff; /* file offset of this segment */
- uint32_t filesize; /* amount to map from the file */
- vm_prot_t maxprot; /* maximum VM protection */
- vm_prot_t initprot; /* initial VM protection */
- uint32_t nsects; /* number of sections in segment */
- uint32_t flags; /* flags */
-};
-
-/*
- * The 64-bit segment load command indicates that a part of this file is to be
- * mapped into a 64-bit task's address space. If the 64-bit segment has
- * sections then section_64 structures directly follow the 64-bit segment
- * command and their size is reflected in cmdsize.
- */
-struct segment_command_64 { /* for 64-bit architectures */
- uint32_t cmd; /* LC_SEGMENT_64 */
- uint32_t cmdsize; /* includes sizeof section_64 structs */
- char segname[16]; /* segment name */
- uint64_t vmaddr; /* memory address of this segment */
- uint64_t vmsize; /* memory size of this segment */
- uint64_t fileoff; /* file offset of this segment */
- uint64_t filesize; /* amount to map from the file */
- vm_prot_t maxprot; /* maximum VM protection */
- vm_prot_t initprot; /* initial VM protection */
- uint32_t nsects; /* number of sections in segment */
- uint32_t flags; /* flags */
-};
-
-/* Constants for the flags field of the segment_command */
-#define SG_HIGHVM 0x1 /* the file contents for this segment is for
- the high part of the VM space, the low part
- is zero filled (for stacks in core files) */
-#define SG_FVMLIB 0x2 /* this segment is the VM that is allocated by
- a fixed VM library, for overlap checking in
- the link editor */
-#define SG_NORELOC 0x4 /* this segment has nothing that was relocated
- in it and nothing relocated to it, that is
- it maybe safely replaced without relocation*/
-#define SG_PROTECTED_VERSION_1 0x8 /* This segment is protected. If the
- segment starts at file offset 0, the
- first page of the segment is not
- protected. All other pages of the
- segment are protected. */
-#define SG_READ_ONLY 0x10 /* This segment is made read-only after fixups */
-
-
-
-/*
- * A segment is made up of zero or more sections. Non-MH_OBJECT files have
- * all of their segments with the proper sections in each, and padded to the
- * specified segment alignment when produced by the link editor. The first
- * segment of a MH_EXECUTE and MH_FVMLIB format file contains the mach_header
- * and load commands of the object file before its first section. The zero
- * fill sections are always last in their segment (in all formats). This
- * allows the zeroed segment padding to be mapped into memory where zero fill
- * sections might be. The gigabyte zero fill sections, those with the section
- * type S_GB_ZEROFILL, can only be in a segment with sections of this type.
- * These segments are then placed after all other segments.
- *
- * The MH_OBJECT format has all of its sections in one segment for
- * compactness. There is no padding to a specified segment boundary and the
- * mach_header and load commands are not part of the segment.
- *
- * Sections with the same section name, sectname, going into the same segment,
- * segname, are combined by the link editor. The resulting section is aligned
- * to the maximum alignment of the combined sections and is the new section's
- * alignment. The combined sections are aligned to their original alignment in
- * the combined section. Any padded bytes to get the specified alignment are
- * zeroed.
- *
- * The format of the relocation entries referenced by the reloff and nreloc
- * fields of the section structure for mach object files is described in the
- * header file .
- */
-struct section { /* for 32-bit architectures */
- char sectname[16]; /* name of this section */
- char segname[16]; /* segment this section goes in */
- uint32_t addr; /* memory address of this section */
- uint32_t size; /* size in bytes of this section */
- uint32_t offset; /* file offset of this section */
- uint32_t align; /* section alignment (power of 2) */
- uint32_t reloff; /* file offset of relocation entries */
- uint32_t nreloc; /* number of relocation entries */
- uint32_t flags; /* flags (section type and attributes)*/
- uint32_t reserved1; /* reserved (for offset or index) */
- uint32_t reserved2; /* reserved (for count or sizeof) */
-};
-
-struct section_64 { /* for 64-bit architectures */
- char sectname[16]; /* name of this section */
- char segname[16]; /* segment this section goes in */
- uint64_t addr; /* memory address of this section */
- uint64_t size; /* size in bytes of this section */
- uint32_t offset; /* file offset of this section */
- uint32_t align; /* section alignment (power of 2) */
- uint32_t reloff; /* file offset of relocation entries */
- uint32_t nreloc; /* number of relocation entries */
- uint32_t flags; /* flags (section type and attributes)*/
- uint32_t reserved1; /* reserved (for offset or index) */
- uint32_t reserved2; /* reserved (for count or sizeof) */
- uint32_t reserved3; /* reserved */
-};
-
-/*
- * The flags field of a section structure is separated into two parts a section
- * type and section attributes. The section types are mutually exclusive (it
- * can only have one type) but the section attributes are not (it may have more
- * than one attribute).
- */
-#define SECTION_TYPE 0x000000ff /* 256 section types */
-#define SECTION_ATTRIBUTES 0xffffff00 /* 24 section attributes */
-
-/* Constants for the type of a section */
-#define S_REGULAR 0x0 /* regular section */
-#define S_ZEROFILL 0x1 /* zero fill on demand section */
-#define S_CSTRING_LITERALS 0x2 /* section with only literal C strings*/
-#define S_4BYTE_LITERALS 0x3 /* section with only 4 byte literals */
-#define S_8BYTE_LITERALS 0x4 /* section with only 8 byte literals */
-#define S_LITERAL_POINTERS 0x5 /* section with only pointers to */
- /* literals */
-/*
- * For the two types of symbol pointers sections and the symbol stubs section
- * they have indirect symbol table entries. For each of the entries in the
- * section the indirect symbol table entries, in corresponding order in the
- * indirect symbol table, start at the index stored in the reserved1 field
- * of the section structure. Since the indirect symbol table entries
- * correspond to the entries in the section the number of indirect symbol table
- * entries is inferred from the size of the section divided by the size of the
- * entries in the section. For symbol pointers sections the size of the entries
- * in the section is 4 bytes and for symbol stubs sections the byte size of the
- * stubs is stored in the reserved2 field of the section structure.
- */
-#define S_NON_LAZY_SYMBOL_POINTERS 0x6 /* section with only non-lazy
- symbol pointers */
-#define S_LAZY_SYMBOL_POINTERS 0x7 /* section with only lazy symbol
- pointers */
-#define S_SYMBOL_STUBS 0x8 /* section with only symbol
- stubs, byte size of stub in
- the reserved2 field */
-#define S_MOD_INIT_FUNC_POINTERS 0x9 /* section with only function
- pointers for initialization*/
-#define S_MOD_TERM_FUNC_POINTERS 0xa /* section with only function
- pointers for termination */
-#define S_COALESCED 0xb /* section contains symbols that
- are to be coalesced */
-#define S_GB_ZEROFILL 0xc /* zero fill on demand section
- (that can be larger than 4
- gigabytes) */
-#define S_INTERPOSING 0xd /* section with only pairs of
- function pointers for
- interposing */
-#define S_16BYTE_LITERALS 0xe /* section with only 16 byte
- literals */
-#define S_DTRACE_DOF 0xf /* section contains
- DTrace Object Format */
-#define S_LAZY_DYLIB_SYMBOL_POINTERS 0x10 /* section with only lazy
- symbol pointers to lazy
- loaded dylibs */
-/*
- * Section types to support thread local variables
- */
-#define S_THREAD_LOCAL_REGULAR 0x11 /* template of initial
- values for TLVs */
-#define S_THREAD_LOCAL_ZEROFILL 0x12 /* template of initial
- values for TLVs */
-#define S_THREAD_LOCAL_VARIABLES 0x13 /* TLV descriptors */
-#define S_THREAD_LOCAL_VARIABLE_POINTERS 0x14 /* pointers to TLV
- descriptors */
-#define S_THREAD_LOCAL_INIT_FUNCTION_POINTERS 0x15 /* functions to call
- to initialize TLV
- values */
-#define S_INIT_FUNC_OFFSETS 0x16 /* 32-bit offsets to
- initializers */
-
-/*
- * Constants for the section attributes part of the flags field of a section
- * structure.
- */
-#define SECTION_ATTRIBUTES_USR 0xff000000 /* User setable attributes */
-#define S_ATTR_PURE_INSTRUCTIONS 0x80000000 /* section contains only true
- machine instructions */
-#define S_ATTR_NO_TOC 0x40000000 /* section contains coalesced
- symbols that are not to be
- in a ranlib table of
- contents */
-#define S_ATTR_STRIP_STATIC_SYMS 0x20000000 /* ok to strip static symbols
- in this section in files
- with the MH_DYLDLINK flag */
-#define S_ATTR_NO_DEAD_STRIP 0x10000000 /* no dead stripping */
-#define S_ATTR_LIVE_SUPPORT 0x08000000 /* blocks are live if they
- reference live blocks */
-#define S_ATTR_SELF_MODIFYING_CODE 0x04000000 /* Used with i386 code stubs
- written on by dyld */
-/*
- * If a segment contains any sections marked with S_ATTR_DEBUG then all
- * sections in that segment must have this attribute. No section other than
- * a section marked with this attribute may reference the contents of this
- * section. A section with this attribute may contain no symbols and must have
- * a section type S_REGULAR. The static linker will not copy section contents
- * from sections with this attribute into its output file. These sections
- * generally contain DWARF debugging info.
- */
-#define S_ATTR_DEBUG 0x02000000 /* a debug section */
-#define SECTION_ATTRIBUTES_SYS 0x00ffff00 /* system setable attributes */
-#define S_ATTR_SOME_INSTRUCTIONS 0x00000400 /* section contains some
- machine instructions */
-#define S_ATTR_EXT_RELOC 0x00000200 /* section has external
- relocation entries */
-#define S_ATTR_LOC_RELOC 0x00000100 /* section has local
- relocation entries */
-
-
-/*
- * The names of segments and sections in them are mostly meaningless to the
- * link-editor. But there are few things to support traditional UNIX
- * executables that require the link-editor and assembler to use some names
- * agreed upon by convention.
- *
- * The initial protection of the "__TEXT" segment has write protection turned
- * off (not writeable).
- *
- * The link-editor will allocate common symbols at the end of the "__common"
- * section in the "__DATA" segment. It will create the section and segment
- * if needed.
- */
-
-/* The currently known segment names and the section names in those segments */
-
-#define SEG_PAGEZERO "__PAGEZERO" /* the pagezero segment which has no */
- /* protections and catches NULL */
- /* references for MH_EXECUTE files */
-
-
-#define SEG_TEXT "__TEXT" /* the tradition UNIX text segment */
-#define SECT_TEXT "__text" /* the real text part of the text */
- /* section no headers, and no padding */
-#define SECT_FVMLIB_INIT0 "__fvmlib_init0" /* the fvmlib initialization */
- /* section */
-#define SECT_FVMLIB_INIT1 "__fvmlib_init1" /* the section following the */
- /* fvmlib initialization */
- /* section */
-
-#define SEG_DATA "__DATA" /* the tradition UNIX data segment */
-#define SECT_DATA "__data" /* the real initialized data section */
- /* no padding, no bss overlap */
-#define SECT_BSS "__bss" /* the real uninitialized data section*/
- /* no padding */
-#define SECT_COMMON "__common" /* the section common symbols are */
- /* allocated in by the link editor */
-
-#define SEG_OBJC "__OBJC" /* objective-C runtime segment */
-#define SECT_OBJC_SYMBOLS "__symbol_table" /* symbol table */
-#define SECT_OBJC_MODULES "__module_info" /* module information */
-#define SECT_OBJC_STRINGS "__selector_strs" /* string table */
-#define SECT_OBJC_REFS "__selector_refs" /* string table */
-
-#define SEG_ICON "__ICON" /* the icon segment */
-#define SECT_ICON_HEADER "__header" /* the icon headers */
-#define SECT_ICON_TIFF "__tiff" /* the icons in tiff format */
-
-#define SEG_LINKEDIT "__LINKEDIT" /* the segment containing all structs */
- /* created and maintained by the link */
- /* editor. Created with -seglinkedit */
- /* option to ld(1) for MH_EXECUTE and */
- /* FVMLIB file types only */
-
-#define SEG_UNIXSTACK "__UNIXSTACK" /* the unix stack segment */
-
-#define SEG_IMPORT "__IMPORT" /* the segment for the self (dyld) */
- /* modifing code stubs that has read, */
- /* write and execute permissions */
-
-/*
- * Fixed virtual memory shared libraries are identified by two things. The
- * target pathname (the name of the library as found for execution), and the
- * minor version number. The address of where the headers are loaded is in
- * header_addr. (THIS IS OBSOLETE and no longer supported).
- */
-struct fvmlib {
- union lc_str name; /* library's target pathname */
- uint32_t minor_version; /* library's minor version number */
- uint32_t header_addr; /* library's header address */
-};
-
-/*
- * A fixed virtual shared library (filetype == MH_FVMLIB in the mach header)
- * contains a fvmlib_command (cmd == LC_IDFVMLIB) to identify the library.
- * An object that uses a fixed virtual shared library also contains a
- * fvmlib_command (cmd == LC_LOADFVMLIB) for each library it uses.
- * (THIS IS OBSOLETE and no longer supported).
- */
-struct fvmlib_command {
- uint32_t cmd; /* LC_IDFVMLIB or LC_LOADFVMLIB */
- uint32_t cmdsize; /* includes pathname string */
- struct fvmlib fvmlib; /* the library identification */
-};
-
-/*
- * Dynamicly linked shared libraries are identified by two things. The
- * pathname (the name of the library as found for execution), and the
- * compatibility version number. The pathname must match and the compatibility
- * number in the user of the library must be greater than or equal to the
- * library being used. The time stamp is used to record the time a library was
- * built and copied into user so it can be use to determined if the library used
- * at runtime is exactly the same as used to built the program.
- */
-struct dylib {
- union lc_str name; /* library's path name */
- uint32_t timestamp; /* library's build time stamp */
- uint32_t current_version; /* library's current version number */
- uint32_t compatibility_version; /* library's compatibility vers number*/
-};
-
-/*
- * A dynamically linked shared library (filetype == MH_DYLIB in the mach header)
- * contains a dylib_command (cmd == LC_ID_DYLIB) to identify the library.
- * An object that uses a dynamically linked shared library also contains a
- * dylib_command (cmd == LC_LOAD_DYLIB, LC_LOAD_WEAK_DYLIB, or
- * LC_REEXPORT_DYLIB) for each library it uses.
- */
-struct dylib_command {
- uint32_t cmd; /* LC_ID_DYLIB, LC_LOAD_{,WEAK_}DYLIB,
- LC_REEXPORT_DYLIB */
- uint32_t cmdsize; /* includes pathname string */
- struct dylib dylib; /* the library identification */
-};
-
-/*
- * A dynamically linked shared library may be a subframework of an umbrella
- * framework. If so it will be linked with "-umbrella umbrella_name" where
- * Where "umbrella_name" is the name of the umbrella framework. A subframework
- * can only be linked against by its umbrella framework or other subframeworks
- * that are part of the same umbrella framework. Otherwise the static link
- * editor produces an error and states to link against the umbrella framework.
- * The name of the umbrella framework for subframeworks is recorded in the
- * following structure.
- */
-struct sub_framework_command {
- uint32_t cmd; /* LC_SUB_FRAMEWORK */
- uint32_t cmdsize; /* includes umbrella string */
- union lc_str umbrella; /* the umbrella framework name */
-};
-
-/*
- * For dynamically linked shared libraries that are subframework of an umbrella
- * framework they can allow clients other than the umbrella framework or other
- * subframeworks in the same umbrella framework. To do this the subframework
- * is built with "-allowable_client client_name" and an LC_SUB_CLIENT load
- * command is created for each -allowable_client flag. The client_name is
- * usually a framework name. It can also be a name used for bundles clients
- * where the bundle is built with "-client_name client_name".
- */
-struct sub_client_command {
- uint32_t cmd; /* LC_SUB_CLIENT */
- uint32_t cmdsize; /* includes client string */
- union lc_str client; /* the client name */
-};
-
-/*
- * A dynamically linked shared library may be a sub_umbrella of an umbrella
- * framework. If so it will be linked with "-sub_umbrella umbrella_name" where
- * Where "umbrella_name" is the name of the sub_umbrella framework. When
- * staticly linking when -twolevel_namespace is in effect a twolevel namespace
- * umbrella framework will only cause its subframeworks and those frameworks
- * listed as sub_umbrella frameworks to be implicited linked in. Any other
- * dependent dynamic libraries will not be linked it when -twolevel_namespace
- * is in effect. The primary library recorded by the static linker when
- * resolving a symbol in these libraries will be the umbrella framework.
- * Zero or more sub_umbrella frameworks may be use by an umbrella framework.
- * The name of a sub_umbrella framework is recorded in the following structure.
- */
-struct sub_umbrella_command {
- uint32_t cmd; /* LC_SUB_UMBRELLA */
- uint32_t cmdsize; /* includes sub_umbrella string */
- union lc_str sub_umbrella; /* the sub_umbrella framework name */
-};
-
-/*
- * A dynamically linked shared library may be a sub_library of another shared
- * library. If so it will be linked with "-sub_library library_name" where
- * Where "library_name" is the name of the sub_library shared library. When
- * staticly linking when -twolevel_namespace is in effect a twolevel namespace
- * shared library will only cause its subframeworks and those frameworks
- * listed as sub_umbrella frameworks and libraries listed as sub_libraries to
- * be implicited linked in. Any other dependent dynamic libraries will not be
- * linked it when -twolevel_namespace is in effect. The primary library
- * recorded by the static linker when resolving a symbol in these libraries
- * will be the umbrella framework (or dynamic library). Zero or more sub_library
- * shared libraries may be use by an umbrella framework or (or dynamic library).
- * The name of a sub_library framework is recorded in the following structure.
- * For example /usr/lib/libobjc_profile.A.dylib would be recorded as "libobjc".
- */
-struct sub_library_command {
- uint32_t cmd; /* LC_SUB_LIBRARY */
- uint32_t cmdsize; /* includes sub_library string */
- union lc_str sub_library; /* the sub_library name */
-};
-
-/*
- * A program (filetype == MH_EXECUTE) that is
- * prebound to its dynamic libraries has one of these for each library that
- * the static linker used in prebinding. It contains a bit vector for the
- * modules in the library. The bits indicate which modules are bound (1) and
- * which are not (0) from the library. The bit for module 0 is the low bit
- * of the first byte. So the bit for the Nth module is:
- * (linked_modules[N/8] >> N%8) & 1
- */
-struct prebound_dylib_command {
- uint32_t cmd; /* LC_PREBOUND_DYLIB */
- uint32_t cmdsize; /* includes strings */
- union lc_str name; /* library's path name */
- uint32_t nmodules; /* number of modules in library */
- union lc_str linked_modules; /* bit vector of linked modules */
-};
-
-/*
- * A program that uses a dynamic linker contains a dylinker_command to identify
- * the name of the dynamic linker (LC_LOAD_DYLINKER). And a dynamic linker
- * contains a dylinker_command to identify the dynamic linker (LC_ID_DYLINKER).
- * A file can have at most one of these.
- * This struct is also used for the LC_DYLD_ENVIRONMENT load command and
- * contains string for dyld to treat like environment variable.
- */
-struct dylinker_command {
- uint32_t cmd; /* LC_ID_DYLINKER, LC_LOAD_DYLINKER or
- LC_DYLD_ENVIRONMENT */
- uint32_t cmdsize; /* includes pathname string */
- union lc_str name; /* dynamic linker's path name */
-};
-
-/*
- * Thread commands contain machine-specific data structures suitable for
- * use in the thread state primitives. The machine specific data structures
- * follow the struct thread_command as follows.
- * Each flavor of machine specific data structure is preceded by an uint32_t
- * constant for the flavor of that data structure, an uint32_t that is the
- * count of uint32_t's of the size of the state data structure and then
- * the state data structure follows. This triple may be repeated for many
- * flavors. The constants for the flavors, counts and state data structure
- * definitions are expected to be in the header file .
- * These machine specific data structures sizes must be multiples of
- * 4 bytes. The cmdsize reflects the total size of the thread_command
- * and all of the sizes of the constants for the flavors, counts and state
- * data structures.
- *
- * For executable objects that are unix processes there will be one
- * thread_command (cmd == LC_UNIXTHREAD) created for it by the link-editor.
- * This is the same as a LC_THREAD, except that a stack is automatically
- * created (based on the shell's limit for the stack size). Command arguments
- * and environment variables are copied onto that stack.
- */
-struct thread_command {
- uint32_t cmd; /* LC_THREAD or LC_UNIXTHREAD */
- uint32_t cmdsize; /* total size of this command */
- /* uint32_t flavor flavor of thread state */
- /* uint32_t count count of uint32_t's in thread state */
- /* struct XXX_thread_state state thread state for this flavor */
- /* ... */
-};
-
-/*
- * The routines command contains the address of the dynamic shared library
- * initialization routine and an index into the module table for the module
- * that defines the routine. Before any modules are used from the library the
- * dynamic linker fully binds the module that defines the initialization routine
- * and then calls it. This gets called before any module initialization
- * routines (used for C++ static constructors) in the library.
- */
-struct routines_command { /* for 32-bit architectures */
- uint32_t cmd; /* LC_ROUTINES */
- uint32_t cmdsize; /* total size of this command */
- uint32_t init_address; /* address of initialization routine */
- uint32_t init_module; /* index into the module table that */
- /* the init routine is defined in */
- uint32_t reserved1;
- uint32_t reserved2;
- uint32_t reserved3;
- uint32_t reserved4;
- uint32_t reserved5;
- uint32_t reserved6;
-};
-
-/*
- * The 64-bit routines command. Same use as above.
- */
-struct routines_command_64 { /* for 64-bit architectures */
- uint32_t cmd; /* LC_ROUTINES_64 */
- uint32_t cmdsize; /* total size of this command */
- uint64_t init_address; /* address of initialization routine */
- uint64_t init_module; /* index into the module table that */
- /* the init routine is defined in */
- uint64_t reserved1;
- uint64_t reserved2;
- uint64_t reserved3;
- uint64_t reserved4;
- uint64_t reserved5;
- uint64_t reserved6;
-};
-
-/*
- * The symtab_command contains the offsets and sizes of the link-edit 4.3BSD
- * "stab" style symbol table information as described in the header files
- * and .
- */
-struct symtab_command {
- uint32_t cmd; /* LC_SYMTAB */
- uint32_t cmdsize; /* sizeof(struct symtab_command) */
- uint32_t symoff; /* symbol table offset */
- uint32_t nsyms; /* number of symbol table entries */
- uint32_t stroff; /* string table offset */
- uint32_t strsize; /* string table size in bytes */
-};
-
-/*
- * This is the second set of the symbolic information which is used to support
- * the data structures for the dynamically link editor.
- *
- * The original set of symbolic information in the symtab_command which contains
- * the symbol and string tables must also be present when this load command is
- * present. When this load command is present the symbol table is organized
- * into three groups of symbols:
- * local symbols (static and debugging symbols) - grouped by module
- * defined external symbols - grouped by module (sorted by name if not lib)
- * undefined external symbols (sorted by name if MH_BINDATLOAD is not set,
- * and in order the were seen by the static
- * linker if MH_BINDATLOAD is set)
- * In this load command there are offsets and counts to each of the three groups
- * of symbols.
- *
- * This load command contains a the offsets and sizes of the following new
- * symbolic information tables:
- * table of contents
- * module table
- * reference symbol table
- * indirect symbol table
- * The first three tables above (the table of contents, module table and
- * reference symbol table) are only present if the file is a dynamically linked
- * shared library. For executable and object modules, which are files
- * containing only one module, the information that would be in these three
- * tables is determined as follows:
- * table of contents - the defined external symbols are sorted by name
- * module table - the file contains only one module so everything in the
- * file is part of the module.
- * reference symbol table - is the defined and undefined external symbols
- *
- * For dynamically linked shared library files this load command also contains
- * offsets and sizes to the pool of relocation entries for all sections
- * separated into two groups:
- * external relocation entries
- * local relocation entries
- * For executable and object modules the relocation entries continue to hang
- * off the section structures.
- */
-struct dysymtab_command {
- uint32_t cmd; /* LC_DYSYMTAB */
- uint32_t cmdsize; /* sizeof(struct dysymtab_command) */
-
- /*
- * The symbols indicated by symoff and nsyms of the LC_SYMTAB load command
- * are grouped into the following three groups:
- * local symbols (further grouped by the module they are from)
- * defined external symbols (further grouped by the module they are from)
- * undefined symbols
- *
- * The local symbols are used only for debugging. The dynamic binding
- * process may have to use them to indicate to the debugger the local
- * symbols for a module that is being bound.
- *
- * The last two groups are used by the dynamic binding process to do the
- * binding (indirectly through the module table and the reference symbol
- * table when this is a dynamically linked shared library file).
- */
- uint32_t ilocalsym; /* index to local symbols */
- uint32_t nlocalsym; /* number of local symbols */
-
- uint32_t iextdefsym;/* index to externally defined symbols */
- uint32_t nextdefsym;/* number of externally defined symbols */
-
- uint32_t iundefsym; /* index to undefined symbols */
- uint32_t nundefsym; /* number of undefined symbols */
-
- /*
- * For the for the dynamic binding process to find which module a symbol
- * is defined in the table of contents is used (analogous to the ranlib
- * structure in an archive) which maps defined external symbols to modules
- * they are defined in. This exists only in a dynamically linked shared
- * library file. For executable and object modules the defined external
- * symbols are sorted by name and is use as the table of contents.
- */
- uint32_t tocoff; /* file offset to table of contents */
- uint32_t ntoc; /* number of entries in table of contents */
-
- /*
- * To support dynamic binding of "modules" (whole object files) the symbol
- * table must reflect the modules that the file was created from. This is
- * done by having a module table that has indexes and counts into the merged
- * tables for each module. The module structure that these two entries
- * refer to is described below. This exists only in a dynamically linked
- * shared library file. For executable and object modules the file only
- * contains one module so everything in the file belongs to the module.
- */
- uint32_t modtaboff; /* file offset to module table */
- uint32_t nmodtab; /* number of module table entries */
-
- /*
- * To support dynamic module binding the module structure for each module
- * indicates the external references (defined and undefined) each module
- * makes. For each module there is an offset and a count into the
- * reference symbol table for the symbols that the module references.
- * This exists only in a dynamically linked shared library file. For
- * executable and object modules the defined external symbols and the
- * undefined external symbols indicates the external references.
- */
- uint32_t extrefsymoff; /* offset to referenced symbol table */
- uint32_t nextrefsyms; /* number of referenced symbol table entries */
-
- /*
- * The sections that contain "symbol pointers" and "routine stubs" have
- * indexes and (implied counts based on the size of the section and fixed
- * size of the entry) into the "indirect symbol" table for each pointer
- * and stub. For every section of these two types the index into the
- * indirect symbol table is stored in the section header in the field
- * reserved1. An indirect symbol table entry is simply a 32bit index into
- * the symbol table to the symbol that the pointer or stub is referring to.
- * The indirect symbol table is ordered to match the entries in the section.
- */
- uint32_t indirectsymoff; /* file offset to the indirect symbol table */
- uint32_t nindirectsyms; /* number of indirect symbol table entries */
-
- /*
- * To support relocating an individual module in a library file quickly the
- * external relocation entries for each module in the library need to be
- * accessed efficiently. Since the relocation entries can't be accessed
- * through the section headers for a library file they are separated into
- * groups of local and external entries further grouped by module. In this
- * case the presents of this load command who's extreloff, nextrel,
- * locreloff and nlocrel fields are non-zero indicates that the relocation
- * entries of non-merged sections are not referenced through the section
- * structures (and the reloff and nreloc fields in the section headers are
- * set to zero).
- *
- * Since the relocation entries are not accessed through the section headers
- * this requires the r_address field to be something other than a section
- * offset to identify the item to be relocated. In this case r_address is
- * set to the offset from the vmaddr of the first LC_SEGMENT command.
- * For MH_SPLIT_SEGS images r_address is set to the the offset from the
- * vmaddr of the first read-write LC_SEGMENT command.
- *
- * The relocation entries are grouped by module and the module table
- * entries have indexes and counts into them for the group of external
- * relocation entries for that the module.
- *
- * For sections that are merged across modules there must not be any
- * remaining external relocation entries for them (for merged sections
- * remaining relocation entries must be local).
- */
- uint32_t extreloff; /* offset to external relocation entries */
- uint32_t nextrel; /* number of external relocation entries */
-
- /*
- * All the local relocation entries are grouped together (they are not
- * grouped by their module since they are only used if the object is moved
- * from it staticly link edited address).
- */
- uint32_t locreloff; /* offset to local relocation entries */
- uint32_t nlocrel; /* number of local relocation entries */
-
-};
-
-/*
- * An indirect symbol table entry is simply a 32bit index into the symbol table
- * to the symbol that the pointer or stub is refering to. Unless it is for a
- * non-lazy symbol pointer section for a defined symbol which strip(1) as
- * removed. In which case it has the value INDIRECT_SYMBOL_LOCAL. If the
- * symbol was also absolute INDIRECT_SYMBOL_ABS is or'ed with that.
- */
-#define INDIRECT_SYMBOL_LOCAL 0x80000000
-#define INDIRECT_SYMBOL_ABS 0x40000000
-
-
-/* a table of contents entry */
-struct dylib_table_of_contents {
- uint32_t symbol_index; /* the defined external symbol
- (index into the symbol table) */
- uint32_t module_index; /* index into the module table this symbol
- is defined in */
-};
-
-/* a module table entry */
-struct dylib_module {
- uint32_t module_name; /* the module name (index into string table) */
-
- uint32_t iextdefsym; /* index into externally defined symbols */
- uint32_t nextdefsym; /* number of externally defined symbols */
- uint32_t irefsym; /* index into reference symbol table */
- uint32_t nrefsym; /* number of reference symbol table entries */
- uint32_t ilocalsym; /* index into symbols for local symbols */
- uint32_t nlocalsym; /* number of local symbols */
-
- uint32_t iextrel; /* index into external relocation entries */
- uint32_t nextrel; /* number of external relocation entries */
-
- uint32_t iinit_iterm; /* low 16 bits are the index into the init
- section, high 16 bits are the index into
- the term section */
- uint32_t ninit_nterm; /* low 16 bits are the number of init section
- entries, high 16 bits are the number of
- term section entries */
-
- uint32_t /* for this module address of the start of */
- objc_module_info_addr; /* the (__OBJC,__module_info) section */
- uint32_t /* for this module size of */
- objc_module_info_size; /* the (__OBJC,__module_info) section */
-};
-
-/* a 64-bit module table entry */
-struct dylib_module_64 {
- uint32_t module_name; /* the module name (index into string table) */
-
- uint32_t iextdefsym; /* index into externally defined symbols */
- uint32_t nextdefsym; /* number of externally defined symbols */
- uint32_t irefsym; /* index into reference symbol table */
- uint32_t nrefsym; /* number of reference symbol table entries */
- uint32_t ilocalsym; /* index into symbols for local symbols */
- uint32_t nlocalsym; /* number of local symbols */
-
- uint32_t iextrel; /* index into external relocation entries */
- uint32_t nextrel; /* number of external relocation entries */
-
- uint32_t iinit_iterm; /* low 16 bits are the index into the init
- section, high 16 bits are the index into
- the term section */
- uint32_t ninit_nterm; /* low 16 bits are the number of init section
- entries, high 16 bits are the number of
- term section entries */
-
- uint32_t /* for this module size of */
- objc_module_info_size; /* the (__OBJC,__module_info) section */
- uint64_t /* for this module address of the start of */
- objc_module_info_addr; /* the (__OBJC,__module_info) section */
-};
-
-/*
- * The entries in the reference symbol table are used when loading the module
- * (both by the static and dynamic link editors) and if the module is unloaded
- * or replaced. Therefore all external symbols (defined and undefined) are
- * listed in the module's reference table. The flags describe the type of
- * reference that is being made. The constants for the flags are defined in
- * as they are also used for symbol table entries.
- */
-struct dylib_reference {
- uint32_t isym:24, /* index into the symbol table */
- flags:8; /* flags to indicate the type of reference */
-};
-
-/*
- * The twolevel_hints_command contains the offset and number of hints in the
- * two-level namespace lookup hints table.
- */
-struct twolevel_hints_command {
- uint32_t cmd; /* LC_TWOLEVEL_HINTS */
- uint32_t cmdsize; /* sizeof(struct twolevel_hints_command) */
- uint32_t offset; /* offset to the hint table */
- uint32_t nhints; /* number of hints in the hint table */
-};
-
-/*
- * The entries in the two-level namespace lookup hints table are twolevel_hint
- * structs. These provide hints to the dynamic link editor where to start
- * looking for an undefined symbol in a two-level namespace image. The
- * isub_image field is an index into the sub-images (sub-frameworks and
- * sub-umbrellas list) that made up the two-level image that the undefined
- * symbol was found in when it was built by the static link editor. If
- * isub-image is 0 the the symbol is expected to be defined in library and not
- * in the sub-images. If isub-image is non-zero it is an index into the array
- * of sub-images for the umbrella with the first index in the sub-images being
- * 1. The array of sub-images is the ordered list of sub-images of the umbrella
- * that would be searched for a symbol that has the umbrella recorded as its
- * primary library. The table of contents index is an index into the
- * library's table of contents. This is used as the starting point of the
- * binary search or a directed linear search.
- */
-struct twolevel_hint {
- uint32_t
- isub_image:8, /* index into the sub images */
- itoc:24; /* index into the table of contents */
-};
-
-/*
- * The prebind_cksum_command contains the value of the original check sum for
- * prebound files or zero. When a prebound file is first created or modified
- * for other than updating its prebinding information the value of the check sum
- * is set to zero. When the file has it prebinding re-done and if the value of
- * the check sum is zero the original check sum is calculated and stored in
- * cksum field of this load command in the output file. If when the prebinding
- * is re-done and the cksum field is non-zero it is left unchanged from the
- * input file.
- */
-struct prebind_cksum_command {
- uint32_t cmd; /* LC_PREBIND_CKSUM */
- uint32_t cmdsize; /* sizeof(struct prebind_cksum_command) */
- uint32_t cksum; /* the check sum or zero */
-};
-
-/*
- * The uuid load command contains a single 128-bit unique random number that
- * identifies an object produced by the static link editor.
- */
-struct uuid_command {
- uint32_t cmd; /* LC_UUID */
- uint32_t cmdsize; /* sizeof(struct uuid_command) */
- uint8_t uuid[16]; /* the 128-bit uuid */
-};
-
-/*
- * The rpath_command contains a path which at runtime should be added to
- * the current run path used to find @rpath prefixed dylibs.
- */
-struct rpath_command {
- uint32_t cmd; /* LC_RPATH */
- uint32_t cmdsize; /* includes string */
- union lc_str path; /* path to add to run path */
-};
-
-/*
- * The linkedit_data_command contains the offsets and sizes of a blob
- * of data in the __LINKEDIT segment.
- */
-struct linkedit_data_command {
- uint32_t cmd; /* LC_CODE_SIGNATURE, LC_SEGMENT_SPLIT_INFO,
- LC_FUNCTION_STARTS, LC_DATA_IN_CODE,
- LC_DYLIB_CODE_SIGN_DRS,
- LC_LINKER_OPTIMIZATION_HINT,
- LC_DYLD_EXPORTS_TRIE, or
- LC_DYLD_CHAINED_FIXUPS. */
- uint32_t cmdsize; /* sizeof(struct linkedit_data_command) */
- uint32_t dataoff; /* file offset of data in __LINKEDIT segment */
- uint32_t datasize; /* file size of data in __LINKEDIT segment */
-};
-
-/*
- * The encryption_info_command contains the file offset and size of an
- * of an encrypted segment.
- */
-struct encryption_info_command {
- uint32_t cmd; /* LC_ENCRYPTION_INFO */
- uint32_t cmdsize; /* sizeof(struct encryption_info_command) */
- uint32_t cryptoff; /* file offset of encrypted range */
- uint32_t cryptsize; /* file size of encrypted range */
- uint32_t cryptid; /* which enryption system,
- 0 means not-encrypted yet */
-};
-
-/*
- * The encryption_info_command_64 contains the file offset and size of an
- * of an encrypted segment (for use in x86_64 targets).
- */
-struct encryption_info_command_64 {
- uint32_t cmd; /* LC_ENCRYPTION_INFO_64 */
- uint32_t cmdsize; /* sizeof(struct encryption_info_command_64) */
- uint32_t cryptoff; /* file offset of encrypted range */
- uint32_t cryptsize; /* file size of encrypted range */
- uint32_t cryptid; /* which enryption system,
- 0 means not-encrypted yet */
- uint32_t pad; /* padding to make this struct's size a multiple
- of 8 bytes */
-};
-
-/*
- * The version_min_command contains the min OS version on which this
- * binary was built to run.
- */
-struct version_min_command {
- uint32_t cmd; /* LC_VERSION_MIN_MACOSX or
- LC_VERSION_MIN_IPHONEOS or
- LC_VERSION_MIN_WATCHOS or
- LC_VERSION_MIN_TVOS */
- uint32_t cmdsize; /* sizeof(struct min_version_command) */
- uint32_t version; /* X.Y.Z is encoded in nibbles xxxx.yy.zz */
- uint32_t sdk; /* X.Y.Z is encoded in nibbles xxxx.yy.zz */
-};
-
-/*
- * The build_version_command contains the min OS version on which this
- * binary was built to run for its platform. The list of known platforms and
- * tool values following it.
- */
-struct build_version_command {
- uint32_t cmd; /* LC_BUILD_VERSION */
- uint32_t cmdsize; /* sizeof(struct build_version_command) plus */
- /* ntools * sizeof(struct build_tool_version) */
- uint32_t platform; /* platform */
- uint32_t minos; /* X.Y.Z is encoded in nibbles xxxx.yy.zz */
- uint32_t sdk; /* X.Y.Z is encoded in nibbles xxxx.yy.zz */
- uint32_t ntools; /* number of tool entries following this */
-};
-
-struct build_tool_version {
- uint32_t tool; /* enum for the tool */
- uint32_t version; /* version number of the tool */
-};
-
-/* Known values for the platform field above. */
-#define PLATFORM_MACOS 1
-#define PLATFORM_IOS 2
-#define PLATFORM_TVOS 3
-#define PLATFORM_WATCHOS 4
-#define PLATFORM_BRIDGEOS 5
-#define PLATFORM_MACCATALYST 6
-#if (!defined(PLATFORM_MACCATALYST))
-#define PLATFORM_MACCATALYST 6
-#endif
-#define PLATFORM_IOSSIMULATOR 7
-#define PLATFORM_TVOSSIMULATOR 8
-#define PLATFORM_WATCHOSSIMULATOR 9
-#define PLATFORM_DRIVERKIT 10
-
-/* Known values for the tool field above. */
-#define TOOL_CLANG 1
-#define TOOL_SWIFT 2
-#define TOOL_LD 3
-
-/*
- * The dyld_info_command contains the file offsets and sizes of
- * the new compressed form of the information dyld needs to
- * load the image. This information is used by dyld on Mac OS X
- * 10.6 and later. All information pointed to by this command
- * is encoded using byte streams, so no endian swapping is needed
- * to interpret it.
- */
-struct dyld_info_command {
- uint32_t cmd; /* LC_DYLD_INFO or LC_DYLD_INFO_ONLY */
- uint32_t cmdsize; /* sizeof(struct dyld_info_command) */
-
- /*
- * Dyld rebases an image whenever dyld loads it at an address different
- * from its preferred address. The rebase information is a stream
- * of byte sized opcodes whose symbolic names start with REBASE_OPCODE_.
- * Conceptually the rebase information is a table of tuples:
- *
- * The opcodes are a compressed way to encode the table by only
- * encoding when a column changes. In addition simple patterns
- * like "every n'th offset for m times" can be encoded in a few
- * bytes.
- */
- uint32_t rebase_off; /* file offset to rebase info */
- uint32_t rebase_size; /* size of rebase info */
-
- /*
- * Dyld binds an image during the loading process, if the image
- * requires any pointers to be initialized to symbols in other images.
- * The bind information is a stream of byte sized
- * opcodes whose symbolic names start with BIND_OPCODE_.
- * Conceptually the bind information is a table of tuples:
- *
- * The opcodes are a compressed way to encode the table by only
- * encoding when a column changes. In addition simple patterns
- * like for runs of pointers initialzed to the same value can be
- * encoded in a few bytes.
- */
- uint32_t bind_off; /* file offset to binding info */
- uint32_t bind_size; /* size of binding info */
-
- /*
- * Some C++ programs require dyld to unique symbols so that all
- * images in the process use the same copy of some code/data.
- * This step is done after binding. The content of the weak_bind
- * info is an opcode stream like the bind_info. But it is sorted
- * alphabetically by symbol name. This enable dyld to walk
- * all images with weak binding information in order and look
- * for collisions. If there are no collisions, dyld does
- * no updating. That means that some fixups are also encoded
- * in the bind_info. For instance, all calls to "operator new"
- * are first bound to libstdc++.dylib using the information
- * in bind_info. Then if some image overrides operator new
- * that is detected when the weak_bind information is processed
- * and the call to operator new is then rebound.
- */
- uint32_t weak_bind_off; /* file offset to weak binding info */
- uint32_t weak_bind_size; /* size of weak binding info */
-
- /*
- * Some uses of external symbols do not need to be bound immediately.
- * Instead they can be lazily bound on first use. The lazy_bind
- * are contains a stream of BIND opcodes to bind all lazy symbols.
- * Normal use is that dyld ignores the lazy_bind section when
- * loading an image. Instead the static linker arranged for the
- * lazy pointer to initially point to a helper function which
- * pushes the offset into the lazy_bind area for the symbol
- * needing to be bound, then jumps to dyld which simply adds
- * the offset to lazy_bind_off to get the information on what
- * to bind.
- */
- uint32_t lazy_bind_off; /* file offset to lazy binding info */
- uint32_t lazy_bind_size; /* size of lazy binding infs */
-
- /*
- * The symbols exported by a dylib are encoded in a trie. This
- * is a compact representation that factors out common prefixes.
- * It also reduces LINKEDIT pages in RAM because it encodes all
- * information (name, address, flags) in one small, contiguous range.
- * The export area is a stream of nodes. The first node sequentially
- * is the start node for the trie.
- *
- * Nodes for a symbol start with a uleb128 that is the length of
- * the exported symbol information for the string so far.
- * If there is no exported symbol, the node starts with a zero byte.
- * If there is exported info, it follows the length.
- *
- * First is a uleb128 containing flags. Normally, it is followed by
- * a uleb128 encoded offset which is location of the content named
- * by the symbol from the mach_header for the image. If the flags
- * is EXPORT_SYMBOL_FLAGS_REEXPORT, then following the flags is
- * a uleb128 encoded library ordinal, then a zero terminated
- * UTF8 string. If the string is zero length, then the symbol
- * is re-export from the specified dylib with the same name.
- * If the flags is EXPORT_SYMBOL_FLAGS_STUB_AND_RESOLVER, then following
- * the flags is two uleb128s: the stub offset and the resolver offset.
- * The stub is used by non-lazy pointers. The resolver is used
- * by lazy pointers and must be called to get the actual address to use.
- *
- * After the optional exported symbol information is a byte of
- * how many edges (0-255) that this node has leaving it,
- * followed by each edge.
- * Each edge is a zero terminated UTF8 of the addition chars
- * in the symbol, followed by a uleb128 offset for the node that
- * edge points to.
- *
- */
- uint32_t export_off; /* file offset to lazy binding info */
- uint32_t export_size; /* size of lazy binding infs */
-};
-
-/*
- * The following are used to encode rebasing information
- */
-#define REBASE_TYPE_POINTER 1
-#define REBASE_TYPE_TEXT_ABSOLUTE32 2
-#define REBASE_TYPE_TEXT_PCREL32 3
-
-#define REBASE_OPCODE_MASK 0xF0
-#define REBASE_IMMEDIATE_MASK 0x0F
-#define REBASE_OPCODE_DONE 0x00
-#define REBASE_OPCODE_SET_TYPE_IMM 0x10
-#define REBASE_OPCODE_SET_SEGMENT_AND_OFFSET_ULEB 0x20
-#define REBASE_OPCODE_ADD_ADDR_ULEB 0x30
-#define REBASE_OPCODE_ADD_ADDR_IMM_SCALED 0x40
-#define REBASE_OPCODE_DO_REBASE_IMM_TIMES 0x50
-#define REBASE_OPCODE_DO_REBASE_ULEB_TIMES 0x60
-#define REBASE_OPCODE_DO_REBASE_ADD_ADDR_ULEB 0x70
-#define REBASE_OPCODE_DO_REBASE_ULEB_TIMES_SKIPPING_ULEB 0x80
-
-
-/*
- * The following are used to encode binding information
- */
-#define BIND_TYPE_POINTER 1
-#define BIND_TYPE_TEXT_ABSOLUTE32 2
-#define BIND_TYPE_TEXT_PCREL32 3
-
-#define BIND_SPECIAL_DYLIB_SELF 0
-#define BIND_SPECIAL_DYLIB_MAIN_EXECUTABLE -1
-#define BIND_SPECIAL_DYLIB_FLAT_LOOKUP -2
-#define BIND_SPECIAL_DYLIB_WEAK_LOOKUP -3
-
-#define BIND_SYMBOL_FLAGS_WEAK_IMPORT 0x1
-#define BIND_SYMBOL_FLAGS_NON_WEAK_DEFINITION 0x8
-
-#define BIND_OPCODE_MASK 0xF0
-#define BIND_IMMEDIATE_MASK 0x0F
-#define BIND_OPCODE_DONE 0x00
-#define BIND_OPCODE_SET_DYLIB_ORDINAL_IMM 0x10
-#define BIND_OPCODE_SET_DYLIB_ORDINAL_ULEB 0x20
-#define BIND_OPCODE_SET_DYLIB_SPECIAL_IMM 0x30
-#define BIND_OPCODE_SET_SYMBOL_TRAILING_FLAGS_IMM 0x40
-#define BIND_OPCODE_SET_TYPE_IMM 0x50
-#define BIND_OPCODE_SET_ADDEND_SLEB 0x60
-#define BIND_OPCODE_SET_SEGMENT_AND_OFFSET_ULEB 0x70
-#define BIND_OPCODE_ADD_ADDR_ULEB 0x80
-#define BIND_OPCODE_DO_BIND 0x90
-#define BIND_OPCODE_DO_BIND_ADD_ADDR_ULEB 0xA0
-#define BIND_OPCODE_DO_BIND_ADD_ADDR_IMM_SCALED 0xB0
-#define BIND_OPCODE_DO_BIND_ULEB_TIMES_SKIPPING_ULEB 0xC0
-#define BIND_OPCODE_THREADED 0xD0
-#define BIND_SUBOPCODE_THREADED_SET_BIND_ORDINAL_TABLE_SIZE_ULEB 0x00
-#define BIND_SUBOPCODE_THREADED_APPLY 0x01
-
-
-/*
- * The following are used on the flags byte of a terminal node
- * in the export information.
- */
-#define EXPORT_SYMBOL_FLAGS_KIND_MASK 0x03
-#define EXPORT_SYMBOL_FLAGS_KIND_REGULAR 0x00
-#define EXPORT_SYMBOL_FLAGS_KIND_THREAD_LOCAL 0x01
-#define EXPORT_SYMBOL_FLAGS_KIND_ABSOLUTE 0x02
-#define EXPORT_SYMBOL_FLAGS_WEAK_DEFINITION 0x04
-#define EXPORT_SYMBOL_FLAGS_REEXPORT 0x08
-#define EXPORT_SYMBOL_FLAGS_STUB_AND_RESOLVER 0x10
-
-/*
- * The linker_option_command contains linker options embedded in object files.
- */
-struct linker_option_command {
- uint32_t cmd; /* LC_LINKER_OPTION only used in MH_OBJECT filetypes */
- uint32_t cmdsize;
- uint32_t count; /* number of strings */
- /* concatenation of zero terminated UTF8 strings.
- Zero filled at end to align */
-};
-
-/*
- * The symseg_command contains the offset and size of the GNU style
- * symbol table information as described in the header file .
- * The symbol roots of the symbol segments must also be aligned properly
- * in the file. So the requirement of keeping the offsets aligned to a
- * multiple of a 4 bytes translates to the length field of the symbol
- * roots also being a multiple of a long. Also the padding must again be
- * zeroed. (THIS IS OBSOLETE and no longer supported).
- */
-struct symseg_command {
- uint32_t cmd; /* LC_SYMSEG */
- uint32_t cmdsize; /* sizeof(struct symseg_command) */
- uint32_t offset; /* symbol segment offset */
- uint32_t size; /* symbol segment size in bytes */
-};
-
-/*
- * The ident_command contains a free format string table following the
- * ident_command structure. The strings are null terminated and the size of
- * the command is padded out with zero bytes to a multiple of 4 bytes/
- * (THIS IS OBSOLETE and no longer supported).
- */
-struct ident_command {
- uint32_t cmd; /* LC_IDENT */
- uint32_t cmdsize; /* strings that follow this command */
-};
-
-/*
- * The fvmfile_command contains a reference to a file to be loaded at the
- * specified virtual address. (Presently, this command is reserved for
- * internal use. The kernel ignores this command when loading a program into
- * memory).
- */
-struct fvmfile_command {
- uint32_t cmd; /* LC_FVMFILE */
- uint32_t cmdsize; /* includes pathname string */
- union lc_str name; /* files pathname */
- uint32_t header_addr; /* files virtual address */
-};
-
-
-/*
- * The entry_point_command is a replacement for thread_command.
- * It is used for main executables to specify the location (file offset)
- * of main(). If -stack_size was used at link time, the stacksize
- * field will contain the stack size need for the main thread.
- */
-struct entry_point_command {
- uint32_t cmd; /* LC_MAIN only used in MH_EXECUTE filetypes */
- uint32_t cmdsize; /* 24 */
- uint64_t entryoff; /* file (__TEXT) offset of main() */
- uint64_t stacksize;/* if not zero, initial stack size */
-};
-
-
-/*
- * The source_version_command is an optional load command containing
- * the version of the sources used to build the binary.
- */
-struct source_version_command {
- uint32_t cmd; /* LC_SOURCE_VERSION */
- uint32_t cmdsize; /* 16 */
- uint64_t version; /* A.B.C.D.E packed as a24.b10.c10.d10.e10 */
-};
-
-
-/*
- * The LC_DATA_IN_CODE load commands uses a linkedit_data_command
- * to point to an array of data_in_code_entry entries. Each entry
- * describes a range of data in a code section.
- */
-struct data_in_code_entry {
- uint32_t offset; /* from mach_header to start of data range*/
- uint16_t length; /* number of bytes in data range */
- uint16_t kind; /* a DICE_KIND_* value */
-};
-#define DICE_KIND_DATA 0x0001
-#define DICE_KIND_JUMP_TABLE8 0x0002
-#define DICE_KIND_JUMP_TABLE16 0x0003
-#define DICE_KIND_JUMP_TABLE32 0x0004
-#define DICE_KIND_ABS_JUMP_TABLE32 0x0005
-
-
-
-/*
- * Sections of type S_THREAD_LOCAL_VARIABLES contain an array
- * of tlv_descriptor structures.
- */
-struct tlv_descriptor
-{
- void* (*thunk)(struct tlv_descriptor*);
- unsigned long key;
- unsigned long offset;
-};
-
-/*
- * LC_NOTE commands describe a region of arbitrary data included in a Mach-O
- * file. Its initial use is to record extra data in MH_CORE files.
- */
-struct note_command {
- uint32_t cmd; /* LC_NOTE */
- uint32_t cmdsize; /* sizeof(struct note_command) */
- char data_owner[16]; /* owner name for this LC_NOTE */
- uint64_t offset; /* file offset of this data */
- uint64_t size; /* length of data region */
-};
-
-#endif /* _MACHO_LOADER_H_ */
\ No newline at end of file
diff --git a/lib/libc/include/x86_64-macos-gnu/mach/exception_types.h b/lib/libc/include/x86_64-macos-gnu/mach/exception_types.h
deleted file mode 100644
index a0026b9ce2..0000000000
--- a/lib/libc/include/x86_64-macos-gnu/mach/exception_types.h
+++ /dev/null
@@ -1,204 +0,0 @@
-/*
- * Copyright (c) 2000 Apple Computer, Inc. All rights reserved.
- *
- * @APPLE_OSREFERENCE_LICENSE_HEADER_START@
- *
- * This file contains Original Code and/or Modifications of Original Code
- * as defined in and that are subject to the Apple Public Source License
- * Version 2.0 (the 'License'). You may not use this file except in
- * compliance with the License. The rights granted to you under the License
- * may not be used to create, or enable the creation or redistribution of,
- * unlawful or unlicensed copies of an Apple operating system, or to
- * circumvent, violate, or enable the circumvention or violation of, any
- * terms of an Apple operating system software license agreement.
- *
- * Please obtain a copy of the License at
- * http://www.opensource.apple.com/apsl/ and read it before using this file.
- *
- * The Original Code and all software distributed under the License are
- * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
- * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
- * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
- * Please see the License for the specific language governing rights and
- * limitations under the License.
- *
- * @APPLE_OSREFERENCE_LICENSE_HEADER_END@
- */
-/*
- * @OSF_COPYRIGHT@
- */
-/*
- * Mach Operating System
- * Copyright (c) 1991,1990,1989,1988,1987 Carnegie Mellon University
- * All Rights Reserved.
- *
- * Permission to use, copy, modify and distribute this software and its
- * documentation is hereby granted, provided that both the copyright
- * notice and this permission notice appear in all copies of the
- * software, derivative works or modified versions, and any portions
- * thereof, and that both notices appear in supporting documentation.
- *
- * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS"
- * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR
- * ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE.
- *
- * Carnegie Mellon requests users of this software to return to
- *
- * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU
- * School of Computer Science
- * Carnegie Mellon University
- * Pittsburgh PA 15213-3890
- *
- * any improvements or extensions that they make and grant Carnegie Mellon
- * the rights to redistribute these changes.
- */
-/*
- */
-
-#ifndef _MACH_EXCEPTION_TYPES_H_
-#define _MACH_EXCEPTION_TYPES_H_
-
-#include
-
-/*
- * Machine-independent exception definitions.
- */
-
-#define EXC_BAD_ACCESS 1 /* Could not access memory */
-/* Code contains kern_return_t describing error. */
-/* Subcode contains bad memory address. */
-
-#define EXC_BAD_INSTRUCTION 2 /* Instruction failed */
-/* Illegal or undefined instruction or operand */
-
-#define EXC_ARITHMETIC 3 /* Arithmetic exception */
-/* Exact nature of exception is in code field */
-
-#define EXC_EMULATION 4 /* Emulation instruction */
-/* Emulation support instruction encountered */
-/* Details in code and subcode fields */
-
-#define EXC_SOFTWARE 5 /* Software generated exception */
-/* Exact exception is in code field. */
-/* Codes 0 - 0xFFFF reserved to hardware */
-/* Codes 0x10000 - 0x1FFFF reserved for OS emulation (Unix) */
-
-#define EXC_BREAKPOINT 6 /* Trace, breakpoint, etc. */
-/* Details in code field. */
-
-#define EXC_SYSCALL 7 /* System calls. */
-
-#define EXC_MACH_SYSCALL 8 /* Mach system calls. */
-
-#define EXC_RPC_ALERT 9 /* RPC alert */
-
-#define EXC_CRASH 10 /* Abnormal process exit */
-
-#define EXC_RESOURCE 11 /* Hit resource consumption limit */
-/* Exact resource is in code field. */
-
-#define EXC_GUARD 12 /* Violated guarded resource protections */
-
-#define EXC_CORPSE_NOTIFY 13 /* Abnormal process exited to corpse state */
-
-#define EXC_CORPSE_VARIANT_BIT 0x100 /* bit set for EXC_*_CORPSE variants of EXC_* */
-
-
-/*
- * Machine-independent exception behaviors
- */
-
-# define EXCEPTION_DEFAULT 1
-/* Send a catch_exception_raise message including the identity.
- */
-
-# define EXCEPTION_STATE 2
-/* Send a catch_exception_raise_state message including the
- * thread state.
- */
-
-# define EXCEPTION_STATE_IDENTITY 3
-/* Send a catch_exception_raise_state_identity message including
- * the thread identity and state.
- */
-
-#define MACH_EXCEPTION_ERRORS 0x40000000
-/* include additional exception specific errors, not used yet. */
-
-#define MACH_EXCEPTION_CODES 0x80000000
-/* Send 64-bit code and subcode in the exception header */
-
-#define MACH_EXCEPTION_MASK (MACH_EXCEPTION_CODES | MACH_EXCEPTION_ERRORS)
-/*
- * Masks for exception definitions, above
- * bit zero is unused, therefore 1 word = 31 exception types
- */
-
-#define EXC_MASK_BAD_ACCESS (1 << EXC_BAD_ACCESS)
-#define EXC_MASK_BAD_INSTRUCTION (1 << EXC_BAD_INSTRUCTION)
-#define EXC_MASK_ARITHMETIC (1 << EXC_ARITHMETIC)
-#define EXC_MASK_EMULATION (1 << EXC_EMULATION)
-#define EXC_MASK_SOFTWARE (1 << EXC_SOFTWARE)
-#define EXC_MASK_BREAKPOINT (1 << EXC_BREAKPOINT)
-#define EXC_MASK_SYSCALL (1 << EXC_SYSCALL)
-#define EXC_MASK_MACH_SYSCALL (1 << EXC_MACH_SYSCALL)
-#define EXC_MASK_RPC_ALERT (1 << EXC_RPC_ALERT)
-#define EXC_MASK_CRASH (1 << EXC_CRASH)
-#define EXC_MASK_RESOURCE (1 << EXC_RESOURCE)
-#define EXC_MASK_GUARD (1 << EXC_GUARD)
-#define EXC_MASK_CORPSE_NOTIFY (1 << EXC_CORPSE_NOTIFY)
-
-#define EXC_MASK_ALL (EXC_MASK_BAD_ACCESS | \
- EXC_MASK_BAD_INSTRUCTION | \
- EXC_MASK_ARITHMETIC | \
- EXC_MASK_EMULATION | \
- EXC_MASK_SOFTWARE | \
- EXC_MASK_BREAKPOINT | \
- EXC_MASK_SYSCALL | \
- EXC_MASK_MACH_SYSCALL | \
- EXC_MASK_RPC_ALERT | \
- EXC_MASK_RESOURCE | \
- EXC_MASK_GUARD | \
- EXC_MASK_MACHINE)
-
-
-#define FIRST_EXCEPTION 1 /* ZERO is illegal */
-
-/*
- * Machine independent codes for EXC_SOFTWARE
- * Codes 0x10000 - 0x1FFFF reserved for OS emulation (Unix)
- * 0x10000 - 0x10002 in use for unix signals
- * 0x20000 - 0x2FFFF reserved for MACF
- */
-#define EXC_SOFT_SIGNAL 0x10003 /* Unix signal exceptions */
-
-#define EXC_MACF_MIN 0x20000 /* MACF exceptions */
-#define EXC_MACF_MAX 0x2FFFF
-
-#ifndef ASSEMBLER
-
-#include
-#include
-#include
-/*
- * Exported types
- */
-
-typedef int exception_type_t;
-typedef integer_t exception_data_type_t;
-typedef int64_t mach_exception_data_type_t;
-typedef int exception_behavior_t;
-typedef exception_data_type_t *exception_data_t;
-typedef mach_exception_data_type_t *mach_exception_data_t;
-typedef unsigned int exception_mask_t;
-typedef exception_mask_t *exception_mask_array_t;
-typedef exception_behavior_t *exception_behavior_array_t;
-typedef thread_state_flavor_t *exception_flavor_array_t;
-typedef mach_port_t *exception_port_array_t;
-typedef mach_exception_data_type_t mach_exception_code_t;
-typedef mach_exception_data_type_t mach_exception_subcode_t;
-
-#endif /* ASSEMBLER */
-
-#endif /* _MACH_EXCEPTION_TYPES_H_ */
\ No newline at end of file
diff --git a/lib/libc/include/x86_64-macos-gnu/mach/host_special_ports.h b/lib/libc/include/x86_64-macos-gnu/mach/host_special_ports.h
deleted file mode 100644
index 8d4cdbefce..0000000000
--- a/lib/libc/include/x86_64-macos-gnu/mach/host_special_ports.h
+++ /dev/null
@@ -1,281 +0,0 @@
-/*
- * Copyright (c) 2003 Apple Computer, Inc. All rights reserved.
- *
- * @APPLE_OSREFERENCE_LICENSE_HEADER_START@
- *
- * This file contains Original Code and/or Modifications of Original Code
- * as defined in and that are subject to the Apple Public Source License
- * Version 2.0 (the 'License'). You may not use this file except in
- * compliance with the License. The rights granted to you under the License
- * may not be used to create, or enable the creation or redistribution of,
- * unlawful or unlicensed copies of an Apple operating system, or to
- * circumvent, violate, or enable the circumvention or violation of, any
- * terms of an Apple operating system software license agreement.
- *
- * Please obtain a copy of the License at
- * http://www.opensource.apple.com/apsl/ and read it before using this file.
- *
- * The Original Code and all software distributed under the License are
- * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
- * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
- * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
- * Please see the License for the specific language governing rights and
- * limitations under the License.
- *
- * @APPLE_OSREFERENCE_LICENSE_HEADER_END@
- */
-/*
- * @OSF_COPYRIGHT@
- */
-/*
- * Mach Operating System
- * Copyright (c) 1991 Carnegie Mellon University
- * All Rights Reserved.
- *
- * Permission to use, copy, modify and distribute this software and its
- * documentation is hereby granted, provided that both the copyright
- * notice and this permission notice appear in all copies of the
- * software, derivative works or modified versions, and any portions
- * thereof, and that both notices appear in supporting documentation.
- *
- * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS"
- * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR
- * ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE.
- *
- * Carnegie Mellon requests users of this software to return to
- *
- * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU
- * School of Computer Science
- * Carnegie Mellon University
- * Pittsburgh PA 15213-3890
- *
- * any improvements or extensions that they make and grant Carnegie Mellon
- * the rights to redistribute these changes.
- */
-/*
- */
-/*
- * File: mach/host_special_ports.h
- *
- * Defines codes for access to host-wide special ports.
- */
-
-#ifndef _MACH_HOST_SPECIAL_PORTS_H_
-#define _MACH_HOST_SPECIAL_PORTS_H_
-
-/*
- * Cannot be set or gotten from user space
- */
-#define HOST_SECURITY_PORT 0
-
-#define HOST_MIN_SPECIAL_PORT HOST_SECURITY_PORT
-
-/*
- * Always provided by kernel (cannot be set from user-space).
- */
-#define HOST_PORT 1
-#define HOST_PRIV_PORT 2
-#define HOST_IO_MASTER_PORT 3
-#define HOST_MAX_SPECIAL_KERNEL_PORT 7 /* room to grow */
-
-#define HOST_LAST_SPECIAL_KERNEL_PORT HOST_IO_MASTER_PORT
-
-/*
- * Not provided by kernel
- */
-#define HOST_DYNAMIC_PAGER_PORT (1 + HOST_MAX_SPECIAL_KERNEL_PORT)
-#define HOST_AUDIT_CONTROL_PORT (2 + HOST_MAX_SPECIAL_KERNEL_PORT)
-#define HOST_USER_NOTIFICATION_PORT (3 + HOST_MAX_SPECIAL_KERNEL_PORT)
-#define HOST_AUTOMOUNTD_PORT (4 + HOST_MAX_SPECIAL_KERNEL_PORT)
-#define HOST_LOCKD_PORT (5 + HOST_MAX_SPECIAL_KERNEL_PORT)
-#define HOST_KTRACE_BACKGROUND_PORT (6 + HOST_MAX_SPECIAL_KERNEL_PORT)
-#define HOST_SEATBELT_PORT (7 + HOST_MAX_SPECIAL_KERNEL_PORT)
-#define HOST_KEXTD_PORT (8 + HOST_MAX_SPECIAL_KERNEL_PORT)
-#define HOST_LAUNCHCTL_PORT (9 + HOST_MAX_SPECIAL_KERNEL_PORT)
-#define HOST_UNFREED_PORT (10 + HOST_MAX_SPECIAL_KERNEL_PORT)
-#define HOST_AMFID_PORT (11 + HOST_MAX_SPECIAL_KERNEL_PORT)
-#define HOST_GSSD_PORT (12 + HOST_MAX_SPECIAL_KERNEL_PORT)
-#define HOST_TELEMETRY_PORT (13 + HOST_MAX_SPECIAL_KERNEL_PORT)
-#define HOST_ATM_NOTIFICATION_PORT (14 + HOST_MAX_SPECIAL_KERNEL_PORT)
-#define HOST_COALITION_PORT (15 + HOST_MAX_SPECIAL_KERNEL_PORT)
-#define HOST_SYSDIAGNOSE_PORT (16 + HOST_MAX_SPECIAL_KERNEL_PORT)
-#define HOST_XPC_EXCEPTION_PORT (17 + HOST_MAX_SPECIAL_KERNEL_PORT)
-#define HOST_CONTAINERD_PORT (18 + HOST_MAX_SPECIAL_KERNEL_PORT)
-#define HOST_NODE_PORT (19 + HOST_MAX_SPECIAL_KERNEL_PORT)
-#define HOST_RESOURCE_NOTIFY_PORT (20 + HOST_MAX_SPECIAL_KERNEL_PORT)
-#define HOST_CLOSURED_PORT (21 + HOST_MAX_SPECIAL_KERNEL_PORT)
-#define HOST_SYSPOLICYD_PORT (22 + HOST_MAX_SPECIAL_KERNEL_PORT)
-#define HOST_FILECOORDINATIOND_PORT (23 + HOST_MAX_SPECIAL_KERNEL_PORT)
-#define HOST_FAIRPLAYD_PORT (24 + HOST_MAX_SPECIAL_KERNEL_PORT)
-
-#define HOST_MAX_SPECIAL_PORT HOST_FAIRPLAYD_PORT
-/* MAX = last since rdar://35861175 */
-
-/* obsolete name */
-#define HOST_CHUD_PORT HOST_LAUNCHCTL_PORT
-
-/*
- * Special node identifier to always represent the local node.
- */
-#define HOST_LOCAL_NODE -1
-
-/*
- * Definitions for ease of use.
- *
- * In the get call, the host parameter can be any host, but will generally
- * be the local node host port. In the set call, the host must the per-node
- * host port for the node being affected.
- */
-#define host_get_host_port(host, port) \
- (host_get_special_port((host), \
- HOST_LOCAL_NODE, HOST_PORT, (port)))
-#define host_set_host_port(host, port) (KERN_INVALID_ARGUMENT)
-
-#define host_get_host_priv_port(host, port) \
- (host_get_special_port((host), \
- HOST_LOCAL_NODE, HOST_PRIV_PORT, (port)))
-#define host_set_host_priv_port(host, port) (KERN_INVALID_ARGUMENT)
-
-#define host_get_io_master_port(host, port) \
- (host_get_special_port((host), \
- HOST_LOCAL_NODE, HOST_IO_MASTER_PORT, (port)))
-#define host_set_io_master_port(host, port) (KERN_INVALID_ARGUMENT)
-
-/*
- * User-settable special ports.
- */
-#define host_get_dynamic_pager_port(host, port) \
- (host_get_special_port((host), \
- HOST_LOCAL_NODE, HOST_DYNAMIC_PAGER_PORT, (port)))
-#define host_set_dynamic_pager_port(host, port) \
- (host_set_special_port((host), HOST_DYNAMIC_PAGER_PORT, (port)))
-
-#define host_get_audit_control_port(host, port) \
- (host_get_special_port((host), \
- HOST_LOCAL_NODE, HOST_AUDIT_CONTROL_PORT, (port)))
-#define host_set_audit_control_port(host, port) \
- (host_set_special_port((host), HOST_AUDIT_CONTROL_PORT, (port)))
-
-#define host_get_user_notification_port(host, port) \
- (host_get_special_port((host), \
- HOST_LOCAL_NODE, HOST_USER_NOTIFICATION_PORT, (port)))
-#define host_set_user_notification_port(host, port) \
- (host_set_special_port((host), HOST_USER_NOTIFICATION_PORT, (port)))
-
-#define host_get_automountd_port(host, port) \
- (host_get_special_port((host), \
- HOST_LOCAL_NODE, HOST_AUTOMOUNTD_PORT, (port)))
-#define host_set_automountd_port(host, port) \
- (host_set_special_port((host), HOST_AUTOMOUNTD_PORT, (port)))
-
-#define host_get_lockd_port(host, port) \
- (host_get_special_port((host), \
- HOST_LOCAL_NODE, HOST_LOCKD_PORT, (port)))
-#define host_set_lockd_port(host, port) \
- (host_set_special_port((host), HOST_LOCKD_PORT, (port)))
-
-#define host_get_ktrace_background_port(host, port) \
- (host_get_special_port((host), \
- HOST_LOCAL_NODE, HOST_KTRACE_BACKGROUND_PORT, (port)))
-#define host_set_ktrace_background_port(host, port) \
- (host_set_special_port((host), HOST_KTRACE_BACKGROUND_PORT, (port)))
-
-#define host_get_kextd_port(host, port) \
- (host_get_special_port((host), \
- HOST_LOCAL_NODE, HOST_KEXTD_PORT, (port)))
-#define host_set_kextd_port(host, port) \
- (host_set_special_port((host), HOST_KEXTD_PORT, (port)))
-
-#define host_get_launchctl_port(host, port) \
- (host_get_special_port((host), HOST_LOCAL_NODE, HOST_LAUNCHCTL_PORT, \
- (port)))
-#define host_set_launchctl_port(host, port) \
- (host_set_special_port((host), HOST_LAUNCHCTL_PORT, (port)))
-
-#define host_get_chud_port(host, port) host_get_launchctl_port(host, port)
-#define host_set_chud_port(host, port) host_set_launchctl_port(host, port)
-
-#define host_get_unfreed_port(host, port) \
- (host_get_special_port((host), \
- HOST_LOCAL_NODE, HOST_UNFREED_PORT, (port)))
-#define host_set_unfreed_port(host, port) \
- (host_set_special_port((host), HOST_UNFREED_PORT, (port)))
-
-#define host_get_amfid_port(host, port) \
- (host_get_special_port((host), \
- HOST_LOCAL_NODE, HOST_AMFID_PORT, (port)))
-#define host_set_amfid_port(host, port) \
- (host_set_special_port((host), HOST_AMFID_PORT, (port)))
-
-#define host_get_gssd_port(host, port) \
- (host_get_special_port((host), \
- HOST_LOCAL_NODE, HOST_GSSD_PORT, (port)))
-#define host_set_gssd_port(host, port) \
- (host_set_special_port((host), HOST_GSSD_PORT, (port)))
-
-#define host_get_telemetry_port(host, port) \
- (host_get_special_port((host), \
- HOST_LOCAL_NODE, HOST_TELEMETRY_PORT, (port)))
-#define host_set_telemetry_port(host, port) \
- (host_set_special_port((host), HOST_TELEMETRY_PORT, (port)))
-
-#define host_get_atm_notification_port(host, port) \
- (host_get_special_port((host), \
- HOST_LOCAL_NODE, HOST_ATM_NOTIFICATION_PORT, (port)))
-#define host_set_atm_notification_port(host, port) \
- (host_set_special_port((host), HOST_ATM_NOTIFICATION_PORT, (port)))
-
-#define host_get_coalition_port(host, port) \
- (host_get_special_port((host), \
- HOST_LOCAL_NODE, HOST_COALITION_PORT, (port)))
-#define host_set_coalition_port(host, port) \
- (host_set_special_port((host), HOST_COALITION_PORT, (port)))
-
-#define host_get_sysdiagnose_port(host, port) \
- (host_get_special_port((host), \
- HOST_LOCAL_NODE, HOST_SYSDIAGNOSE_PORT, (port)))
-#define host_set_sysdiagnose_port(host, port) \
- (host_set_special_port((host), HOST_SYSDIAGNOSE_PORT, (port)))
-
-#define host_get_container_port(host, port) \
- (host_get_special_port((host), \
- HOST_LOCAL_NODE, HOST_CONTAINERD_PORT, (port)))
-#define host_set_container_port(host, port) \
- (host_set_special_port((host), HOST_CONTAINERD_PORT, (port)))
-
-#define host_get_node_port(host, port) \
- (host_get_special_port((host), \
- HOST_LOCAL_NODE, HOST_NODE_PORT, (port)))
-#define host_set_node_port(host, port) \
- (host_set_special_port((host), HOST_NODE_PORT, (port)))
-
-#define host_get_closured_port(host, port) \
- (host_get_special_port((host), \
- HOST_LOCAL_NODE, HOST_CLOSURED_PORT, (port)))
-#define host_set_closured_port(host, port) \
- (host_set_special_port((host), HOST_CLOSURED_PORT, (port)))
-
-#define host_get_syspolicyd_port(host, port) \
- (host_get_special_port((host), \
- HOST_LOCAL_NODE, HOST_SYSPOLICYD_PORT, (port)))
-#define host_set_syspolicyd_port(host, port) \
- (host_set_special_port((host), HOST_SYSPOLICYD_PORT, (port)))
-
-#define host_get_filecoordinationd_port(host, port) \
- (host_get_special_port((host), \
- HOST_LOCAL_NODE, HOST_FILECOORDINATIOND_PORT, (port)))
-#define host_set_filecoordinationd_port(host, port) \
- (host_set_special_port((host), HOST_FILECOORDINATIOND_PORT, (port)))
-
-#define host_get_fairplayd_port(host, port) \
- (host_get_special_port((host), \
- HOST_LOCAL_NODE, HOST_FAIRPLAYD_PORT, (port)))
-#define host_set_fairplayd_port(host, port) \
- (host_set_special_port((host), HOST_FAIRPLAYD_PORT, (port)))
-
-/* HOST_RESOURCE_NOTIFY_PORT doesn't #defines these conveniences.
- * All lookups go through send_resource_violation()
- */
-
-#endif /* _MACH_HOST_SPECIAL_PORTS_H_ */
\ No newline at end of file
diff --git a/lib/libc/include/x86_64-macos-gnu/mach/i386/_structs.h b/lib/libc/include/x86_64-macos-gnu/mach/i386/_structs.h
index f041af9f3f..248653b4f8 100644
--- a/lib/libc/include/x86_64-macos-gnu/mach/i386/_structs.h
+++ b/lib/libc/include/x86_64-macos-gnu/mach/i386/_structs.h
@@ -603,7 +603,48 @@ _STRUCT_X86_DEBUG_STATE32
unsigned int __dr6;
unsigned int __dr7;
};
+
+#define _STRUCT_X86_INSTRUCTION_STATE struct __x86_instruction_state
+_STRUCT_X86_INSTRUCTION_STATE
+{
+ int __insn_stream_valid_bytes;
+ int __insn_offset;
+ int __out_of_synch; /*
+ * non-zero when the cacheline that includes the insn_offset
+ * is replaced in the insn_bytes array due to a mismatch
+ * detected when comparing it with the same cacheline in memory
+ */
+#define _X86_INSTRUCTION_STATE_MAX_INSN_BYTES (2448 - 64 - 4)
+ __uint8_t __insn_bytes[_X86_INSTRUCTION_STATE_MAX_INSN_BYTES];
+#define _X86_INSTRUCTION_STATE_CACHELINE_SIZE 64
+ __uint8_t __insn_cacheline[_X86_INSTRUCTION_STATE_CACHELINE_SIZE];
+};
+
+#define _STRUCT_LAST_BRANCH_RECORD struct __last_branch_record
+_STRUCT_LAST_BRANCH_RECORD
+{
+ __uint64_t __from_ip;
+ __uint64_t __to_ip;
+ __uint32_t __mispredict : 1,
+ __tsx_abort : 1,
+ __in_tsx : 1,
+ __cycle_count: 16,
+ __reserved : 13;
+};
+
+#define _STRUCT_LAST_BRANCH_STATE struct __last_branch_state
+_STRUCT_LAST_BRANCH_STATE
+{
+ int __lbr_count;
+ __uint32_t __lbr_supported_tsx : 1,
+ __lbr_supported_cycle_count : 1,
+ __reserved : 30;
+#define __LASTBRANCH_MAX 32
+ _STRUCT_LAST_BRANCH_RECORD __lbrs[__LASTBRANCH_MAX];
+};
+
#else /* !__DARWIN_UNIX03 */
+
#define _STRUCT_X86_DEBUG_STATE32 struct x86_debug_state32
_STRUCT_X86_DEBUG_STATE32
{
@@ -616,6 +657,45 @@ _STRUCT_X86_DEBUG_STATE32
unsigned int dr6;
unsigned int dr7;
};
+
+#define _STRUCT_X86_INSTRUCTION_STATE struct __x86_instruction_state
+_STRUCT_X86_INSTRUCTION_STATE
+{
+ int insn_stream_valid_bytes;
+ int insn_offset;
+ int out_of_synch; /*
+ * non-zero when the cacheline that includes the insn_offset
+ * is replaced in the insn_bytes array due to a mismatch
+ * detected when comparing it with the same cacheline in memory
+ */
+#define x86_INSTRUCTION_STATE_MAX_INSN_BYTES (2448 - 64 - 4)
+ __uint8_t insn_bytes[x86_INSTRUCTION_STATE_MAX_INSN_BYTES];
+#define x86_INSTRUCTION_STATE_CACHELINE_SIZE 64
+ __uint8_t insn_cacheline[x86_INSTRUCTION_STATE_CACHELINE_SIZE];
+};
+
+#define _STRUCT_LAST_BRANCH_RECORD struct __last_branch_record
+_STRUCT_LAST_BRANCH_RECORD
+{
+ __uint64_t from_ip;
+ __uint64_t to_ip;
+ __uint32_t mispredict : 1,
+ tsx_abort : 1,
+ in_tsx : 1,
+ cycle_count: 16,
+ reserved : 13;
+};
+
+#define _STRUCT_LAST_BRANCH_STATE struct __last_branch_state
+_STRUCT_LAST_BRANCH_STATE
+{
+ int lbr_count;
+ __uint32_t lbr_supported_tsx : 1,
+ lbr_supported_cycle_count : 1,
+ reserved : 30;
+#define __LASTBRANCH_MAX 32
+ _STRUCT_LAST_BRANCH_RECORD lbrs[__LASTBRANCH_MAX];
+};
#endif /* !__DARWIN_UNIX03 */
#define _STRUCT_X86_PAGEIN_STATE struct __x86_pagein_state
diff --git a/lib/libc/include/x86_64-macos-gnu/mach/i386/thread_state.h b/lib/libc/include/x86_64-macos-gnu/mach/i386/thread_state.h
index 78595255a3..4d9825be70 100644
--- a/lib/libc/include/x86_64-macos-gnu/mach/i386/thread_state.h
+++ b/lib/libc/include/x86_64-macos-gnu/mach/i386/thread_state.h
@@ -32,7 +32,7 @@
#ifndef _MACH_I386_THREAD_STATE_H_
#define _MACH_I386_THREAD_STATE_H_
-/* Size of maximum exported thread state in words */
+/* Size of maximum exported thread state in 32-bit words */
#define I386_THREAD_STATE_MAX (614) /* Size of biggest state possible */
#if defined (__i386__) || defined(__x86_64__)
diff --git a/lib/libc/include/x86_64-macos-gnu/mach/i386/thread_status.h b/lib/libc/include/x86_64-macos-gnu/mach/i386/thread_status.h
index 233e0f22a6..24de7ae76c 100644
--- a/lib/libc/include/x86_64-macos-gnu/mach/i386/thread_status.h
+++ b/lib/libc/include/x86_64-macos-gnu/mach/i386/thread_status.h
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2000-2006 Apple Computer, Inc. All rights reserved.
+ * Copyright (c) 2000-2020 Apple Computer, Inc. All rights reserved.
*
* @APPLE_OSREFERENCE_LICENSE_HEADER_START@
*
@@ -121,6 +121,8 @@
#define x86_AVX512_STATE (x86_AVX512_STATE32 + 2)
#define x86_PAGEIN_STATE 22
#define x86_THREAD_FULL_STATE64 23
+#define x86_INSTRUCTION_STATE 24
+#define x86_LAST_BRANCH_STATE 25
/*
* Largest state on this machine:
@@ -155,6 +157,8 @@
(x == x86_AVX512_STATE64) || \
(x == x86_AVX512_STATE) || \
(x == x86_PAGEIN_STATE) || \
+ (x == x86_INSTRUCTION_STATE) || \
+ (x == x86_LAST_BRANCH_STATE) || \
(x == THREAD_STATE_NONE))
struct x86_state_hdr {
@@ -259,6 +263,19 @@ typedef _STRUCT_X86_PAGEIN_STATE x86_pagein_state_t;
#define X86_PAGEIN_STATE_COUNT x86_PAGEIN_STATE_COUNT
+typedef _STRUCT_X86_INSTRUCTION_STATE x86_instruction_state_t;
+#define x86_INSTRUCTION_STATE_COUNT \
+ ((mach_msg_type_number_t)(sizeof(x86_instruction_state_t) / sizeof(int)))
+
+#define X86_INSTRUCTION_STATE_COUNT x86_INSTRUCTION_STATE_COUNT
+
+typedef _STRUCT_LAST_BRANCH_STATE last_branch_state_t;
+#define x86_LAST_BRANCH_STATE_COUNT \
+ ((mach_msg_type_number_t)(sizeof(last_branch_state_t) / sizeof(int)))
+
+#define X86_LAST_BRANCH_STATE_COUNT x86_LAST_BRANCH_STATE_COUNT
+
+
/*
* Combined thread, float and exception states
*/
diff --git a/lib/libc/include/x86_64-macos-gnu/mach/i386/vm_param.h b/lib/libc/include/x86_64-macos-gnu/mach/i386/vm_param.h
index a85ee924b7..fa27fffa2f 100644
--- a/lib/libc/include/x86_64-macos-gnu/mach/i386/vm_param.h
+++ b/lib/libc/include/x86_64-macos-gnu/mach/i386/vm_param.h
@@ -90,47 +90,34 @@
#ifndef _MACH_I386_VM_PARAM_H_
#define _MACH_I386_VM_PARAM_H_
+#if !defined(KERNEL) && !defined(__ASSEMBLER__)
+
+#include
+#endif
+
#define BYTE_SIZE 8 /* byte size in bits */
#define I386_PGBYTES 4096 /* bytes per 80386 page */
#define I386_PGSHIFT 12 /* bitshift for pages */
-#define PAGE_SIZE I386_PGBYTES
+
+#if !defined(__MAC_OS_X_VERSION_MIN_REQUIRED) || (__MAC_OS_X_VERSION_MIN_REQUIRED < 101600)
#define PAGE_SHIFT I386_PGSHIFT
-#define PAGE_MASK (PAGE_SIZE - 1)
+#define PAGE_SIZE I386_PGBYTES
+#define PAGE_MASK (PAGE_SIZE-1)
+#else /* !defined(__MAC_OS_X_VERSION_MIN_REQUIRED) || (__MAC_OS_X_VERSION_MIN_REQUIRED < 101600) */
+#define PAGE_SHIFT vm_page_shift
+#define PAGE_SIZE vm_page_size
+#define PAGE_MASK vm_page_mask
+#endif /* !defined(__MAC_OS_X_VERSION_MIN_REQUIRED) || (__MAC_OS_X_VERSION_MIN_REQUIRED < 101600) */
-#define PAGE_MAX_SHIFT PAGE_SHIFT
-#define PAGE_MAX_SIZE PAGE_SIZE
-#define PAGE_MAX_MASK PAGE_MASK
-
-#define PAGE_MIN_SHIFT PAGE_SHIFT
-#define PAGE_MIN_SIZE PAGE_SIZE
-#define PAGE_MIN_MASK PAGE_MASK
-
-#define I386_LPGBYTES 2*1024*1024 /* bytes per large page */
-#define I386_LPGSHIFT 21 /* bitshift for large pages */
-#define I386_LPGMASK (I386_LPGBYTES-1)
-
-/*
- * Convert bytes to pages and convert pages to bytes.
- * No rounding is used.
- */
-
-#define i386_btop(x) ((ppnum_t)((x) >> I386_PGSHIFT))
-#define machine_btop(x) i386_btop(x)
-#define i386_ptob(x) (((pmap_paddr_t)(x)) << I386_PGSHIFT)
-#define machine_ptob(x) i386_ptob(x)
-
-/*
- * Round off or truncate to the nearest page. These will work
- * for either addresses or counts. (i.e. 1 byte rounds to 1 page
- * bytes.
- */
-
-#define i386_round_page(x) ((((pmap_paddr_t)(x)) + I386_PGBYTES - 1) & \
- ~(I386_PGBYTES-1))
-#define i386_trunc_page(x) (((pmap_paddr_t)(x)) & ~(I386_PGBYTES-1))
+#define PAGE_MAX_SHIFT 14
+#define PAGE_MAX_SIZE (1 << PAGE_MAX_SHIFT)
+#define PAGE_MAX_MASK (PAGE_MAX_SIZE-1)
+#define PAGE_MIN_SHIFT 12
+#define PAGE_MIN_SIZE (1 << PAGE_MIN_SHIFT)
+#define PAGE_MIN_MASK (PAGE_MIN_SIZE-1)
#define VM_MIN_ADDRESS64 ((user_addr_t) 0x0000000000000000ULL)
diff --git a/lib/libc/include/x86_64-macos-gnu/mach/i386/vm_types.h b/lib/libc/include/x86_64-macos-gnu/mach/i386/vm_types.h
index 8a95db53ee..57bc28af88 100644
--- a/lib/libc/include/x86_64-macos-gnu/mach/i386/vm_types.h
+++ b/lib/libc/include/x86_64-macos-gnu/mach/i386/vm_types.h
@@ -70,7 +70,6 @@
#ifndef ASSEMBLER
#include
-#include
#include
/*
diff --git a/lib/libc/include/x86_64-macos-gnu/mach/kern_return.h b/lib/libc/include/x86_64-macos-gnu/mach/kern_return.h
deleted file mode 100644
index 62d6415f52..0000000000
--- a/lib/libc/include/x86_64-macos-gnu/mach/kern_return.h
+++ /dev/null
@@ -1,330 +0,0 @@
-/*
- * Copyright (c) 2000 Apple Computer, Inc. All rights reserved.
- *
- * @APPLE_OSREFERENCE_LICENSE_HEADER_START@
- *
- * This file contains Original Code and/or Modifications of Original Code
- * as defined in and that are subject to the Apple Public Source License
- * Version 2.0 (the 'License'). You may not use this file except in
- * compliance with the License. The rights granted to you under the License
- * may not be used to create, or enable the creation or redistribution of,
- * unlawful or unlicensed copies of an Apple operating system, or to
- * circumvent, violate, or enable the circumvention or violation of, any
- * terms of an Apple operating system software license agreement.
- *
- * Please obtain a copy of the License at
- * http://www.opensource.apple.com/apsl/ and read it before using this file.
- *
- * The Original Code and all software distributed under the License are
- * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
- * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
- * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
- * Please see the License for the specific language governing rights and
- * limitations under the License.
- *
- * @APPLE_OSREFERENCE_LICENSE_HEADER_END@
- */
-/*
- * @OSF_COPYRIGHT@
- */
-/*
- * Mach Operating System
- * Copyright (c) 1991,1990,1989,1988,1987 Carnegie Mellon University
- * All Rights Reserved.
- *
- * Permission to use, copy, modify and distribute this software and its
- * documentation is hereby granted, provided that both the copyright
- * notice and this permission notice appear in all copies of the
- * software, derivative works or modified versions, and any portions
- * thereof, and that both notices appear in supporting documentation.
- *
- * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS"
- * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR
- * ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE.
- *
- * Carnegie Mellon requests users of this software to return to
- *
- * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU
- * School of Computer Science
- * Carnegie Mellon University
- * Pittsburgh PA 15213-3890
- *
- * any improvements or extensions that they make and grant Carnegie Mellon
- * the rights to redistribute these changes.
- */
-/*
- */
-/*
- * File: h/kern_return.h
- * Author: Avadis Tevanian, Jr.
- * Date: 1985
- *
- * Kernel return codes.
- *
- */
-
-#ifndef _MACH_KERN_RETURN_H_
-#define _MACH_KERN_RETURN_H_
-
-#include
-
-#define KERN_SUCCESS 0
-
-#define KERN_INVALID_ADDRESS 1
-/* Specified address is not currently valid.
- */
-
-#define KERN_PROTECTION_FAILURE 2
-/* Specified memory is valid, but does not permit the
- * required forms of access.
- */
-
-#define KERN_NO_SPACE 3
-/* The address range specified is already in use, or
- * no address range of the size specified could be
- * found.
- */
-
-#define KERN_INVALID_ARGUMENT 4
-/* The function requested was not applicable to this
- * type of argument, or an argument is invalid
- */
-
-#define KERN_FAILURE 5
-/* The function could not be performed. A catch-all.
- */
-
-#define KERN_RESOURCE_SHORTAGE 6
-/* A system resource could not be allocated to fulfill
- * this request. This failure may not be permanent.
- */
-
-#define KERN_NOT_RECEIVER 7
-/* The task in question does not hold receive rights
- * for the port argument.
- */
-
-#define KERN_NO_ACCESS 8
-/* Bogus access restriction.
- */
-
-#define KERN_MEMORY_FAILURE 9
-/* During a page fault, the target address refers to a
- * memory object that has been destroyed. This
- * failure is permanent.
- */
-
-#define KERN_MEMORY_ERROR 10
-/* During a page fault, the memory object indicated
- * that the data could not be returned. This failure
- * may be temporary; future attempts to access this
- * same data may succeed, as defined by the memory
- * object.
- */
-
-#define KERN_ALREADY_IN_SET 11
-/* The receive right is already a member of the portset.
- */
-
-#define KERN_NOT_IN_SET 12
-/* The receive right is not a member of a port set.
- */
-
-#define KERN_NAME_EXISTS 13
-/* The name already denotes a right in the task.
- */
-
-#define KERN_ABORTED 14
-/* The operation was aborted. Ipc code will
- * catch this and reflect it as a message error.
- */
-
-#define KERN_INVALID_NAME 15
-/* The name doesn't denote a right in the task.
- */
-
-#define KERN_INVALID_TASK 16
-/* Target task isn't an active task.
- */
-
-#define KERN_INVALID_RIGHT 17
-/* The name denotes a right, but not an appropriate right.
- */
-
-#define KERN_INVALID_VALUE 18
-/* A blatant range error.
- */
-
-#define KERN_UREFS_OVERFLOW 19
-/* Operation would overflow limit on user-references.
- */
-
-#define KERN_INVALID_CAPABILITY 20
-/* The supplied (port) capability is improper.
- */
-
-#define KERN_RIGHT_EXISTS 21
-/* The task already has send or receive rights
- * for the port under another name.
- */
-
-#define KERN_INVALID_HOST 22
-/* Target host isn't actually a host.
- */
-
-#define KERN_MEMORY_PRESENT 23
-/* An attempt was made to supply "precious" data
- * for memory that is already present in a
- * memory object.
- */
-
-#define KERN_MEMORY_DATA_MOVED 24
-/* A page was requested of a memory manager via
- * memory_object_data_request for an object using
- * a MEMORY_OBJECT_COPY_CALL strategy, with the
- * VM_PROT_WANTS_COPY flag being used to specify
- * that the page desired is for a copy of the
- * object, and the memory manager has detected
- * the page was pushed into a copy of the object
- * while the kernel was walking the shadow chain
- * from the copy to the object. This error code
- * is delivered via memory_object_data_error
- * and is handled by the kernel (it forces the
- * kernel to restart the fault). It will not be
- * seen by users.
- */
-
-#define KERN_MEMORY_RESTART_COPY 25
-/* A strategic copy was attempted of an object
- * upon which a quicker copy is now possible.
- * The caller should retry the copy using
- * vm_object_copy_quickly. This error code
- * is seen only by the kernel.
- */
-
-#define KERN_INVALID_PROCESSOR_SET 26
-/* An argument applied to assert processor set privilege
- * was not a processor set control port.
- */
-
-#define KERN_POLICY_LIMIT 27
-/* The specified scheduling attributes exceed the thread's
- * limits.
- */
-
-#define KERN_INVALID_POLICY 28
-/* The specified scheduling policy is not currently
- * enabled for the processor set.
- */
-
-#define KERN_INVALID_OBJECT 29
-/* The external memory manager failed to initialize the
- * memory object.
- */
-
-#define KERN_ALREADY_WAITING 30
-/* A thread is attempting to wait for an event for which
- * there is already a waiting thread.
- */
-
-#define KERN_DEFAULT_SET 31
-/* An attempt was made to destroy the default processor
- * set.
- */
-
-#define KERN_EXCEPTION_PROTECTED 32
-/* An attempt was made to fetch an exception port that is
- * protected, or to abort a thread while processing a
- * protected exception.
- */
-
-#define KERN_INVALID_LEDGER 33
-/* A ledger was required but not supplied.
- */
-
-#define KERN_INVALID_MEMORY_CONTROL 34
-/* The port was not a memory cache control port.
- */
-
-#define KERN_INVALID_SECURITY 35
-/* An argument supplied to assert security privilege
- * was not a host security port.
- */
-
-#define KERN_NOT_DEPRESSED 36
-/* thread_depress_abort was called on a thread which
- * was not currently depressed.
- */
-
-#define KERN_TERMINATED 37
-/* Object has been terminated and is no longer available
- */
-
-#define KERN_LOCK_SET_DESTROYED 38
-/* Lock set has been destroyed and is no longer available.
- */
-
-#define KERN_LOCK_UNSTABLE 39
-/* The thread holding the lock terminated before releasing
- * the lock
- */
-
-#define KERN_LOCK_OWNED 40
-/* The lock is already owned by another thread
- */
-
-#define KERN_LOCK_OWNED_SELF 41
-/* The lock is already owned by the calling thread
- */
-
-#define KERN_SEMAPHORE_DESTROYED 42
-/* Semaphore has been destroyed and is no longer available.
- */
-
-#define KERN_RPC_SERVER_TERMINATED 43
-/* Return from RPC indicating the target server was
- * terminated before it successfully replied
- */
-
-#define KERN_RPC_TERMINATE_ORPHAN 44
-/* Terminate an orphaned activation.
- */
-
-#define KERN_RPC_CONTINUE_ORPHAN 45
-/* Allow an orphaned activation to continue executing.
- */
-
-#define KERN_NOT_SUPPORTED 46
-/* Empty thread activation (No thread linked to it)
- */
-
-#define KERN_NODE_DOWN 47
-/* Remote node down or inaccessible.
- */
-
-#define KERN_NOT_WAITING 48
-/* A signalled thread was not actually waiting. */
-
-#define KERN_OPERATION_TIMED_OUT 49
-/* Some thread-oriented operation (semaphore_wait) timed out
- */
-
-#define KERN_CODESIGN_ERROR 50
-/* During a page fault, indicates that the page was rejected
- * as a result of a signature check.
- */
-
-#define KERN_POLICY_STATIC 51
-/* The requested property cannot be changed at this time.
- */
-
-#define KERN_INSUFFICIENT_BUFFER_SIZE 52
-/* The provided buffer is of insufficient size for the requested data.
- */
-
-#define KERN_RETURN_MAX 0x100
-/* Maximum return value allowable
- */
-
-#endif /* _MACH_KERN_RETURN_H_ */
\ No newline at end of file
diff --git a/lib/libc/include/x86_64-macos-gnu/mach/mach_init.h b/lib/libc/include/x86_64-macos-gnu/mach/mach_init.h
deleted file mode 100644
index d61d6e90b5..0000000000
--- a/lib/libc/include/x86_64-macos-gnu/mach/mach_init.h
+++ /dev/null
@@ -1,110 +0,0 @@
-/*
- * Copyright (c) 1999 Apple Computer, Inc. All rights reserved.
- *
- * @APPLE_OSREFERENCE_LICENSE_HEADER_START@
- *
- * This file contains Original Code and/or Modifications of Original Code
- * as defined in and that are subject to the Apple Public Source License
- * Version 2.0 (the 'License'). You may not use this file except in
- * compliance with the License. The rights granted to you under the License
- * may not be used to create, or enable the creation or redistribution of,
- * unlawful or unlicensed copies of an Apple operating system, or to
- * circumvent, violate, or enable the circumvention or violation of, any
- * terms of an Apple operating system software license agreement.
- *
- * Please obtain a copy of the License at
- * http://www.opensource.apple.com/apsl/ and read it before using this file.
- *
- * The Original Code and all software distributed under the License are
- * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
- * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
- * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
- * Please see the License for the specific language governing rights and
- * limitations under the License.
- *
- * @APPLE_OSREFERENCE_LICENSE_HEADER_END@
- */
-/*
- * Mach Operating System
- * Copyright (c) 1991,1990,1989,1988,1987,1986 Carnegie Mellon University
- * All Rights Reserved.
- *
- * Permission to use, copy, modify and distribute this software and its
- * documentation is hereby granted, provided that both the copyright
- * notice and this permission notice appear in all copies of the
- * software, derivative works or modified versions, and any portions
- * thereof, and that both notices appear in supporting documentation.
- *
- * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS"
- * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR
- * ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE.
- *
- * Carnegie Mellon requests users of this software to return to
- *
- * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU
- * School of Computer Science
- * Carnegie Mellon University
- * Pittsburgh PA 15213-3890
- *
- * any improvements or extensions that they make and grant Carnegie Mellon
- * the rights to redistribute these changes.
- */
-
-/*
- * Items provided by the Mach environment initialization.
- */
-
-#ifndef _MACH_INIT_
-#define _MACH_INIT_ 1
-
-#include
-#include
-#include
-
-#include
-
-/*
- * Kernel-related ports; how a task/thread controls itself
- */
-
-__BEGIN_DECLS
-extern mach_port_t mach_host_self(void);
-extern mach_port_t mach_thread_self(void);
-extern kern_return_t host_page_size(host_t, vm_size_t *);
-
-extern mach_port_t mach_task_self_;
-#define mach_task_self() mach_task_self_
-#define current_task() mach_task_self()
-
-__END_DECLS
-#include
-__BEGIN_DECLS
-
-/*
- * Other important ports in the Mach user environment
- */
-
-extern mach_port_t bootstrap_port;
-
-/*
- * Where these ports occur in the "mach_ports_register"
- * collection... only servers or the runtime library need know.
- */
-
-#define NAME_SERVER_SLOT 0
-#define ENVIRONMENT_SLOT 1
-#define SERVICE_SLOT 2
-
-#define MACH_PORTS_SLOTS_USED 3
-
-/*
- * fprintf_stderr uses vprintf_stderr_func to produce
- * error messages, this can be overridden by a user
- * application to point to a user-specified output function
- */
-extern int (*vprintf_stderr_func)(const char *format, va_list ap);
-
-__END_DECLS
-
-#endif /* _MACH_INIT_ */
\ No newline at end of file
diff --git a/lib/libc/include/x86_64-macos-gnu/mach/mach_port.h b/lib/libc/include/x86_64-macos-gnu/mach/mach_port.h
deleted file mode 100644
index fcec114ccf..0000000000
--- a/lib/libc/include/x86_64-macos-gnu/mach/mach_port.h
+++ /dev/null
@@ -1,1808 +0,0 @@
-#ifndef _mach_port_user_
-#define _mach_port_user_
-
-/* Module mach_port */
-
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-
-/* BEGIN MIG_STRNCPY_ZEROFILL CODE */
-
-#if defined(__has_include)
-#if __has_include()
-#ifndef USING_MIG_STRNCPY_ZEROFILL
-#define USING_MIG_STRNCPY_ZEROFILL
-#endif
-#ifndef __MIG_STRNCPY_ZEROFILL_FORWARD_TYPE_DECLS__
-#define __MIG_STRNCPY_ZEROFILL_FORWARD_TYPE_DECLS__
-#ifdef __cplusplus
-extern "C" {
-#endif
- extern int mig_strncpy_zerofill(char *dest, const char *src, int len) __attribute__((weak_import));
-#ifdef __cplusplus
-}
-#endif
-#endif /* __MIG_STRNCPY_ZEROFILL_FORWARD_TYPE_DECLS__ */
-#endif /* __has_include() */
-#endif /* __has_include */
-
-/* END MIG_STRNCPY_ZEROFILL CODE */
-
-
-#ifdef AUTOTEST
-#ifndef FUNCTION_PTR_T
-#define FUNCTION_PTR_T
-typedef void (*function_ptr_t)(mach_port_t, char *, mach_msg_type_number_t);
-typedef struct {
- char *name;
- function_ptr_t function;
-} function_table_entry;
-typedef function_table_entry *function_table_t;
-#endif /* FUNCTION_PTR_T */
-#endif /* AUTOTEST */
-
-#ifndef mach_port_MSG_COUNT
-#define mach_port_MSG_COUNT 40
-#endif /* mach_port_MSG_COUNT */
-
-#include
-#include
-#include
-#include
-#include
-
-#ifdef __BeforeMigUserHeader
-__BeforeMigUserHeader
-#endif /* __BeforeMigUserHeader */
-
-#include
-__BEGIN_DECLS
-
-
-/* Routine mach_port_names */
-#ifdef mig_external
-mig_external
-#else
-extern
-#endif /* mig_external */
-kern_return_t mach_port_names
-(
- ipc_space_t task,
- mach_port_name_array_t *names,
- mach_msg_type_number_t *namesCnt,
- mach_port_type_array_t *types,
- mach_msg_type_number_t *typesCnt
-);
-
-/* Routine mach_port_type */
-#ifdef mig_external
-mig_external
-#else
-extern
-#endif /* mig_external */
-kern_return_t mach_port_type
-(
- ipc_space_t task,
- mach_port_name_t name,
- mach_port_type_t *ptype
-);
-
-/* Routine mach_port_rename */
-#ifdef mig_external
-mig_external
-#else
-extern
-#endif /* mig_external */
-kern_return_t mach_port_rename
-(
- ipc_space_t task,
- mach_port_name_t old_name,
- mach_port_name_t new_name
-);
-
-/* Routine mach_port_allocate_name */
-#ifdef mig_external
-mig_external
-#else
-extern
-#endif /* mig_external */
-__WATCHOS_PROHIBITED
-__TVOS_PROHIBITED
-kern_return_t mach_port_allocate_name
-(
- ipc_space_t task,
- mach_port_right_t right,
- mach_port_name_t name
-);
-
-/* Routine mach_port_allocate */
-#ifdef mig_external
-mig_external
-#else
-extern
-#endif /* mig_external */
-kern_return_t mach_port_allocate
-(
- ipc_space_t task,
- mach_port_right_t right,
- mach_port_name_t *name
-);
-
-/* Routine mach_port_destroy */
-#ifdef mig_external
-mig_external
-#else
-extern
-#endif /* mig_external */
-kern_return_t mach_port_destroy
-(
- ipc_space_t task,
- mach_port_name_t name
-);
-
-/* Routine mach_port_deallocate */
-#ifdef mig_external
-mig_external
-#else
-extern
-#endif /* mig_external */
-kern_return_t mach_port_deallocate
-(
- ipc_space_t task,
- mach_port_name_t name
-);
-
-/* Routine mach_port_get_refs */
-#ifdef mig_external
-mig_external
-#else
-extern
-#endif /* mig_external */
-kern_return_t mach_port_get_refs
-(
- ipc_space_t task,
- mach_port_name_t name,
- mach_port_right_t right,
- mach_port_urefs_t *refs
-);
-
-/* Routine mach_port_mod_refs */
-#ifdef mig_external
-mig_external
-#else
-extern
-#endif /* mig_external */
-kern_return_t mach_port_mod_refs
-(
- ipc_space_t task,
- mach_port_name_t name,
- mach_port_right_t right,
- mach_port_delta_t delta
-);
-
-/* Routine mach_port_peek */
-#ifdef mig_external
-mig_external
-#else
-extern
-#endif /* mig_external */
-kern_return_t mach_port_peek
-(
- ipc_space_t task,
- mach_port_name_t name,
- mach_msg_trailer_type_t trailer_type,
- mach_port_seqno_t *request_seqnop,
- mach_msg_size_t *msg_sizep,
- mach_msg_id_t *msg_idp,
- mach_msg_trailer_info_t trailer_infop,
- mach_msg_type_number_t *trailer_infopCnt
-);
-
-/* Routine mach_port_set_mscount */
-#ifdef mig_external
-mig_external
-#else
-extern
-#endif /* mig_external */
-kern_return_t mach_port_set_mscount
-(
- ipc_space_t task,
- mach_port_name_t name,
- mach_port_mscount_t mscount
-);
-
-/* Routine mach_port_get_set_status */
-#ifdef mig_external
-mig_external
-#else
-extern
-#endif /* mig_external */
-kern_return_t mach_port_get_set_status
-(
- ipc_space_inspect_t task,
- mach_port_name_t name,
- mach_port_name_array_t *members,
- mach_msg_type_number_t *membersCnt
-);
-
-/* Routine mach_port_move_member */
-#ifdef mig_external
-mig_external
-#else
-extern
-#endif /* mig_external */
-kern_return_t mach_port_move_member
-(
- ipc_space_t task,
- mach_port_name_t member,
- mach_port_name_t after
-);
-
-/* Routine mach_port_request_notification */
-#ifdef mig_external
-mig_external
-#else
-extern
-#endif /* mig_external */
-kern_return_t mach_port_request_notification
-(
- ipc_space_t task,
- mach_port_name_t name,
- mach_msg_id_t msgid,
- mach_port_mscount_t sync,
- mach_port_t notify,
- mach_msg_type_name_t notifyPoly,
- mach_port_t *previous
-);
-
-/* Routine mach_port_insert_right */
-#ifdef mig_external
-mig_external
-#else
-extern
-#endif /* mig_external */
-kern_return_t mach_port_insert_right
-(
- ipc_space_t task,
- mach_port_name_t name,
- mach_port_t poly,
- mach_msg_type_name_t polyPoly
-);
-
-/* Routine mach_port_extract_right */
-#ifdef mig_external
-mig_external
-#else
-extern
-#endif /* mig_external */
-kern_return_t mach_port_extract_right
-(
- ipc_space_t task,
- mach_port_name_t name,
- mach_msg_type_name_t msgt_name,
- mach_port_t *poly,
- mach_msg_type_name_t *polyPoly
-);
-
-/* Routine mach_port_set_seqno */
-#ifdef mig_external
-mig_external
-#else
-extern
-#endif /* mig_external */
-kern_return_t mach_port_set_seqno
-(
- ipc_space_t task,
- mach_port_name_t name,
- mach_port_seqno_t seqno
-);
-
-/* Routine mach_port_get_attributes */
-#ifdef mig_external
-mig_external
-#else
-extern
-#endif /* mig_external */
-kern_return_t mach_port_get_attributes
-(
- ipc_space_inspect_t task,
- mach_port_name_t name,
- mach_port_flavor_t flavor,
- mach_port_info_t port_info_out,
- mach_msg_type_number_t *port_info_outCnt
-);
-
-/* Routine mach_port_set_attributes */
-#ifdef mig_external
-mig_external
-#else
-extern
-#endif /* mig_external */
-kern_return_t mach_port_set_attributes
-(
- ipc_space_t task,
- mach_port_name_t name,
- mach_port_flavor_t flavor,
- mach_port_info_t port_info,
- mach_msg_type_number_t port_infoCnt
-);
-
-/* Routine mach_port_allocate_qos */
-#ifdef mig_external
-mig_external
-#else
-extern
-#endif /* mig_external */
-kern_return_t mach_port_allocate_qos
-(
- ipc_space_t task,
- mach_port_right_t right,
- mach_port_qos_t *qos,
- mach_port_name_t *name
-);
-
-/* Routine mach_port_allocate_full */
-#ifdef mig_external
-mig_external
-#else
-extern
-#endif /* mig_external */
-kern_return_t mach_port_allocate_full
-(
- ipc_space_t task,
- mach_port_right_t right,
- mach_port_t proto,
- mach_port_qos_t *qos,
- mach_port_name_t *name
-);
-
-/* Routine task_set_port_space */
-#ifdef mig_external
-mig_external
-#else
-extern
-#endif /* mig_external */
-__WATCHOS_PROHIBITED
-__TVOS_PROHIBITED
-kern_return_t task_set_port_space
-(
- ipc_space_t task,
- int table_entries
-);
-
-/* Routine mach_port_get_srights */
-#ifdef mig_external
-mig_external
-#else
-extern
-#endif /* mig_external */
-kern_return_t mach_port_get_srights
-(
- ipc_space_t task,
- mach_port_name_t name,
- mach_port_rights_t *srights
-);
-
-/* Routine mach_port_space_info */
-#ifdef mig_external
-mig_external
-#else
-extern
-#endif /* mig_external */
-kern_return_t mach_port_space_info
-(
- ipc_space_inspect_t task,
- ipc_info_space_t *space_info,
- ipc_info_name_array_t *table_info,
- mach_msg_type_number_t *table_infoCnt,
- ipc_info_tree_name_array_t *tree_info,
- mach_msg_type_number_t *tree_infoCnt
-);
-
-/* Routine mach_port_dnrequest_info */
-#ifdef mig_external
-mig_external
-#else
-extern
-#endif /* mig_external */
-kern_return_t mach_port_dnrequest_info
-(
- ipc_space_t task,
- mach_port_name_t name,
- unsigned *dnr_total,
- unsigned *dnr_used
-);
-
-/* Routine mach_port_kernel_object */
-#ifdef mig_external
-mig_external
-#else
-extern
-#endif /* mig_external */
-kern_return_t mach_port_kernel_object
-(
- ipc_space_inspect_t task,
- mach_port_name_t name,
- unsigned *object_type,
- unsigned *object_addr
-);
-
-/* Routine mach_port_insert_member */
-#ifdef mig_external
-mig_external
-#else
-extern
-#endif /* mig_external */
-kern_return_t mach_port_insert_member
-(
- ipc_space_t task,
- mach_port_name_t name,
- mach_port_name_t pset
-);
-
-/* Routine mach_port_extract_member */
-#ifdef mig_external
-mig_external
-#else
-extern
-#endif /* mig_external */
-kern_return_t mach_port_extract_member
-(
- ipc_space_t task,
- mach_port_name_t name,
- mach_port_name_t pset
-);
-
-/* Routine mach_port_get_context */
-#ifdef mig_external
-mig_external
-#else
-extern
-#endif /* mig_external */
-kern_return_t mach_port_get_context
-(
- ipc_space_inspect_t task,
- mach_port_name_t name,
- mach_port_context_t *context
-);
-
-/* Routine mach_port_set_context */
-#ifdef mig_external
-mig_external
-#else
-extern
-#endif /* mig_external */
-kern_return_t mach_port_set_context
-(
- ipc_space_t task,
- mach_port_name_t name,
- mach_port_context_t context
-);
-
-/* Routine mach_port_kobject */
-#ifdef mig_external
-mig_external
-#else
-extern
-#endif /* mig_external */
-kern_return_t mach_port_kobject
-(
- ipc_space_inspect_t task,
- mach_port_name_t name,
- natural_t *object_type,
- mach_vm_address_t *object_addr
-);
-
-/* Routine mach_port_construct */
-#ifdef mig_external
-mig_external
-#else
-extern
-#endif /* mig_external */
-kern_return_t mach_port_construct
-(
- ipc_space_t task,
- mach_port_options_ptr_t options,
- mach_port_context_t context,
- mach_port_name_t *name
-);
-
-/* Routine mach_port_destruct */
-#ifdef mig_external
-mig_external
-#else
-extern
-#endif /* mig_external */
-kern_return_t mach_port_destruct
-(
- ipc_space_t task,
- mach_port_name_t name,
- mach_port_delta_t srdelta,
- mach_port_context_t guard
-);
-
-/* Routine mach_port_guard */
-#ifdef mig_external
-mig_external
-#else
-extern
-#endif /* mig_external */
-kern_return_t mach_port_guard
-(
- ipc_space_t task,
- mach_port_name_t name,
- mach_port_context_t guard,
- boolean_t strict
-);
-
-/* Routine mach_port_unguard */
-#ifdef mig_external
-mig_external
-#else
-extern
-#endif /* mig_external */
-kern_return_t mach_port_unguard
-(
- ipc_space_t task,
- mach_port_name_t name,
- mach_port_context_t guard
-);
-
-/* Routine mach_port_space_basic_info */
-#ifdef mig_external
-mig_external
-#else
-extern
-#endif /* mig_external */
-kern_return_t mach_port_space_basic_info
-(
- ipc_space_inspect_t task,
- ipc_info_space_basic_t *basic_info
-);
-
-/* Routine mach_port_guard_with_flags */
-#ifdef mig_external
-mig_external
-#else
-extern
-#endif /* mig_external */
-kern_return_t mach_port_guard_with_flags
-(
- ipc_space_t task,
- mach_port_name_t name,
- mach_port_context_t guard,
- uint64_t flags
-);
-
-/* Routine mach_port_swap_guard */
-#ifdef mig_external
-mig_external
-#else
-extern
-#endif /* mig_external */
-kern_return_t mach_port_swap_guard
-(
- ipc_space_t task,
- mach_port_name_t name,
- mach_port_context_t old_guard,
- mach_port_context_t new_guard
-);
-
-/* Routine mach_port_kobject_description */
-#ifdef mig_external
-mig_external
-#else
-extern
-#endif /* mig_external */
-kern_return_t mach_port_kobject_description
-(
- ipc_space_inspect_t task,
- mach_port_name_t name,
- natural_t *object_type,
- mach_vm_address_t *object_addr,
- kobject_description_t description
-);
-
-__END_DECLS
-
-/********************** Caution **************************/
-/* The following data types should be used to calculate */
-/* maximum message sizes only. The actual message may be */
-/* smaller, and the position of the arguments within the */
-/* message layout may vary from what is presented here. */
-/* For example, if any of the arguments are variable- */
-/* sized, and less than the maximum is sent, the data */
-/* will be packed tight in the actual message to reduce */
-/* the presence of holes. */
-/********************** Caution **************************/
-
-/* typedefs for all requests */
-
-#ifndef __Request__mach_port_subsystem__defined
-#define __Request__mach_port_subsystem__defined
-
-#ifdef __MigPackStructs
-#pragma pack(push, 4)
-#endif
- typedef struct {
- mach_msg_header_t Head;
- } __Request__mach_port_names_t __attribute__((unused));
-#ifdef __MigPackStructs
-#pragma pack(pop)
-#endif
-
-#ifdef __MigPackStructs
-#pragma pack(push, 4)
-#endif
- typedef struct {
- mach_msg_header_t Head;
- NDR_record_t NDR;
- mach_port_name_t name;
- } __Request__mach_port_type_t __attribute__((unused));
-#ifdef __MigPackStructs
-#pragma pack(pop)
-#endif
-
-#ifdef __MigPackStructs
-#pragma pack(push, 4)
-#endif
- typedef struct {
- mach_msg_header_t Head;
- NDR_record_t NDR;
- mach_port_name_t old_name;
- mach_port_name_t new_name;
- } __Request__mach_port_rename_t __attribute__((unused));
-#ifdef __MigPackStructs
-#pragma pack(pop)
-#endif
-
-#ifdef __MigPackStructs
-#pragma pack(push, 4)
-#endif
- typedef struct {
- mach_msg_header_t Head;
- NDR_record_t NDR;
- mach_port_right_t right;
- mach_port_name_t name;
- } __Request__mach_port_allocate_name_t __attribute__((unused));
-#ifdef __MigPackStructs
-#pragma pack(pop)
-#endif
-
-#ifdef __MigPackStructs
-#pragma pack(push, 4)
-#endif
- typedef struct {
- mach_msg_header_t Head;
- NDR_record_t NDR;
- mach_port_right_t right;
- } __Request__mach_port_allocate_t __attribute__((unused));
-#ifdef __MigPackStructs
-#pragma pack(pop)
-#endif
-
-#ifdef __MigPackStructs
-#pragma pack(push, 4)
-#endif
- typedef struct {
- mach_msg_header_t Head;
- NDR_record_t NDR;
- mach_port_name_t name;
- } __Request__mach_port_destroy_t __attribute__((unused));
-#ifdef __MigPackStructs
-#pragma pack(pop)
-#endif
-
-#ifdef __MigPackStructs
-#pragma pack(push, 4)
-#endif
- typedef struct {
- mach_msg_header_t Head;
- NDR_record_t NDR;
- mach_port_name_t name;
- } __Request__mach_port_deallocate_t __attribute__((unused));
-#ifdef __MigPackStructs
-#pragma pack(pop)
-#endif
-
-#ifdef __MigPackStructs
-#pragma pack(push, 4)
-#endif
- typedef struct {
- mach_msg_header_t Head;
- NDR_record_t NDR;
- mach_port_name_t name;
- mach_port_right_t right;
- } __Request__mach_port_get_refs_t __attribute__((unused));
-#ifdef __MigPackStructs
-#pragma pack(pop)
-#endif
-
-#ifdef __MigPackStructs
-#pragma pack(push, 4)
-#endif
- typedef struct {
- mach_msg_header_t Head;
- NDR_record_t NDR;
- mach_port_name_t name;
- mach_port_right_t right;
- mach_port_delta_t delta;
- } __Request__mach_port_mod_refs_t __attribute__((unused));
-#ifdef __MigPackStructs
-#pragma pack(pop)
-#endif
-
-#ifdef __MigPackStructs
-#pragma pack(push, 4)
-#endif
- typedef struct {
- mach_msg_header_t Head;
- NDR_record_t NDR;
- mach_port_name_t name;
- mach_msg_trailer_type_t trailer_type;
- mach_port_seqno_t request_seqnop;
- mach_msg_type_number_t trailer_infopCnt;
- } __Request__mach_port_peek_t __attribute__((unused));
-#ifdef __MigPackStructs
-#pragma pack(pop)
-#endif
-
-#ifdef __MigPackStructs
-#pragma pack(push, 4)
-#endif
- typedef struct {
- mach_msg_header_t Head;
- NDR_record_t NDR;
- mach_port_name_t name;
- mach_port_mscount_t mscount;
- } __Request__mach_port_set_mscount_t __attribute__((unused));
-#ifdef __MigPackStructs
-#pragma pack(pop)
-#endif
-
-#ifdef __MigPackStructs
-#pragma pack(push, 4)
-#endif
- typedef struct {
- mach_msg_header_t Head;
- NDR_record_t NDR;
- mach_port_name_t name;
- } __Request__mach_port_get_set_status_t __attribute__((unused));
-#ifdef __MigPackStructs
-#pragma pack(pop)
-#endif
-
-#ifdef __MigPackStructs
-#pragma pack(push, 4)
-#endif
- typedef struct {
- mach_msg_header_t Head;
- NDR_record_t NDR;
- mach_port_name_t member;
- mach_port_name_t after;
- } __Request__mach_port_move_member_t __attribute__((unused));
-#ifdef __MigPackStructs
-#pragma pack(pop)
-#endif
-
-#ifdef __MigPackStructs
-#pragma pack(push, 4)
-#endif
- typedef struct {
- mach_msg_header_t Head;
- /* start of the kernel processed data */
- mach_msg_body_t msgh_body;
- mach_msg_port_descriptor_t notify;
- /* end of the kernel processed data */
- NDR_record_t NDR;
- mach_port_name_t name;
- mach_msg_id_t msgid;
- mach_port_mscount_t sync;
- } __Request__mach_port_request_notification_t __attribute__((unused));
-#ifdef __MigPackStructs
-#pragma pack(pop)
-#endif
-
-#ifdef __MigPackStructs
-#pragma pack(push, 4)
-#endif
- typedef struct {
- mach_msg_header_t Head;
- /* start of the kernel processed data */
- mach_msg_body_t msgh_body;
- mach_msg_port_descriptor_t poly;
- /* end of the kernel processed data */
- NDR_record_t NDR;
- mach_port_name_t name;
- } __Request__mach_port_insert_right_t __attribute__((unused));
-#ifdef __MigPackStructs
-#pragma pack(pop)
-#endif
-
-#ifdef __MigPackStructs
-#pragma pack(push, 4)
-#endif
- typedef struct {
- mach_msg_header_t Head;
- NDR_record_t NDR;
- mach_port_name_t name;
- mach_msg_type_name_t msgt_name;
- } __Request__mach_port_extract_right_t __attribute__((unused));
-#ifdef __MigPackStructs
-#pragma pack(pop)
-#endif
-
-#ifdef __MigPackStructs
-#pragma pack(push, 4)
-#endif
- typedef struct {
- mach_msg_header_t Head;
- NDR_record_t NDR;
- mach_port_name_t name;
- mach_port_seqno_t seqno;
- } __Request__mach_port_set_seqno_t __attribute__((unused));
-#ifdef __MigPackStructs
-#pragma pack(pop)
-#endif
-
-#ifdef __MigPackStructs
-#pragma pack(push, 4)
-#endif
- typedef struct {
- mach_msg_header_t Head;
- NDR_record_t NDR;
- mach_port_name_t name;
- mach_port_flavor_t flavor;
- mach_msg_type_number_t port_info_outCnt;
- } __Request__mach_port_get_attributes_t __attribute__((unused));
-#ifdef __MigPackStructs
-#pragma pack(pop)
-#endif
-
-#ifdef __MigPackStructs
-#pragma pack(push, 4)
-#endif
- typedef struct {
- mach_msg_header_t Head;
- NDR_record_t NDR;
- mach_port_name_t name;
- mach_port_flavor_t flavor;
- mach_msg_type_number_t port_infoCnt;
- integer_t port_info[17];
- } __Request__mach_port_set_attributes_t __attribute__((unused));
-#ifdef __MigPackStructs
-#pragma pack(pop)
-#endif
-
-#ifdef __MigPackStructs
-#pragma pack(push, 4)
-#endif
- typedef struct {
- mach_msg_header_t Head;
- NDR_record_t NDR;
- mach_port_right_t right;
- mach_port_qos_t qos;
- } __Request__mach_port_allocate_qos_t __attribute__((unused));
-#ifdef __MigPackStructs
-#pragma pack(pop)
-#endif
-
-#ifdef __MigPackStructs
-#pragma pack(push, 4)
-#endif
- typedef struct {
- mach_msg_header_t Head;
- /* start of the kernel processed data */
- mach_msg_body_t msgh_body;
- mach_msg_port_descriptor_t proto;
- /* end of the kernel processed data */
- NDR_record_t NDR;
- mach_port_right_t right;
- mach_port_qos_t qos;
- mach_port_name_t name;
- } __Request__mach_port_allocate_full_t __attribute__((unused));
-#ifdef __MigPackStructs
-#pragma pack(pop)
-#endif
-
-#ifdef __MigPackStructs
-#pragma pack(push, 4)
-#endif
- typedef struct {
- mach_msg_header_t Head;
- NDR_record_t NDR;
- int table_entries;
- } __Request__task_set_port_space_t __attribute__((unused));
-#ifdef __MigPackStructs
-#pragma pack(pop)
-#endif
-
-#ifdef __MigPackStructs
-#pragma pack(push, 4)
-#endif
- typedef struct {
- mach_msg_header_t Head;
- NDR_record_t NDR;
- mach_port_name_t name;
- } __Request__mach_port_get_srights_t __attribute__((unused));
-#ifdef __MigPackStructs
-#pragma pack(pop)
-#endif
-
-#ifdef __MigPackStructs
-#pragma pack(push, 4)
-#endif
- typedef struct {
- mach_msg_header_t Head;
- } __Request__mach_port_space_info_t __attribute__((unused));
-#ifdef __MigPackStructs
-#pragma pack(pop)
-#endif
-
-#ifdef __MigPackStructs
-#pragma pack(push, 4)
-#endif
- typedef struct {
- mach_msg_header_t Head;
- NDR_record_t NDR;
- mach_port_name_t name;
- } __Request__mach_port_dnrequest_info_t __attribute__((unused));
-#ifdef __MigPackStructs
-#pragma pack(pop)
-#endif
-
-#ifdef __MigPackStructs
-#pragma pack(push, 4)
-#endif
- typedef struct {
- mach_msg_header_t Head;
- NDR_record_t NDR;
- mach_port_name_t name;
- } __Request__mach_port_kernel_object_t __attribute__((unused));
-#ifdef __MigPackStructs
-#pragma pack(pop)
-#endif
-
-#ifdef __MigPackStructs
-#pragma pack(push, 4)
-#endif
- typedef struct {
- mach_msg_header_t Head;
- NDR_record_t NDR;
- mach_port_name_t name;
- mach_port_name_t pset;
- } __Request__mach_port_insert_member_t __attribute__((unused));
-#ifdef __MigPackStructs
-#pragma pack(pop)
-#endif
-
-#ifdef __MigPackStructs
-#pragma pack(push, 4)
-#endif
- typedef struct {
- mach_msg_header_t Head;
- NDR_record_t NDR;
- mach_port_name_t name;
- mach_port_name_t pset;
- } __Request__mach_port_extract_member_t __attribute__((unused));
-#ifdef __MigPackStructs
-#pragma pack(pop)
-#endif
-
-#ifdef __MigPackStructs
-#pragma pack(push, 4)
-#endif
- typedef struct {
- mach_msg_header_t Head;
- NDR_record_t NDR;
- mach_port_name_t name;
- } __Request__mach_port_get_context_t __attribute__((unused));
-#ifdef __MigPackStructs
-#pragma pack(pop)
-#endif
-
-#ifdef __MigPackStructs
-#pragma pack(push, 4)
-#endif
- typedef struct {
- mach_msg_header_t Head;
- NDR_record_t NDR;
- mach_port_name_t name;
- mach_port_context_t context;
- } __Request__mach_port_set_context_t __attribute__((unused));
-#ifdef __MigPackStructs
-#pragma pack(pop)
-#endif
-
-#ifdef __MigPackStructs
-#pragma pack(push, 4)
-#endif
- typedef struct {
- mach_msg_header_t Head;
- NDR_record_t NDR;
- mach_port_name_t name;
- } __Request__mach_port_kobject_t __attribute__((unused));
-#ifdef __MigPackStructs
-#pragma pack(pop)
-#endif
-
-#ifdef __MigPackStructs
-#pragma pack(push, 4)
-#endif
- typedef struct {
- mach_msg_header_t Head;
- /* start of the kernel processed data */
- mach_msg_body_t msgh_body;
- mach_msg_ool_descriptor_t options;
- /* end of the kernel processed data */
- NDR_record_t NDR;
- mach_port_context_t context;
- } __Request__mach_port_construct_t __attribute__((unused));
-#ifdef __MigPackStructs
-#pragma pack(pop)
-#endif
-
-#ifdef __MigPackStructs
-#pragma pack(push, 4)
-#endif
- typedef struct {
- mach_msg_header_t Head;
- NDR_record_t NDR;
- mach_port_name_t name;
- mach_port_delta_t srdelta;
- mach_port_context_t guard;
- } __Request__mach_port_destruct_t __attribute__((unused));
-#ifdef __MigPackStructs
-#pragma pack(pop)
-#endif
-
-#ifdef __MigPackStructs
-#pragma pack(push, 4)
-#endif
- typedef struct {
- mach_msg_header_t Head;
- NDR_record_t NDR;
- mach_port_name_t name;
- mach_port_context_t guard;
- boolean_t strict;
- } __Request__mach_port_guard_t __attribute__((unused));
-#ifdef __MigPackStructs
-#pragma pack(pop)
-#endif
-
-#ifdef __MigPackStructs
-#pragma pack(push, 4)
-#endif
- typedef struct {
- mach_msg_header_t Head;
- NDR_record_t NDR;
- mach_port_name_t name;
- mach_port_context_t guard;
- } __Request__mach_port_unguard_t __attribute__((unused));
-#ifdef __MigPackStructs
-#pragma pack(pop)
-#endif
-
-#ifdef __MigPackStructs
-#pragma pack(push, 4)
-#endif
- typedef struct {
- mach_msg_header_t Head;
- } __Request__mach_port_space_basic_info_t __attribute__((unused));
-#ifdef __MigPackStructs
-#pragma pack(pop)
-#endif
-
-#ifdef __MigPackStructs
-#pragma pack(push, 4)
-#endif
- typedef struct {
- mach_msg_header_t Head;
- NDR_record_t NDR;
- mach_port_name_t name;
- mach_port_context_t guard;
- uint64_t flags;
- } __Request__mach_port_guard_with_flags_t __attribute__((unused));
-#ifdef __MigPackStructs
-#pragma pack(pop)
-#endif
-
-#ifdef __MigPackStructs
-#pragma pack(push, 4)
-#endif
- typedef struct {
- mach_msg_header_t Head;
- NDR_record_t NDR;
- mach_port_name_t name;
- mach_port_context_t old_guard;
- mach_port_context_t new_guard;
- } __Request__mach_port_swap_guard_t __attribute__((unused));
-#ifdef __MigPackStructs
-#pragma pack(pop)
-#endif
-
-#ifdef __MigPackStructs
-#pragma pack(push, 4)
-#endif
- typedef struct {
- mach_msg_header_t Head;
- NDR_record_t NDR;
- mach_port_name_t name;
- } __Request__mach_port_kobject_description_t __attribute__((unused));
-#ifdef __MigPackStructs
-#pragma pack(pop)
-#endif
-#endif /* !__Request__mach_port_subsystem__defined */
-
-/* union of all requests */
-
-#ifndef __RequestUnion__mach_port_subsystem__defined
-#define __RequestUnion__mach_port_subsystem__defined
-union __RequestUnion__mach_port_subsystem {
- __Request__mach_port_names_t Request_mach_port_names;
- __Request__mach_port_type_t Request_mach_port_type;
- __Request__mach_port_rename_t Request_mach_port_rename;
- __Request__mach_port_allocate_name_t Request_mach_port_allocate_name;
- __Request__mach_port_allocate_t Request_mach_port_allocate;
- __Request__mach_port_destroy_t Request_mach_port_destroy;
- __Request__mach_port_deallocate_t Request_mach_port_deallocate;
- __Request__mach_port_get_refs_t Request_mach_port_get_refs;
- __Request__mach_port_mod_refs_t Request_mach_port_mod_refs;
- __Request__mach_port_peek_t Request_mach_port_peek;
- __Request__mach_port_set_mscount_t Request_mach_port_set_mscount;
- __Request__mach_port_get_set_status_t Request_mach_port_get_set_status;
- __Request__mach_port_move_member_t Request_mach_port_move_member;
- __Request__mach_port_request_notification_t Request_mach_port_request_notification;
- __Request__mach_port_insert_right_t Request_mach_port_insert_right;
- __Request__mach_port_extract_right_t Request_mach_port_extract_right;
- __Request__mach_port_set_seqno_t Request_mach_port_set_seqno;
- __Request__mach_port_get_attributes_t Request_mach_port_get_attributes;
- __Request__mach_port_set_attributes_t Request_mach_port_set_attributes;
- __Request__mach_port_allocate_qos_t Request_mach_port_allocate_qos;
- __Request__mach_port_allocate_full_t Request_mach_port_allocate_full;
- __Request__task_set_port_space_t Request_task_set_port_space;
- __Request__mach_port_get_srights_t Request_mach_port_get_srights;
- __Request__mach_port_space_info_t Request_mach_port_space_info;
- __Request__mach_port_dnrequest_info_t Request_mach_port_dnrequest_info;
- __Request__mach_port_kernel_object_t Request_mach_port_kernel_object;
- __Request__mach_port_insert_member_t Request_mach_port_insert_member;
- __Request__mach_port_extract_member_t Request_mach_port_extract_member;
- __Request__mach_port_get_context_t Request_mach_port_get_context;
- __Request__mach_port_set_context_t Request_mach_port_set_context;
- __Request__mach_port_kobject_t Request_mach_port_kobject;
- __Request__mach_port_construct_t Request_mach_port_construct;
- __Request__mach_port_destruct_t Request_mach_port_destruct;
- __Request__mach_port_guard_t Request_mach_port_guard;
- __Request__mach_port_unguard_t Request_mach_port_unguard;
- __Request__mach_port_space_basic_info_t Request_mach_port_space_basic_info;
- __Request__mach_port_guard_with_flags_t Request_mach_port_guard_with_flags;
- __Request__mach_port_swap_guard_t Request_mach_port_swap_guard;
- __Request__mach_port_kobject_description_t Request_mach_port_kobject_description;
-};
-#endif /* !__RequestUnion__mach_port_subsystem__defined */
-/* typedefs for all replies */
-
-#ifndef __Reply__mach_port_subsystem__defined
-#define __Reply__mach_port_subsystem__defined
-
-#ifdef __MigPackStructs
-#pragma pack(push, 4)
-#endif
- typedef struct {
- mach_msg_header_t Head;
- /* start of the kernel processed data */
- mach_msg_body_t msgh_body;
- mach_msg_ool_descriptor_t names;
- mach_msg_ool_descriptor_t types;
- /* end of the kernel processed data */
- NDR_record_t NDR;
- mach_msg_type_number_t namesCnt;
- mach_msg_type_number_t typesCnt;
- } __Reply__mach_port_names_t __attribute__((unused));
-#ifdef __MigPackStructs
-#pragma pack(pop)
-#endif
-
-#ifdef __MigPackStructs
-#pragma pack(push, 4)
-#endif
- typedef struct {
- mach_msg_header_t Head;
- NDR_record_t NDR;
- kern_return_t RetCode;
- mach_port_type_t ptype;
- } __Reply__mach_port_type_t __attribute__((unused));
-#ifdef __MigPackStructs
-#pragma pack(pop)
-#endif
-
-#ifdef __MigPackStructs
-#pragma pack(push, 4)
-#endif
- typedef struct {
- mach_msg_header_t Head;
- NDR_record_t NDR;
- kern_return_t RetCode;
- } __Reply__mach_port_rename_t __attribute__((unused));
-#ifdef __MigPackStructs
-#pragma pack(pop)
-#endif
-
-#ifdef __MigPackStructs
-#pragma pack(push, 4)
-#endif
- typedef struct {
- mach_msg_header_t Head;
- NDR_record_t NDR;
- kern_return_t RetCode;
- } __Reply__mach_port_allocate_name_t __attribute__((unused));
-#ifdef __MigPackStructs
-#pragma pack(pop)
-#endif
-
-#ifdef __MigPackStructs
-#pragma pack(push, 4)
-#endif
- typedef struct {
- mach_msg_header_t Head;
- NDR_record_t NDR;
- kern_return_t RetCode;
- mach_port_name_t name;
- } __Reply__mach_port_allocate_t __attribute__((unused));
-#ifdef __MigPackStructs
-#pragma pack(pop)
-#endif
-
-#ifdef __MigPackStructs
-#pragma pack(push, 4)
-#endif
- typedef struct {
- mach_msg_header_t Head;
- NDR_record_t NDR;
- kern_return_t RetCode;
- } __Reply__mach_port_destroy_t __attribute__((unused));
-#ifdef __MigPackStructs
-#pragma pack(pop)
-#endif
-
-#ifdef __MigPackStructs
-#pragma pack(push, 4)
-#endif
- typedef struct {
- mach_msg_header_t Head;
- NDR_record_t NDR;
- kern_return_t RetCode;
- } __Reply__mach_port_deallocate_t __attribute__((unused));
-#ifdef __MigPackStructs
-#pragma pack(pop)
-#endif
-
-#ifdef __MigPackStructs
-#pragma pack(push, 4)
-#endif
- typedef struct {
- mach_msg_header_t Head;
- NDR_record_t NDR;
- kern_return_t RetCode;
- mach_port_urefs_t refs;
- } __Reply__mach_port_get_refs_t __attribute__((unused));
-#ifdef __MigPackStructs
-#pragma pack(pop)
-#endif
-
-#ifdef __MigPackStructs
-#pragma pack(push, 4)
-#endif
- typedef struct {
- mach_msg_header_t Head;
- NDR_record_t NDR;
- kern_return_t RetCode;
- } __Reply__mach_port_mod_refs_t __attribute__((unused));
-#ifdef __MigPackStructs
-#pragma pack(pop)
-#endif
-
-#ifdef __MigPackStructs
-#pragma pack(push, 4)
-#endif
- typedef struct {
- mach_msg_header_t Head;
- NDR_record_t NDR;
- kern_return_t RetCode;
- mach_port_seqno_t request_seqnop;
- mach_msg_size_t msg_sizep;
- mach_msg_id_t msg_idp;
- mach_msg_type_number_t trailer_infopCnt;
- char trailer_infop[68];
- } __Reply__mach_port_peek_t __attribute__((unused));
-#ifdef __MigPackStructs
-#pragma pack(pop)
-#endif
-
-#ifdef __MigPackStructs
-#pragma pack(push, 4)
-#endif
- typedef struct {
- mach_msg_header_t Head;
- NDR_record_t NDR;
- kern_return_t RetCode;
- } __Reply__mach_port_set_mscount_t __attribute__((unused));
-#ifdef __MigPackStructs
-#pragma pack(pop)
-#endif
-
-#ifdef __MigPackStructs
-#pragma pack(push, 4)
-#endif
- typedef struct {
- mach_msg_header_t Head;
- /* start of the kernel processed data */
- mach_msg_body_t msgh_body;
- mach_msg_ool_descriptor_t members;
- /* end of the kernel processed data */
- NDR_record_t NDR;
- mach_msg_type_number_t membersCnt;
- } __Reply__mach_port_get_set_status_t __attribute__((unused));
-#ifdef __MigPackStructs
-#pragma pack(pop)
-#endif
-
-#ifdef __MigPackStructs
-#pragma pack(push, 4)
-#endif
- typedef struct {
- mach_msg_header_t Head;
- NDR_record_t NDR;
- kern_return_t RetCode;
- } __Reply__mach_port_move_member_t __attribute__((unused));
-#ifdef __MigPackStructs
-#pragma pack(pop)
-#endif
-
-#ifdef __MigPackStructs
-#pragma pack(push, 4)
-#endif
- typedef struct {
- mach_msg_header_t Head;
- /* start of the kernel processed data */
- mach_msg_body_t msgh_body;
- mach_msg_port_descriptor_t previous;
- /* end of the kernel processed data */
- } __Reply__mach_port_request_notification_t __attribute__((unused));
-#ifdef __MigPackStructs
-#pragma pack(pop)
-#endif
-
-#ifdef __MigPackStructs
-#pragma pack(push, 4)
-#endif
- typedef struct {
- mach_msg_header_t Head;
- NDR_record_t NDR;
- kern_return_t RetCode;
- } __Reply__mach_port_insert_right_t __attribute__((unused));
-#ifdef __MigPackStructs
-#pragma pack(pop)
-#endif
-
-#ifdef __MigPackStructs
-#pragma pack(push, 4)
-#endif
- typedef struct {
- mach_msg_header_t Head;
- /* start of the kernel processed data */
- mach_msg_body_t msgh_body;
- mach_msg_port_descriptor_t poly;
- /* end of the kernel processed data */
- } __Reply__mach_port_extract_right_t __attribute__((unused));
-#ifdef __MigPackStructs
-#pragma pack(pop)
-#endif
-
-#ifdef __MigPackStructs
-#pragma pack(push, 4)
-#endif
- typedef struct {
- mach_msg_header_t Head;
- NDR_record_t NDR;
- kern_return_t RetCode;
- } __Reply__mach_port_set_seqno_t __attribute__((unused));
-#ifdef __MigPackStructs
-#pragma pack(pop)
-#endif
-
-#ifdef __MigPackStructs
-#pragma pack(push, 4)
-#endif
- typedef struct {
- mach_msg_header_t Head;
- NDR_record_t NDR;
- kern_return_t RetCode;
- mach_msg_type_number_t port_info_outCnt;
- integer_t port_info_out[17];
- } __Reply__mach_port_get_attributes_t __attribute__((unused));
-#ifdef __MigPackStructs
-#pragma pack(pop)
-#endif
-
-#ifdef __MigPackStructs
-#pragma pack(push, 4)
-#endif
- typedef struct {
- mach_msg_header_t Head;
- NDR_record_t NDR;
- kern_return_t RetCode;
- } __Reply__mach_port_set_attributes_t __attribute__((unused));
-#ifdef __MigPackStructs
-#pragma pack(pop)
-#endif
-
-#ifdef __MigPackStructs
-#pragma pack(push, 4)
-#endif
- typedef struct {
- mach_msg_header_t Head;
- NDR_record_t NDR;
- kern_return_t RetCode;
- mach_port_qos_t qos;
- mach_port_name_t name;
- } __Reply__mach_port_allocate_qos_t __attribute__((unused));
-#ifdef __MigPackStructs
-#pragma pack(pop)
-#endif
-
-#ifdef __MigPackStructs
-#pragma pack(push, 4)
-#endif
- typedef struct {
- mach_msg_header_t Head;
- NDR_record_t NDR;
- kern_return_t RetCode;
- mach_port_qos_t qos;
- mach_port_name_t name;
- } __Reply__mach_port_allocate_full_t __attribute__((unused));
-#ifdef __MigPackStructs
-#pragma pack(pop)
-#endif
-
-#ifdef __MigPackStructs
-#pragma pack(push, 4)
-#endif
- typedef struct {
- mach_msg_header_t Head;
- NDR_record_t NDR;
- kern_return_t RetCode;
- } __Reply__task_set_port_space_t __attribute__((unused));
-#ifdef __MigPackStructs
-#pragma pack(pop)
-#endif
-
-#ifdef __MigPackStructs
-#pragma pack(push, 4)
-#endif
- typedef struct {
- mach_msg_header_t Head;
- NDR_record_t NDR;
- kern_return_t RetCode;
- mach_port_rights_t srights;
- } __Reply__mach_port_get_srights_t __attribute__((unused));
-#ifdef __MigPackStructs
-#pragma pack(pop)
-#endif
-
-#ifdef __MigPackStructs
-#pragma pack(push, 4)
-#endif
- typedef struct {
- mach_msg_header_t Head;
- /* start of the kernel processed data */
- mach_msg_body_t msgh_body;
- mach_msg_ool_descriptor_t table_info;
- mach_msg_ool_descriptor_t tree_info;
- /* end of the kernel processed data */
- NDR_record_t NDR;
- ipc_info_space_t space_info;
- mach_msg_type_number_t table_infoCnt;
- mach_msg_type_number_t tree_infoCnt;
- } __Reply__mach_port_space_info_t __attribute__((unused));
-#ifdef __MigPackStructs
-#pragma pack(pop)
-#endif
-
-#ifdef __MigPackStructs
-#pragma pack(push, 4)
-#endif
- typedef struct {
- mach_msg_header_t Head;
- NDR_record_t NDR;
- kern_return_t RetCode;
- unsigned dnr_total;
- unsigned dnr_used;
- } __Reply__mach_port_dnrequest_info_t __attribute__((unused));
-#ifdef __MigPackStructs
-#pragma pack(pop)
-#endif
-
-#ifdef __MigPackStructs
-#pragma pack(push, 4)
-#endif
- typedef struct {
- mach_msg_header_t Head;
- NDR_record_t NDR;
- kern_return_t RetCode;
- unsigned object_type;
- unsigned object_addr;
- } __Reply__mach_port_kernel_object_t __attribute__((unused));
-#ifdef __MigPackStructs
-#pragma pack(pop)
-#endif
-
-#ifdef __MigPackStructs
-#pragma pack(push, 4)
-#endif
- typedef struct {
- mach_msg_header_t Head;
- NDR_record_t NDR;
- kern_return_t RetCode;
- } __Reply__mach_port_insert_member_t __attribute__((unused));
-#ifdef __MigPackStructs
-#pragma pack(pop)
-#endif
-
-#ifdef __MigPackStructs
-#pragma pack(push, 4)
-#endif
- typedef struct {
- mach_msg_header_t Head;
- NDR_record_t NDR;
- kern_return_t RetCode;
- } __Reply__mach_port_extract_member_t __attribute__((unused));
-#ifdef __MigPackStructs
-#pragma pack(pop)
-#endif
-
-#ifdef __MigPackStructs
-#pragma pack(push, 4)
-#endif
- typedef struct {
- mach_msg_header_t Head;
- NDR_record_t NDR;
- kern_return_t RetCode;
- mach_port_context_t context;
- } __Reply__mach_port_get_context_t __attribute__((unused));
-#ifdef __MigPackStructs
-#pragma pack(pop)
-#endif
-
-#ifdef __MigPackStructs
-#pragma pack(push, 4)
-#endif
- typedef struct {
- mach_msg_header_t Head;
- NDR_record_t NDR;
- kern_return_t RetCode;
- } __Reply__mach_port_set_context_t __attribute__((unused));
-#ifdef __MigPackStructs
-#pragma pack(pop)
-#endif
-
-#ifdef __MigPackStructs
-#pragma pack(push, 4)
-#endif
- typedef struct {
- mach_msg_header_t Head;
- NDR_record_t NDR;
- kern_return_t RetCode;
- natural_t object_type;
- mach_vm_address_t object_addr;
- } __Reply__mach_port_kobject_t __attribute__((unused));
-#ifdef __MigPackStructs
-#pragma pack(pop)
-#endif
-
-#ifdef __MigPackStructs
-#pragma pack(push, 4)
-#endif
- typedef struct {
- mach_msg_header_t Head;
- NDR_record_t NDR;
- kern_return_t RetCode;
- mach_port_name_t name;
- } __Reply__mach_port_construct_t __attribute__((unused));
-#ifdef __MigPackStructs
-#pragma pack(pop)
-#endif
-
-#ifdef __MigPackStructs
-#pragma pack(push, 4)
-#endif
- typedef struct {
- mach_msg_header_t Head;
- NDR_record_t NDR;
- kern_return_t RetCode;
- } __Reply__mach_port_destruct_t __attribute__((unused));
-#ifdef __MigPackStructs
-#pragma pack(pop)
-#endif
-
-#ifdef __MigPackStructs
-#pragma pack(push, 4)
-#endif
- typedef struct {
- mach_msg_header_t Head;
- NDR_record_t NDR;
- kern_return_t RetCode;
- } __Reply__mach_port_guard_t __attribute__((unused));
-#ifdef __MigPackStructs
-#pragma pack(pop)
-#endif
-
-#ifdef __MigPackStructs
-#pragma pack(push, 4)
-#endif
- typedef struct {
- mach_msg_header_t Head;
- NDR_record_t NDR;
- kern_return_t RetCode;
- } __Reply__mach_port_unguard_t __attribute__((unused));
-#ifdef __MigPackStructs
-#pragma pack(pop)
-#endif
-
-#ifdef __MigPackStructs
-#pragma pack(push, 4)
-#endif
- typedef struct {
- mach_msg_header_t Head;
- NDR_record_t NDR;
- kern_return_t RetCode;
- ipc_info_space_basic_t basic_info;
- } __Reply__mach_port_space_basic_info_t __attribute__((unused));
-#ifdef __MigPackStructs
-#pragma pack(pop)
-#endif
-
-#ifdef __MigPackStructs
-#pragma pack(push, 4)
-#endif
- typedef struct {
- mach_msg_header_t Head;
- NDR_record_t NDR;
- kern_return_t RetCode;
- } __Reply__mach_port_guard_with_flags_t __attribute__((unused));
-#ifdef __MigPackStructs
-#pragma pack(pop)
-#endif
-
-#ifdef __MigPackStructs
-#pragma pack(push, 4)
-#endif
- typedef struct {
- mach_msg_header_t Head;
- NDR_record_t NDR;
- kern_return_t RetCode;
- } __Reply__mach_port_swap_guard_t __attribute__((unused));
-#ifdef __MigPackStructs
-#pragma pack(pop)
-#endif
-
-#ifdef __MigPackStructs
-#pragma pack(push, 4)
-#endif
- typedef struct {
- mach_msg_header_t Head;
- NDR_record_t NDR;
- kern_return_t RetCode;
- natural_t object_type;
- mach_vm_address_t object_addr;
- mach_msg_type_number_t descriptionOffset; /* MiG doesn't use it */
- mach_msg_type_number_t descriptionCnt;
- char description[512];
- } __Reply__mach_port_kobject_description_t __attribute__((unused));
-#ifdef __MigPackStructs
-#pragma pack(pop)
-#endif
-#endif /* !__Reply__mach_port_subsystem__defined */
-
-/* union of all replies */
-
-#ifndef __ReplyUnion__mach_port_subsystem__defined
-#define __ReplyUnion__mach_port_subsystem__defined
-union __ReplyUnion__mach_port_subsystem {
- __Reply__mach_port_names_t Reply_mach_port_names;
- __Reply__mach_port_type_t Reply_mach_port_type;
- __Reply__mach_port_rename_t Reply_mach_port_rename;
- __Reply__mach_port_allocate_name_t Reply_mach_port_allocate_name;
- __Reply__mach_port_allocate_t Reply_mach_port_allocate;
- __Reply__mach_port_destroy_t Reply_mach_port_destroy;
- __Reply__mach_port_deallocate_t Reply_mach_port_deallocate;
- __Reply__mach_port_get_refs_t Reply_mach_port_get_refs;
- __Reply__mach_port_mod_refs_t Reply_mach_port_mod_refs;
- __Reply__mach_port_peek_t Reply_mach_port_peek;
- __Reply__mach_port_set_mscount_t Reply_mach_port_set_mscount;
- __Reply__mach_port_get_set_status_t Reply_mach_port_get_set_status;
- __Reply__mach_port_move_member_t Reply_mach_port_move_member;
- __Reply__mach_port_request_notification_t Reply_mach_port_request_notification;
- __Reply__mach_port_insert_right_t Reply_mach_port_insert_right;
- __Reply__mach_port_extract_right_t Reply_mach_port_extract_right;
- __Reply__mach_port_set_seqno_t Reply_mach_port_set_seqno;
- __Reply__mach_port_get_attributes_t Reply_mach_port_get_attributes;
- __Reply__mach_port_set_attributes_t Reply_mach_port_set_attributes;
- __Reply__mach_port_allocate_qos_t Reply_mach_port_allocate_qos;
- __Reply__mach_port_allocate_full_t Reply_mach_port_allocate_full;
- __Reply__task_set_port_space_t Reply_task_set_port_space;
- __Reply__mach_port_get_srights_t Reply_mach_port_get_srights;
- __Reply__mach_port_space_info_t Reply_mach_port_space_info;
- __Reply__mach_port_dnrequest_info_t Reply_mach_port_dnrequest_info;
- __Reply__mach_port_kernel_object_t Reply_mach_port_kernel_object;
- __Reply__mach_port_insert_member_t Reply_mach_port_insert_member;
- __Reply__mach_port_extract_member_t Reply_mach_port_extract_member;
- __Reply__mach_port_get_context_t Reply_mach_port_get_context;
- __Reply__mach_port_set_context_t Reply_mach_port_set_context;
- __Reply__mach_port_kobject_t Reply_mach_port_kobject;
- __Reply__mach_port_construct_t Reply_mach_port_construct;
- __Reply__mach_port_destruct_t Reply_mach_port_destruct;
- __Reply__mach_port_guard_t Reply_mach_port_guard;
- __Reply__mach_port_unguard_t Reply_mach_port_unguard;
- __Reply__mach_port_space_basic_info_t Reply_mach_port_space_basic_info;
- __Reply__mach_port_guard_with_flags_t Reply_mach_port_guard_with_flags;
- __Reply__mach_port_swap_guard_t Reply_mach_port_swap_guard;
- __Reply__mach_port_kobject_description_t Reply_mach_port_kobject_description;
-};
-#endif /* !__RequestUnion__mach_port_subsystem__defined */
-
-#ifndef subsystem_to_name_map_mach_port
-#define subsystem_to_name_map_mach_port \
- { "mach_port_names", 3200 },\
- { "mach_port_type", 3201 },\
- { "mach_port_rename", 3202 },\
- { "mach_port_allocate_name", 3203 },\
- { "mach_port_allocate", 3204 },\
- { "mach_port_destroy", 3205 },\
- { "mach_port_deallocate", 3206 },\
- { "mach_port_get_refs", 3207 },\
- { "mach_port_mod_refs", 3208 },\
- { "mach_port_peek", 3209 },\
- { "mach_port_set_mscount", 3210 },\
- { "mach_port_get_set_status", 3211 },\
- { "mach_port_move_member", 3212 },\
- { "mach_port_request_notification", 3213 },\
- { "mach_port_insert_right", 3214 },\
- { "mach_port_extract_right", 3215 },\
- { "mach_port_set_seqno", 3216 },\
- { "mach_port_get_attributes", 3217 },\
- { "mach_port_set_attributes", 3218 },\
- { "mach_port_allocate_qos", 3219 },\
- { "mach_port_allocate_full", 3220 },\
- { "task_set_port_space", 3221 },\
- { "mach_port_get_srights", 3222 },\
- { "mach_port_space_info", 3223 },\
- { "mach_port_dnrequest_info", 3224 },\
- { "mach_port_kernel_object", 3225 },\
- { "mach_port_insert_member", 3226 },\
- { "mach_port_extract_member", 3227 },\
- { "mach_port_get_context", 3228 },\
- { "mach_port_set_context", 3229 },\
- { "mach_port_kobject", 3230 },\
- { "mach_port_construct", 3231 },\
- { "mach_port_destruct", 3232 },\
- { "mach_port_guard", 3233 },\
- { "mach_port_unguard", 3234 },\
- { "mach_port_space_basic_info", 3235 },\
- { "mach_port_guard_with_flags", 3237 },\
- { "mach_port_swap_guard", 3238 },\
- { "mach_port_kobject_description", 3239 }
-#endif
-
-#ifdef __AfterMigUserHeader
-__AfterMigUserHeader
-#endif /* __AfterMigUserHeader */
-
-#endif /* _mach_port_user_ */
\ No newline at end of file
diff --git a/lib/libc/include/x86_64-macos-gnu/mach/mach_traps.h b/lib/libc/include/x86_64-macos-gnu/mach/mach_traps.h
deleted file mode 100644
index d3aaf577ed..0000000000
--- a/lib/libc/include/x86_64-macos-gnu/mach/mach_traps.h
+++ /dev/null
@@ -1,303 +0,0 @@
-/*
- * Copyright (c) 2000-2019 Apple Inc. All rights reserved.
- *
- * @APPLE_OSREFERENCE_LICENSE_HEADER_START@
- *
- * This file contains Original Code and/or Modifications of Original Code
- * as defined in and that are subject to the Apple Public Source License
- * Version 2.0 (the 'License'). You may not use this file except in
- * compliance with the License. The rights granted to you under the License
- * may not be used to create, or enable the creation or redistribution of,
- * unlawful or unlicensed copies of an Apple operating system, or to
- * circumvent, violate, or enable the circumvention or violation of, any
- * terms of an Apple operating system software license agreement.
- *
- * Please obtain a copy of the License at
- * http://www.opensource.apple.com/apsl/ and read it before using this file.
- *
- * The Original Code and all software distributed under the License are
- * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
- * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
- * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
- * Please see the License for the specific language governing rights and
- * limitations under the License.
- *
- * @APPLE_OSREFERENCE_LICENSE_HEADER_END@
- */
-/*
- * @OSF_COPYRIGHT@
- */
-/*
- * Mach Operating System
- * Copyright (c) 1991,1990,1989,1988,1987 Carnegie Mellon University
- * All Rights Reserved.
- *
- * Permission to use, copy, modify and distribute this software and its
- * documentation is hereby granted, provided that both the copyright
- * notice and this permission notice appear in all copies of the
- * software, derivative works or modified versions, and any portions
- * thereof, and that both notices appear in supporting documentation.
- *
- * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS"
- * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR
- * ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE.
- *
- * Carnegie Mellon requests users of this software to return to
- *
- * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU
- * School of Computer Science
- * Carnegie Mellon University
- * Pittsburgh PA 15213-3890
- *
- * any improvements or extensions that they make and grant Carnegie Mellon
- * the rights to redistribute these changes.
- */
-/*
- */
-/*
- * Definitions of general Mach system traps.
- *
- * These are the definitions as seen from user-space.
- * The kernel definitions are in .
- * Kernel RPC functions are defined in .
- */
-
-#ifndef _MACH_MACH_TRAPS_H_
-#define _MACH_MACH_TRAPS_H_
-
-#include
-
-#include
-#include
-#include
-#include
-#include
-#include
-
-#include
-
-#include
-
-__BEGIN_DECLS
-
-
-
-extern kern_return_t clock_sleep_trap(
- mach_port_name_t clock_name,
- sleep_type_t sleep_type,
- int sleep_sec,
- int sleep_nsec,
- mach_timespec_t *wakeup_time);
-
-extern kern_return_t _kernelrpc_mach_vm_allocate_trap(
- mach_port_name_t target,
- mach_vm_offset_t *addr,
- mach_vm_size_t size,
- int flags);
-
-extern kern_return_t _kernelrpc_mach_vm_deallocate_trap(
- mach_port_name_t target,
- mach_vm_address_t address,
- mach_vm_size_t size
- );
-
-extern kern_return_t _kernelrpc_mach_vm_protect_trap(
- mach_port_name_t target,
- mach_vm_address_t address,
- mach_vm_size_t size,
- boolean_t set_maximum,
- vm_prot_t new_protection
- );
-
-extern kern_return_t _kernelrpc_mach_vm_map_trap(
- mach_port_name_t target,
- mach_vm_offset_t *address,
- mach_vm_size_t size,
- mach_vm_offset_t mask,
- int flags,
- vm_prot_t cur_protection
- );
-
-extern kern_return_t _kernelrpc_mach_vm_purgable_control_trap(
- mach_port_name_t target,
- mach_vm_offset_t address,
- vm_purgable_t control,
- int *state);
-
-extern kern_return_t _kernelrpc_mach_port_allocate_trap(
- mach_port_name_t target,
- mach_port_right_t right,
- mach_port_name_t *name
- );
-
-
-extern kern_return_t _kernelrpc_mach_port_destroy_trap(
- mach_port_name_t target,
- mach_port_name_t name
- );
-
-extern kern_return_t _kernelrpc_mach_port_deallocate_trap(
- mach_port_name_t target,
- mach_port_name_t name
- );
-
-extern kern_return_t _kernelrpc_mach_port_mod_refs_trap(
- mach_port_name_t target,
- mach_port_name_t name,
- mach_port_right_t right,
- mach_port_delta_t delta
- );
-
-extern kern_return_t _kernelrpc_mach_port_move_member_trap(
- mach_port_name_t target,
- mach_port_name_t member,
- mach_port_name_t after
- );
-
-extern kern_return_t _kernelrpc_mach_port_insert_right_trap(
- mach_port_name_t target,
- mach_port_name_t name,
- mach_port_name_t poly,
- mach_msg_type_name_t polyPoly
- );
-
-extern kern_return_t _kernelrpc_mach_port_get_attributes_trap(
- mach_port_name_t target,
- mach_port_name_t name,
- mach_port_flavor_t flavor,
- mach_port_info_t port_info_out,
- mach_msg_type_number_t *port_info_outCnt
- );
-
-extern kern_return_t _kernelrpc_mach_port_insert_member_trap(
- mach_port_name_t target,
- mach_port_name_t name,
- mach_port_name_t pset
- );
-
-extern kern_return_t _kernelrpc_mach_port_extract_member_trap(
- mach_port_name_t target,
- mach_port_name_t name,
- mach_port_name_t pset
- );
-
-extern kern_return_t _kernelrpc_mach_port_construct_trap(
- mach_port_name_t target,
- mach_port_options_t *options,
- uint64_t context,
- mach_port_name_t *name
- );
-
-extern kern_return_t _kernelrpc_mach_port_destruct_trap(
- mach_port_name_t target,
- mach_port_name_t name,
- mach_port_delta_t srdelta,
- uint64_t guard
- );
-
-extern kern_return_t _kernelrpc_mach_port_guard_trap(
- mach_port_name_t target,
- mach_port_name_t name,
- uint64_t guard,
- boolean_t strict
- );
-
-extern kern_return_t _kernelrpc_mach_port_unguard_trap(
- mach_port_name_t target,
- mach_port_name_t name,
- uint64_t guard
- );
-
-extern kern_return_t mach_generate_activity_id(
- mach_port_name_t target,
- int count,
- uint64_t *activity_id
- );
-
-extern kern_return_t macx_swapon(
- uint64_t filename,
- int flags,
- int size,
- int priority);
-
-extern kern_return_t macx_swapoff(
- uint64_t filename,
- int flags);
-
-extern kern_return_t macx_triggers(
- int hi_water,
- int low_water,
- int flags,
- mach_port_t alert_port);
-
-extern kern_return_t macx_backing_store_suspend(
- boolean_t suspend);
-
-extern kern_return_t macx_backing_store_recovery(
- int pid);
-
-extern boolean_t swtch_pri(int pri);
-
-extern boolean_t swtch(void);
-
-extern kern_return_t thread_switch(
- mach_port_name_t thread_name,
- int option,
- mach_msg_timeout_t option_time);
-
-extern mach_port_name_t task_self_trap(void);
-
-extern kern_return_t host_create_mach_voucher_trap(
- mach_port_name_t host,
- mach_voucher_attr_raw_recipe_array_t recipes,
- int recipes_size,
- mach_port_name_t *voucher);
-
-extern kern_return_t mach_voucher_extract_attr_recipe_trap(
- mach_port_name_t voucher_name,
- mach_voucher_attr_key_t key,
- mach_voucher_attr_raw_recipe_t recipe,
- mach_msg_type_number_t *recipe_size);
-
-extern kern_return_t _kernelrpc_mach_port_type_trap(
- ipc_space_t task,
- mach_port_name_t name,
- mach_port_type_t *ptype);
-
-extern kern_return_t _kernelrpc_mach_port_request_notification_trap(
- ipc_space_t task,
- mach_port_name_t name,
- mach_msg_id_t msgid,
- mach_port_mscount_t sync,
- mach_port_name_t notify,
- mach_msg_type_name_t notifyPoly,
- mach_port_name_t *previous);
-
-/*
- * Obsolete interfaces.
- */
-
-extern kern_return_t task_for_pid(
- mach_port_name_t target_tport,
- int pid,
- mach_port_name_t *t);
-
-extern kern_return_t task_name_for_pid(
- mach_port_name_t target_tport,
- int pid,
- mach_port_name_t *tn);
-
-extern kern_return_t pid_for_task(
- mach_port_name_t t,
- int *x);
-
-extern kern_return_t debug_control_port_for_pid(
- mach_port_name_t target_tport,
- int pid,
- mach_port_name_t *t);
-
-
-__END_DECLS
-
-#endif /* _MACH_MACH_TRAPS_H_ */
\ No newline at end of file
diff --git a/lib/libc/include/x86_64-macos-gnu/mach/mach_types.h b/lib/libc/include/x86_64-macos-gnu/mach/mach_types.h
deleted file mode 100644
index 0c35705acf..0000000000
--- a/lib/libc/include/x86_64-macos-gnu/mach/mach_types.h
+++ /dev/null
@@ -1,254 +0,0 @@
-/*
- * Copyright (c) 2000-2018 Apple Inc. All rights reserved.
- *
- * @APPLE_OSREFERENCE_LICENSE_HEADER_START@
- *
- * This file contains Original Code and/or Modifications of Original Code
- * as defined in and that are subject to the Apple Public Source License
- * Version 2.0 (the 'License'). You may not use this file except in
- * compliance with the License. The rights granted to you under the License
- * may not be used to create, or enable the creation or redistribution of,
- * unlawful or unlicensed copies of an Apple operating system, or to
- * circumvent, violate, or enable the circumvention or violation of, any
- * terms of an Apple operating system software license agreement.
- *
- * Please obtain a copy of the License at
- * http://www.opensource.apple.com/apsl/ and read it before using this file.
- *
- * The Original Code and all software distributed under the License are
- * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
- * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
- * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
- * Please see the License for the specific language governing rights and
- * limitations under the License.
- *
- * @APPLE_OSREFERENCE_LICENSE_HEADER_END@
- */
-/*
- * @OSF_COPYRIGHT@
- */
-/*
- * Mach Operating System
- * Copyright (c) 1991,1990,1989,1988 Carnegie Mellon University
- * All Rights Reserved.
- *
- * Permission to use, copy, modify and distribute this software and its
- * documentation is hereby granted, provided that both the copyright
- * notice and this permission notice appear in all copies of the
- * software, derivative works or modified versions, and any portions
- * thereof, and that both notices appear in supporting documentation.
- *
- * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS"
- * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR
- * ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE.
- *
- * Carnegie Mellon requests users of this software to return to
- *
- * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU
- * School of Computer Science
- * Carnegie Mellon University
- * Pittsburgh PA 15213-3890
- *
- * any improvements or extensions that they make and grant Carnegie Mellon
- * the rights to redistribute these changes.
- */
-/*
- */
-/*
- * NOTICE: This file was modified by SPARTA, Inc. in 2005 to introduce
- * support for mandatory and extensible security protections. This notice
- * is included in support of clause 2.2 (b) of the Apple Public License,
- * Version 2.0.
- */
-/*
- * File: mach/mach_types.h
- * Author: Avadis Tevanian, Jr., Michael Wayne Young
- * Date: 1986
- *
- * Mach external interface definitions.
- *
- */
-
-#ifndef _MACH_MACH_TYPES_H_
-#define _MACH_MACH_TYPES_H_
-
-#include
-
-#include
-
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-
-
-/*
- * If we are not in the kernel, then these will all be represented by
- * ports at user-space.
- */
-typedef mach_port_t task_t;
-typedef mach_port_t task_name_t;
-typedef mach_port_t task_inspect_t;
-typedef mach_port_t task_suspension_token_t;
-typedef mach_port_t thread_t;
-typedef mach_port_t thread_act_t;
-typedef mach_port_t thread_inspect_t;
-typedef mach_port_t ipc_space_t;
-typedef mach_port_t ipc_space_inspect_t;
-typedef mach_port_t coalition_t;
-typedef mach_port_t host_t;
-typedef mach_port_t host_priv_t;
-typedef mach_port_t host_security_t;
-typedef mach_port_t processor_t;
-typedef mach_port_t processor_set_t;
-typedef mach_port_t processor_set_control_t;
-typedef mach_port_t semaphore_t;
-typedef mach_port_t lock_set_t;
-typedef mach_port_t ledger_t;
-typedef mach_port_t alarm_t;
-typedef mach_port_t clock_serv_t;
-typedef mach_port_t clock_ctrl_t;
-typedef mach_port_t arcade_register_t;
-typedef mach_port_t suid_cred_t;
-
-
-/*
- * These aren't really unique types. They are just called
- * out as unique types at one point in history. So we list
- * them here for compatibility.
- */
-typedef processor_set_t processor_set_name_t;
-
-/*
- * These types are just hard-coded as ports
- */
-typedef mach_port_t clock_reply_t;
-typedef mach_port_t bootstrap_t;
-typedef mach_port_t mem_entry_name_port_t;
-typedef mach_port_t exception_handler_t;
-typedef exception_handler_t *exception_handler_array_t;
-typedef mach_port_t vm_task_entry_t;
-typedef mach_port_t io_master_t;
-typedef mach_port_t UNDServerRef;
-
-/*
- * Mig doesn't translate the components of an array.
- * For example, Mig won't use the thread_t translations
- * to translate a thread_array_t argument. So, these definitions
- * are not completely accurate at the moment for other kernel
- * components.
- */
-typedef task_t *task_array_t;
-typedef thread_t *thread_array_t;
-typedef processor_set_t *processor_set_array_t;
-typedef processor_set_t *processor_set_name_array_t;
-typedef processor_t *processor_array_t;
-typedef thread_act_t *thread_act_array_t;
-typedef ledger_t *ledger_array_t;
-
-/*
- * However the real mach_types got declared, we also have to declare
- * types with "port" in the name for compatability with the way OSF
- * had declared the user interfaces at one point. Someday these should
- * go away.
- */
-typedef task_t task_port_t;
-typedef task_array_t task_port_array_t;
-typedef thread_t thread_port_t;
-typedef thread_array_t thread_port_array_t;
-typedef ipc_space_t ipc_space_port_t;
-typedef host_t host_name_t;
-typedef host_t host_name_port_t;
-typedef processor_set_t processor_set_port_t;
-typedef processor_set_t processor_set_name_port_t;
-typedef processor_set_array_t processor_set_name_port_array_t;
-typedef processor_set_t processor_set_control_port_t;
-typedef processor_t processor_port_t;
-typedef processor_array_t processor_port_array_t;
-typedef thread_act_t thread_act_port_t;
-typedef thread_act_array_t thread_act_port_array_t;
-typedef semaphore_t semaphore_port_t;
-typedef lock_set_t lock_set_port_t;
-typedef ledger_t ledger_port_t;
-typedef ledger_array_t ledger_port_array_t;
-typedef alarm_t alarm_port_t;
-typedef clock_serv_t clock_serv_port_t;
-typedef clock_ctrl_t clock_ctrl_port_t;
-typedef exception_handler_t exception_port_t;
-typedef exception_handler_array_t exception_port_arrary_t;
-typedef char vfs_path_t[4096];
-typedef char nspace_path_t[1024]; /* 1024 == PATH_MAX */
-typedef char suid_cred_path_t[1024];
-typedef uint32_t suid_cred_uid_t;
-
-#define TASK_NULL ((task_t) 0)
-#define TASK_NAME_NULL ((task_name_t) 0)
-#define TASK_INSPECT_NULL ((task_inspect_t) 0)
-#define THREAD_NULL ((thread_t) 0)
-#define THREAD_INSPECT_NULL ((thread_inspect_t) 0)
-#define TID_NULL ((uint64_t) 0)
-#define THR_ACT_NULL ((thread_act_t) 0)
-#define IPC_SPACE_NULL ((ipc_space_t) 0)
-#define IPC_SPACE_INSPECT_NULL ((ipc_space_inspect_t) 0)
-#define COALITION_NULL ((coalition_t) 0)
-#define HOST_NULL ((host_t) 0)
-#define HOST_PRIV_NULL ((host_priv_t) 0)
-#define HOST_SECURITY_NULL ((host_security_t) 0)
-#define PROCESSOR_SET_NULL ((processor_set_t) 0)
-#define PROCESSOR_NULL ((processor_t) 0)
-#define SEMAPHORE_NULL ((semaphore_t) 0)
-#define LOCK_SET_NULL ((lock_set_t) 0)
-#define LEDGER_NULL ((ledger_t) 0)
-#define ALARM_NULL ((alarm_t) 0)
-#define CLOCK_NULL ((clock_t) 0)
-#define UND_SERVER_NULL ((UNDServerRef) 0)
-#define ARCADE_REG_NULL ((arcade_register_t) 0)
-#define SUID_CRED_NULL ((suid_cred_t) 0)
-
-/* DEPRECATED */
-typedef natural_t ledger_item_t;
-#define LEDGER_ITEM_INFINITY ((ledger_item_t) (~0))
-
-typedef int64_t ledger_amount_t;
-#define LEDGER_LIMIT_INFINITY ((ledger_amount_t)((1ULL << 63) - 1))
-
-typedef mach_vm_offset_t *emulation_vector_t;
-typedef char *user_subsystem_t;
-
-typedef char *labelstr_t;
-/*
- * Backwards compatibility, for those programs written
- * before mach/{std,mach}_types.{defs,h} were set up.
- */
-#include
-
-#endif /* _MACH_MACH_TYPES_H_ */
\ No newline at end of file
diff --git a/lib/libc/include/x86_64-macos-gnu/mach/machine.h b/lib/libc/include/x86_64-macos-gnu/mach/machine.h
deleted file mode 100644
index 30aafcc812..0000000000
--- a/lib/libc/include/x86_64-macos-gnu/mach/machine.h
+++ /dev/null
@@ -1,395 +0,0 @@
-/*
- * Copyright (c) 2007-2016 Apple, Inc. All rights reserved.
- * Copyright (c) 2000 Apple Computer, Inc. All rights reserved.
- *
- * @APPLE_OSREFERENCE_LICENSE_HEADER_START@
- *
- * This file contains Original Code and/or Modifications of Original Code
- * as defined in and that are subject to the Apple Public Source License
- * Version 2.0 (the 'License'). You may not use this file except in
- * compliance with the License. The rights granted to you under the License
- * may not be used to create, or enable the creation or redistribution of,
- * unlawful or unlicensed copies of an Apple operating system, or to
- * circumvent, violate, or enable the circumvention or violation of, any
- * terms of an Apple operating system software license agreement.
- *
- * Please obtain a copy of the License at
- * http://www.opensource.apple.com/apsl/ and read it before using this file.
- *
- * The Original Code and all software distributed under the License are
- * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
- * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
- * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
- * Please see the License for the specific language governing rights and
- * limitations under the License.
- *
- * @APPLE_OSREFERENCE_LICENSE_HEADER_END@
- */
-/*
- * Mach Operating System
- * Copyright (c) 1991,1990,1989,1988,1987 Carnegie Mellon University
- * All Rights Reserved.
- *
- * Permission to use, copy, modify and distribute this software and its
- * documentation is hereby granted, provided that both the copyright
- * notice and this permission notice appear in all copies of the
- * software, derivative works or modified versions, and any portions
- * thereof, and that both notices appear in supporting documentation.
- *
- * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS"
- * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR
- * ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE.
- *
- * Carnegie Mellon requests users of this software to return to
- *
- * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU
- * School of Computer Science
- * Carnegie Mellon University
- * Pittsburgh PA 15213-3890
- *
- * any improvements or extensions that they make and grant Carnegie Mellon
- * the rights to redistribute these changes.
- */
-/* File: machine.h
- * Author: Avadis Tevanian, Jr.
- * Date: 1986
- *
- * Machine independent machine abstraction.
- */
-
-#ifndef _MACH_MACHINE_H_
-#define _MACH_MACHINE_H_
-
-#ifndef __ASSEMBLER__
-
-#include
-#include
-#include
-
-typedef integer_t cpu_type_t;
-typedef integer_t cpu_subtype_t;
-typedef integer_t cpu_threadtype_t;
-
-#define CPU_STATE_MAX 4
-
-#define CPU_STATE_USER 0
-#define CPU_STATE_SYSTEM 1
-#define CPU_STATE_IDLE 2
-#define CPU_STATE_NICE 3
-
-
-
-/*
- * Capability bits used in the definition of cpu_type.
- */
-#define CPU_ARCH_MASK 0xff000000 /* mask for architecture bits */
-#define CPU_ARCH_ABI64 0x01000000 /* 64 bit ABI */
-#define CPU_ARCH_ABI64_32 0x02000000 /* ABI for 64-bit hardware with 32-bit types; LP32 */
-
-/*
- * Machine types known by all.
- */
-
-#define CPU_TYPE_ANY ((cpu_type_t) -1)
-
-#define CPU_TYPE_VAX ((cpu_type_t) 1)
-/* skip ((cpu_type_t) 2) */
-/* skip ((cpu_type_t) 3) */
-/* skip ((cpu_type_t) 4) */
-/* skip ((cpu_type_t) 5) */
-#define CPU_TYPE_MC680x0 ((cpu_type_t) 6)
-#define CPU_TYPE_X86 ((cpu_type_t) 7)
-#define CPU_TYPE_I386 CPU_TYPE_X86 /* compatibility */
-#define CPU_TYPE_X86_64 (CPU_TYPE_X86 | CPU_ARCH_ABI64)
-
-/* skip CPU_TYPE_MIPS ((cpu_type_t) 8) */
-/* skip ((cpu_type_t) 9) */
-#define CPU_TYPE_MC98000 ((cpu_type_t) 10)
-#define CPU_TYPE_HPPA ((cpu_type_t) 11)
-#define CPU_TYPE_ARM ((cpu_type_t) 12)
-#define CPU_TYPE_ARM64 (CPU_TYPE_ARM | CPU_ARCH_ABI64)
-#define CPU_TYPE_ARM64_32 (CPU_TYPE_ARM | CPU_ARCH_ABI64_32)
-#define CPU_TYPE_MC88000 ((cpu_type_t) 13)
-#define CPU_TYPE_SPARC ((cpu_type_t) 14)
-#define CPU_TYPE_I860 ((cpu_type_t) 15)
-/* skip CPU_TYPE_ALPHA ((cpu_type_t) 16) */
-/* skip ((cpu_type_t) 17) */
-#define CPU_TYPE_POWERPC ((cpu_type_t) 18)
-#define CPU_TYPE_POWERPC64 (CPU_TYPE_POWERPC | CPU_ARCH_ABI64)
-/* skip ((cpu_type_t) 19) */
-
-/*
- * Machine subtypes (these are defined here, instead of in a machine
- * dependent directory, so that any program can get all definitions
- * regardless of where is it compiled).
- */
-
-/*
- * Capability bits used in the definition of cpu_subtype.
- */
-#define CPU_SUBTYPE_MASK 0xff000000 /* mask for feature flags */
-#define CPU_SUBTYPE_LIB64 0x80000000 /* 64 bit libraries */
-
-
-/*
- * Object files that are hand-crafted to run on any
- * implementation of an architecture are tagged with
- * CPU_SUBTYPE_MULTIPLE. This functions essentially the same as
- * the "ALL" subtype of an architecture except that it allows us
- * to easily find object files that may need to be modified
- * whenever a new implementation of an architecture comes out.
- *
- * It is the responsibility of the implementor to make sure the
- * software handles unsupported implementations elegantly.
- */
-#define CPU_SUBTYPE_MULTIPLE ((cpu_subtype_t) -1)
-#define CPU_SUBTYPE_LITTLE_ENDIAN ((cpu_subtype_t) 0)
-#define CPU_SUBTYPE_BIG_ENDIAN ((cpu_subtype_t) 1)
-
-/*
- * Machine threadtypes.
- * This is none - not defined - for most machine types/subtypes.
- */
-#define CPU_THREADTYPE_NONE ((cpu_threadtype_t) 0)
-
-/*
- * VAX subtypes (these do *not* necessary conform to the actual cpu
- * ID assigned by DEC available via the SID register).
- */
-
-#define CPU_SUBTYPE_VAX_ALL ((cpu_subtype_t) 0)
-#define CPU_SUBTYPE_VAX780 ((cpu_subtype_t) 1)
-#define CPU_SUBTYPE_VAX785 ((cpu_subtype_t) 2)
-#define CPU_SUBTYPE_VAX750 ((cpu_subtype_t) 3)
-#define CPU_SUBTYPE_VAX730 ((cpu_subtype_t) 4)
-#define CPU_SUBTYPE_UVAXI ((cpu_subtype_t) 5)
-#define CPU_SUBTYPE_UVAXII ((cpu_subtype_t) 6)
-#define CPU_SUBTYPE_VAX8200 ((cpu_subtype_t) 7)
-#define CPU_SUBTYPE_VAX8500 ((cpu_subtype_t) 8)
-#define CPU_SUBTYPE_VAX8600 ((cpu_subtype_t) 9)
-#define CPU_SUBTYPE_VAX8650 ((cpu_subtype_t) 10)
-#define CPU_SUBTYPE_VAX8800 ((cpu_subtype_t) 11)
-#define CPU_SUBTYPE_UVAXIII ((cpu_subtype_t) 12)
-
-/*
- * 680x0 subtypes
- *
- * The subtype definitions here are unusual for historical reasons.
- * NeXT used to consider 68030 code as generic 68000 code. For
- * backwards compatability:
- *
- * CPU_SUBTYPE_MC68030 symbol has been preserved for source code
- * compatability.
- *
- * CPU_SUBTYPE_MC680x0_ALL has been defined to be the same
- * subtype as CPU_SUBTYPE_MC68030 for binary comatability.
- *
- * CPU_SUBTYPE_MC68030_ONLY has been added to allow new object
- * files to be tagged as containing 68030-specific instructions.
- */
-
-#define CPU_SUBTYPE_MC680x0_ALL ((cpu_subtype_t) 1)
-#define CPU_SUBTYPE_MC68030 ((cpu_subtype_t) 1) /* compat */
-#define CPU_SUBTYPE_MC68040 ((cpu_subtype_t) 2)
-#define CPU_SUBTYPE_MC68030_ONLY ((cpu_subtype_t) 3)
-
-/*
- * I386 subtypes
- */
-
-#define CPU_SUBTYPE_INTEL(f, m) ((cpu_subtype_t) (f) + ((m) << 4))
-
-#define CPU_SUBTYPE_I386_ALL CPU_SUBTYPE_INTEL(3, 0)
-#define CPU_SUBTYPE_386 CPU_SUBTYPE_INTEL(3, 0)
-#define CPU_SUBTYPE_486 CPU_SUBTYPE_INTEL(4, 0)
-#define CPU_SUBTYPE_486SX CPU_SUBTYPE_INTEL(4, 8) // 8 << 4 = 128
-#define CPU_SUBTYPE_586 CPU_SUBTYPE_INTEL(5, 0)
-#define CPU_SUBTYPE_PENT CPU_SUBTYPE_INTEL(5, 0)
-#define CPU_SUBTYPE_PENTPRO CPU_SUBTYPE_INTEL(6, 1)
-#define CPU_SUBTYPE_PENTII_M3 CPU_SUBTYPE_INTEL(6, 3)
-#define CPU_SUBTYPE_PENTII_M5 CPU_SUBTYPE_INTEL(6, 5)
-#define CPU_SUBTYPE_CELERON CPU_SUBTYPE_INTEL(7, 6)
-#define CPU_SUBTYPE_CELERON_MOBILE CPU_SUBTYPE_INTEL(7, 7)
-#define CPU_SUBTYPE_PENTIUM_3 CPU_SUBTYPE_INTEL(8, 0)
-#define CPU_SUBTYPE_PENTIUM_3_M CPU_SUBTYPE_INTEL(8, 1)
-#define CPU_SUBTYPE_PENTIUM_3_XEON CPU_SUBTYPE_INTEL(8, 2)
-#define CPU_SUBTYPE_PENTIUM_M CPU_SUBTYPE_INTEL(9, 0)
-#define CPU_SUBTYPE_PENTIUM_4 CPU_SUBTYPE_INTEL(10, 0)
-#define CPU_SUBTYPE_PENTIUM_4_M CPU_SUBTYPE_INTEL(10, 1)
-#define CPU_SUBTYPE_ITANIUM CPU_SUBTYPE_INTEL(11, 0)
-#define CPU_SUBTYPE_ITANIUM_2 CPU_SUBTYPE_INTEL(11, 1)
-#define CPU_SUBTYPE_XEON CPU_SUBTYPE_INTEL(12, 0)
-#define CPU_SUBTYPE_XEON_MP CPU_SUBTYPE_INTEL(12, 1)
-
-#define CPU_SUBTYPE_INTEL_FAMILY(x) ((x) & 15)
-#define CPU_SUBTYPE_INTEL_FAMILY_MAX 15
-
-#define CPU_SUBTYPE_INTEL_MODEL(x) ((x) >> 4)
-#define CPU_SUBTYPE_INTEL_MODEL_ALL 0
-
-/*
- * X86 subtypes.
- */
-
-#define CPU_SUBTYPE_X86_ALL ((cpu_subtype_t)3)
-#define CPU_SUBTYPE_X86_64_ALL ((cpu_subtype_t)3)
-#define CPU_SUBTYPE_X86_ARCH1 ((cpu_subtype_t)4)
-#define CPU_SUBTYPE_X86_64_H ((cpu_subtype_t)8) /* Haswell feature subset */
-
-
-#define CPU_THREADTYPE_INTEL_HTT ((cpu_threadtype_t) 1)
-
-/*
- * Mips subtypes.
- */
-
-#define CPU_SUBTYPE_MIPS_ALL ((cpu_subtype_t) 0)
-#define CPU_SUBTYPE_MIPS_R2300 ((cpu_subtype_t) 1)
-#define CPU_SUBTYPE_MIPS_R2600 ((cpu_subtype_t) 2)
-#define CPU_SUBTYPE_MIPS_R2800 ((cpu_subtype_t) 3)
-#define CPU_SUBTYPE_MIPS_R2000a ((cpu_subtype_t) 4) /* pmax */
-#define CPU_SUBTYPE_MIPS_R2000 ((cpu_subtype_t) 5)
-#define CPU_SUBTYPE_MIPS_R3000a ((cpu_subtype_t) 6) /* 3max */
-#define CPU_SUBTYPE_MIPS_R3000 ((cpu_subtype_t) 7)
-
-/*
- * MC98000 (PowerPC) subtypes
- */
-#define CPU_SUBTYPE_MC98000_ALL ((cpu_subtype_t) 0)
-#define CPU_SUBTYPE_MC98601 ((cpu_subtype_t) 1)
-
-/*
- * HPPA subtypes for Hewlett-Packard HP-PA family of
- * risc processors. Port by NeXT to 700 series.
- */
-
-#define CPU_SUBTYPE_HPPA_ALL ((cpu_subtype_t) 0)
-#define CPU_SUBTYPE_HPPA_7100 ((cpu_subtype_t) 0) /* compat */
-#define CPU_SUBTYPE_HPPA_7100LC ((cpu_subtype_t) 1)
-
-/*
- * MC88000 subtypes.
- */
-#define CPU_SUBTYPE_MC88000_ALL ((cpu_subtype_t) 0)
-#define CPU_SUBTYPE_MC88100 ((cpu_subtype_t) 1)
-#define CPU_SUBTYPE_MC88110 ((cpu_subtype_t) 2)
-
-/*
- * SPARC subtypes
- */
-#define CPU_SUBTYPE_SPARC_ALL ((cpu_subtype_t) 0)
-
-/*
- * I860 subtypes
- */
-#define CPU_SUBTYPE_I860_ALL ((cpu_subtype_t) 0)
-#define CPU_SUBTYPE_I860_860 ((cpu_subtype_t) 1)
-
-/*
- * PowerPC subtypes
- */
-#define CPU_SUBTYPE_POWERPC_ALL ((cpu_subtype_t) 0)
-#define CPU_SUBTYPE_POWERPC_601 ((cpu_subtype_t) 1)
-#define CPU_SUBTYPE_POWERPC_602 ((cpu_subtype_t) 2)
-#define CPU_SUBTYPE_POWERPC_603 ((cpu_subtype_t) 3)
-#define CPU_SUBTYPE_POWERPC_603e ((cpu_subtype_t) 4)
-#define CPU_SUBTYPE_POWERPC_603ev ((cpu_subtype_t) 5)
-#define CPU_SUBTYPE_POWERPC_604 ((cpu_subtype_t) 6)
-#define CPU_SUBTYPE_POWERPC_604e ((cpu_subtype_t) 7)
-#define CPU_SUBTYPE_POWERPC_620 ((cpu_subtype_t) 8)
-#define CPU_SUBTYPE_POWERPC_750 ((cpu_subtype_t) 9)
-#define CPU_SUBTYPE_POWERPC_7400 ((cpu_subtype_t) 10)
-#define CPU_SUBTYPE_POWERPC_7450 ((cpu_subtype_t) 11)
-#define CPU_SUBTYPE_POWERPC_970 ((cpu_subtype_t) 100)
-
-/*
- * ARM subtypes
- */
-#define CPU_SUBTYPE_ARM_ALL ((cpu_subtype_t) 0)
-#define CPU_SUBTYPE_ARM_V4T ((cpu_subtype_t) 5)
-#define CPU_SUBTYPE_ARM_V6 ((cpu_subtype_t) 6)
-#define CPU_SUBTYPE_ARM_V5TEJ ((cpu_subtype_t) 7)
-#define CPU_SUBTYPE_ARM_XSCALE ((cpu_subtype_t) 8)
-#define CPU_SUBTYPE_ARM_V7 ((cpu_subtype_t) 9) /* ARMv7-A and ARMv7-R */
-#define CPU_SUBTYPE_ARM_V7F ((cpu_subtype_t) 10) /* Cortex A9 */
-#define CPU_SUBTYPE_ARM_V7S ((cpu_subtype_t) 11) /* Swift */
-#define CPU_SUBTYPE_ARM_V7K ((cpu_subtype_t) 12)
-#define CPU_SUBTYPE_ARM_V8 ((cpu_subtype_t) 13)
-#define CPU_SUBTYPE_ARM_V6M ((cpu_subtype_t) 14) /* Not meant to be run under xnu */
-#define CPU_SUBTYPE_ARM_V7M ((cpu_subtype_t) 15) /* Not meant to be run under xnu */
-#define CPU_SUBTYPE_ARM_V7EM ((cpu_subtype_t) 16) /* Not meant to be run under xnu */
-#define CPU_SUBTYPE_ARM_V8M ((cpu_subtype_t) 17) /* Not meant to be run under xnu */
-
-/*
- * ARM64 subtypes
- */
-#define CPU_SUBTYPE_ARM64_ALL ((cpu_subtype_t) 0)
-#define CPU_SUBTYPE_ARM64_V8 ((cpu_subtype_t) 1)
-#define CPU_SUBTYPE_ARM64E ((cpu_subtype_t) 2)
-
-/* CPU subtype feature flags for ptrauth on arm64e platforms */
-#define CPU_SUBTYPE_ARM64_PTR_AUTH_MASK 0x0f000000
-#define CPU_SUBTYPE_ARM64_PTR_AUTH_VERSION(x) (((x) & CPU_SUBTYPE_ARM64_PTR_AUTH_MASK) >> 24)
-
-/*
- * ARM64_32 subtypes
- */
-#define CPU_SUBTYPE_ARM64_32_ALL ((cpu_subtype_t) 0)
-#define CPU_SUBTYPE_ARM64_32_V8 ((cpu_subtype_t) 1)
-
-#endif /* !__ASSEMBLER__ */
-
-/*
- * CPU families (sysctl hw.cpufamily)
- *
- * These are meant to identify the CPU's marketing name - an
- * application can map these to (possibly) localized strings.
- * NB: the encodings of the CPU families are intentionally arbitrary.
- * There is no ordering, and you should never try to deduce whether
- * or not some feature is available based on the family.
- * Use feature flags (eg, hw.optional.altivec) to test for optional
- * functionality.
- */
-#define CPUFAMILY_UNKNOWN 0
-#define CPUFAMILY_POWERPC_G3 0xcee41549
-#define CPUFAMILY_POWERPC_G4 0x77c184ae
-#define CPUFAMILY_POWERPC_G5 0xed76d8aa
-#define CPUFAMILY_INTEL_6_13 0xaa33392b
-#define CPUFAMILY_INTEL_PENRYN 0x78ea4fbc
-#define CPUFAMILY_INTEL_NEHALEM 0x6b5a4cd2
-#define CPUFAMILY_INTEL_WESTMERE 0x573b5eec
-#define CPUFAMILY_INTEL_SANDYBRIDGE 0x5490b78c
-#define CPUFAMILY_INTEL_IVYBRIDGE 0x1f65e835
-#define CPUFAMILY_INTEL_HASWELL 0x10b282dc
-#define CPUFAMILY_INTEL_BROADWELL 0x582ed09c
-#define CPUFAMILY_INTEL_SKYLAKE 0x37fc219f
-#define CPUFAMILY_INTEL_KABYLAKE 0x0f817246
-#if !defined(RC_HIDE_XNU_ICELAKE)
-#define CPUFAMILY_INTEL_ICELAKE 0x38435547
-#endif /* not RC_HIDE_XNU_ICELAKE */
-#if !defined(RC_HIDE_XNU_COMETLAKE)
-#define CPUFAMILY_INTEL_COMETLAKE 0x1cf8a03e
-#endif /* not RC_HIDE_XNU_COMETLAKE */
-#define CPUFAMILY_ARM_9 0xe73283ae
-#define CPUFAMILY_ARM_11 0x8ff620d8
-#define CPUFAMILY_ARM_XSCALE 0x53b005f5
-#define CPUFAMILY_ARM_12 0xbd1b0ae9
-#define CPUFAMILY_ARM_13 0x0cc90e64
-#define CPUFAMILY_ARM_14 0x96077ef1
-#define CPUFAMILY_ARM_15 0xa8511bca
-#define CPUFAMILY_ARM_SWIFT 0x1e2d6381
-#define CPUFAMILY_ARM_CYCLONE 0x37a09642
-#define CPUFAMILY_ARM_TYPHOON 0x2c91a47e
-#define CPUFAMILY_ARM_TWISTER 0x92fb37c8
-#define CPUFAMILY_ARM_HURRICANE 0x67ceee93
-#define CPUFAMILY_ARM_MONSOON_MISTRAL 0xe81e7ef6
-#define CPUFAMILY_ARM_VORTEX_TEMPEST 0x07d34b9f
-#define CPUFAMILY_ARM_LIGHTNING_THUNDER 0x462504d2
-
-/* The following synonyms are deprecated: */
-#define CPUFAMILY_INTEL_6_23 CPUFAMILY_INTEL_PENRYN
-#define CPUFAMILY_INTEL_6_26 CPUFAMILY_INTEL_NEHALEM
-
-
-#endif /* _MACH_MACHINE_H_ */
\ No newline at end of file
diff --git a/lib/libc/include/x86_64-macos-gnu/mach/machine/_structs.h b/lib/libc/include/x86_64-macos-gnu/mach/machine/_structs.h
deleted file mode 100644
index 0a61125417..0000000000
--- a/lib/libc/include/x86_64-macos-gnu/mach/machine/_structs.h
+++ /dev/null
@@ -1,38 +0,0 @@
-/*
- * Copyright (c) 2017 Apple Inc. All rights reserved.
- *
- * @APPLE_OSREFERENCE_LICENSE_HEADER_START@
- *
- * This file contains Original Code and/or Modifications of Original Code
- * as defined in and that are subject to the Apple Public Source License
- * Version 2.0 (the 'License'). You may not use this file except in
- * compliance with the License. The rights granted to you under the License
- * may not be used to create, or enable the creation or redistribution of,
- * unlawful or unlicensed copies of an Apple operating system, or to
- * circumvent, violate, or enable the circumvention or violation of, any
- * terms of an Apple operating system software license agreement.
- *
- * Please obtain a copy of the License at
- * http://www.opensource.apple.com/apsl/ and read it before using this file.
- *
- * The Original Code and all software distributed under the License are
- * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
- * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
- * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
- * Please see the License for the specific language governing rights and
- * limitations under the License.
- *
- * @APPLE_OSREFERENCE_LICENSE_HEADER_END@
- */
-
-#ifndef _MACH_MACHINE__STRUCTS_H_
-#define _MACH_MACHINE__STRUCTS_H_
-
-#if defined (__i386__) || defined(__x86_64__)
-#include "mach/i386/_structs.h"
-#else
-#error architecture not supported
-#endif
-
-#endif /* _MACH_MACHINE__STRUCTS_H_ */
\ No newline at end of file
diff --git a/lib/libc/include/x86_64-macos-gnu/mach/machine/boolean.h b/lib/libc/include/x86_64-macos-gnu/mach/machine/boolean.h
deleted file mode 100644
index d373913b40..0000000000
--- a/lib/libc/include/x86_64-macos-gnu/mach/machine/boolean.h
+++ /dev/null
@@ -1,38 +0,0 @@
-/*
- * Copyright (c) 2000-2007 Apple Inc. All rights reserved.
- *
- * @APPLE_OSREFERENCE_LICENSE_HEADER_START@
- *
- * This file contains Original Code and/or Modifications of Original Code
- * as defined in and that are subject to the Apple Public Source License
- * Version 2.0 (the 'License'). You may not use this file except in
- * compliance with the License. The rights granted to you under the License
- * may not be used to create, or enable the creation or redistribution of,
- * unlawful or unlicensed copies of an Apple operating system, or to
- * circumvent, violate, or enable the circumvention or violation of, any
- * terms of an Apple operating system software license agreement.
- *
- * Please obtain a copy of the License at
- * http://www.opensource.apple.com/apsl/ and read it before using this file.
- *
- * The Original Code and all software distributed under the License are
- * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
- * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
- * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
- * Please see the License for the specific language governing rights and
- * limitations under the License.
- *
- * @APPLE_OSREFERENCE_LICENSE_HEADER_END@
- */
-
-#ifndef _MACH_MACHINE_BOOLEAN_H_
-#define _MACH_MACHINE_BOOLEAN_H_
-
-#if defined (__i386__) || defined(__x86_64__)
-#include "mach/i386/boolean.h"
-#else
-#error architecture not supported
-#endif
-
-#endif /* _MACH_MACHINE_BOOLEAN_H_ */
\ No newline at end of file
diff --git a/lib/libc/include/x86_64-macos-gnu/mach/machine/exception.h b/lib/libc/include/x86_64-macos-gnu/mach/machine/exception.h
deleted file mode 100644
index f3e960d436..0000000000
--- a/lib/libc/include/x86_64-macos-gnu/mach/machine/exception.h
+++ /dev/null
@@ -1,38 +0,0 @@
-/*
- * Copyright (c) 2000-2007 Apple Inc. All rights reserved.
- *
- * @APPLE_OSREFERENCE_LICENSE_HEADER_START@
- *
- * This file contains Original Code and/or Modifications of Original Code
- * as defined in and that are subject to the Apple Public Source License
- * Version 2.0 (the 'License'). You may not use this file except in
- * compliance with the License. The rights granted to you under the License
- * may not be used to create, or enable the creation or redistribution of,
- * unlawful or unlicensed copies of an Apple operating system, or to
- * circumvent, violate, or enable the circumvention or violation of, any
- * terms of an Apple operating system software license agreement.
- *
- * Please obtain a copy of the License at
- * http://www.opensource.apple.com/apsl/ and read it before using this file.
- *
- * The Original Code and all software distributed under the License are
- * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
- * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
- * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
- * Please see the License for the specific language governing rights and
- * limitations under the License.
- *
- * @APPLE_OSREFERENCE_LICENSE_HEADER_END@
- */
-
-#ifndef _MACH_MACHINE_EXCEPTION_H_
-#define _MACH_MACHINE_EXCEPTION_H_
-
-#if defined (__i386__) || defined(__x86_64__)
-#include "mach/i386/exception.h"
-#else
-#error architecture not supported
-#endif
-
-#endif /* _MACH_MACHINE_EXCEPTION_H_ */
\ No newline at end of file
diff --git a/lib/libc/include/x86_64-macos-gnu/mach/machine/kern_return.h b/lib/libc/include/x86_64-macos-gnu/mach/machine/kern_return.h
deleted file mode 100644
index b764492d29..0000000000
--- a/lib/libc/include/x86_64-macos-gnu/mach/machine/kern_return.h
+++ /dev/null
@@ -1,38 +0,0 @@
-/*
- * Copyright (c) 2000-2007 Apple Inc. All rights reserved.
- *
- * @APPLE_OSREFERENCE_LICENSE_HEADER_START@
- *
- * This file contains Original Code and/or Modifications of Original Code
- * as defined in and that are subject to the Apple Public Source License
- * Version 2.0 (the 'License'). You may not use this file except in
- * compliance with the License. The rights granted to you under the License
- * may not be used to create, or enable the creation or redistribution of,
- * unlawful or unlicensed copies of an Apple operating system, or to
- * circumvent, violate, or enable the circumvention or violation of, any
- * terms of an Apple operating system software license agreement.
- *
- * Please obtain a copy of the License at
- * http://www.opensource.apple.com/apsl/ and read it before using this file.
- *
- * The Original Code and all software distributed under the License are
- * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
- * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
- * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
- * Please see the License for the specific language governing rights and
- * limitations under the License.
- *
- * @APPLE_OSREFERENCE_LICENSE_HEADER_END@
- */
-
-#ifndef _MACH_MACHINE_KERN_RETURN_H_
-#define _MACH_MACHINE_KERN_RETURN_H_
-
-#if defined (__i386__) || defined(__x86_64__)
-#include "mach/i386/kern_return.h"
-#else
-#error architecture not supported
-#endif
-
-#endif /* _MACH_MACHINE_KERN_RETURN_H_ */
\ No newline at end of file
diff --git a/lib/libc/include/x86_64-macos-gnu/mach/machine/processor_info.h b/lib/libc/include/x86_64-macos-gnu/mach/machine/processor_info.h
deleted file mode 100644
index 4e5028d24d..0000000000
--- a/lib/libc/include/x86_64-macos-gnu/mach/machine/processor_info.h
+++ /dev/null
@@ -1,38 +0,0 @@
-/*
- * Copyright (c) 2000-2007 Apple Inc. All rights reserved.
- *
- * @APPLE_OSREFERENCE_LICENSE_HEADER_START@
- *
- * This file contains Original Code and/or Modifications of Original Code
- * as defined in and that are subject to the Apple Public Source License
- * Version 2.0 (the 'License'). You may not use this file except in
- * compliance with the License. The rights granted to you under the License
- * may not be used to create, or enable the creation or redistribution of,
- * unlawful or unlicensed copies of an Apple operating system, or to
- * circumvent, violate, or enable the circumvention or violation of, any
- * terms of an Apple operating system software license agreement.
- *
- * Please obtain a copy of the License at
- * http://www.opensource.apple.com/apsl/ and read it before using this file.
- *
- * The Original Code and all software distributed under the License are
- * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
- * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
- * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
- * Please see the License for the specific language governing rights and
- * limitations under the License.
- *
- * @APPLE_OSREFERENCE_LICENSE_HEADER_END@
- */
-
-#ifndef _MACH_MACHINE_PROCESSOR_INFO_H_
-#define _MACH_MACHINE_PROCESSOR_INFO_H_
-
-#if defined (__i386__) || defined(__x86_64__)
-#include "mach/i386/processor_info.h"
-#else
-#error architecture not supported
-#endif
-
-#endif /* _MACH_MACHINE_PROCESSOR_INFO_H_ */
\ No newline at end of file
diff --git a/lib/libc/include/x86_64-macos-gnu/mach/machine/rpc.h b/lib/libc/include/x86_64-macos-gnu/mach/machine/rpc.h
deleted file mode 100644
index 7d6ccee5f8..0000000000
--- a/lib/libc/include/x86_64-macos-gnu/mach/machine/rpc.h
+++ /dev/null
@@ -1,38 +0,0 @@
-/*
- * Copyright (c) 2000-2007 Apple Inc. All rights reserved.
- *
- * @APPLE_OSREFERENCE_LICENSE_HEADER_START@
- *
- * This file contains Original Code and/or Modifications of Original Code
- * as defined in and that are subject to the Apple Public Source License
- * Version 2.0 (the 'License'). You may not use this file except in
- * compliance with the License. The rights granted to you under the License
- * may not be used to create, or enable the creation or redistribution of,
- * unlawful or unlicensed copies of an Apple operating system, or to
- * circumvent, violate, or enable the circumvention or violation of, any
- * terms of an Apple operating system software license agreement.
- *
- * Please obtain a copy of the License at
- * http://www.opensource.apple.com/apsl/ and read it before using this file.
- *
- * The Original Code and all software distributed under the License are
- * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
- * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
- * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
- * Please see the License for the specific language governing rights and
- * limitations under the License.
- *
- * @APPLE_OSREFERENCE_LICENSE_HEADER_END@
- */
-
-#ifndef _MACH_MACHINE_RPC_H_
-#define _MACH_MACHINE_RPC_H_
-
-#if defined (__i386__) || defined(__x86_64__)
-#include "mach/i386/rpc.h"
-#else
-#error architecture not supported
-#endif
-
-#endif /* _MACH_MACHINE_RPC_H_ */
\ No newline at end of file
diff --git a/lib/libc/include/x86_64-macos-gnu/mach/machine/thread_state.h b/lib/libc/include/x86_64-macos-gnu/mach/machine/thread_state.h
deleted file mode 100644
index 91daad8671..0000000000
--- a/lib/libc/include/x86_64-macos-gnu/mach/machine/thread_state.h
+++ /dev/null
@@ -1,38 +0,0 @@
-/*
- * Copyright (c) 2000-2007 Apple Inc. All rights reserved.
- *
- * @APPLE_OSREFERENCE_LICENSE_HEADER_START@
- *
- * This file contains Original Code and/or Modifications of Original Code
- * as defined in and that are subject to the Apple Public Source License
- * Version 2.0 (the 'License'). You may not use this file except in
- * compliance with the License. The rights granted to you under the License
- * may not be used to create, or enable the creation or redistribution of,
- * unlawful or unlicensed copies of an Apple operating system, or to
- * circumvent, violate, or enable the circumvention or violation of, any
- * terms of an Apple operating system software license agreement.
- *
- * Please obtain a copy of the License at
- * http://www.opensource.apple.com/apsl/ and read it before using this file.
- *
- * The Original Code and all software distributed under the License are
- * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
- * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
- * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
- * Please see the License for the specific language governing rights and
- * limitations under the License.
- *
- * @APPLE_OSREFERENCE_LICENSE_HEADER_END@
- */
-
-#ifndef _MACH_MACHINE_THREAD_STATE_H_
-#define _MACH_MACHINE_THREAD_STATE_H_
-
-#if defined (__i386__) || defined(__x86_64__)
-#include "mach/i386/thread_state.h"
-#else
-#error architecture not supported
-#endif
-
-#endif /* _MACH_MACHINE_THREAD_STATE_H_ */
\ No newline at end of file
diff --git a/lib/libc/include/x86_64-macos-gnu/mach/machine/thread_status.h b/lib/libc/include/x86_64-macos-gnu/mach/machine/thread_status.h
deleted file mode 100644
index 7e65df246e..0000000000
--- a/lib/libc/include/x86_64-macos-gnu/mach/machine/thread_status.h
+++ /dev/null
@@ -1,38 +0,0 @@
-/*
- * Copyright (c) 2000-2007 Apple Inc. All rights reserved.
- *
- * @APPLE_OSREFERENCE_LICENSE_HEADER_START@
- *
- * This file contains Original Code and/or Modifications of Original Code
- * as defined in and that are subject to the Apple Public Source License
- * Version 2.0 (the 'License'). You may not use this file except in
- * compliance with the License. The rights granted to you under the License
- * may not be used to create, or enable the creation or redistribution of,
- * unlawful or unlicensed copies of an Apple operating system, or to
- * circumvent, violate, or enable the circumvention or violation of, any
- * terms of an Apple operating system software license agreement.
- *
- * Please obtain a copy of the License at
- * http://www.opensource.apple.com/apsl/ and read it before using this file.
- *
- * The Original Code and all software distributed under the License are
- * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
- * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
- * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
- * Please see the License for the specific language governing rights and
- * limitations under the License.
- *
- * @APPLE_OSREFERENCE_LICENSE_HEADER_END@
- */
-
-#ifndef _MACH_MACHINE_THREAD_STATUS_H_
-#define _MACH_MACHINE_THREAD_STATUS_H_
-
-#if defined (__i386__) || defined(__x86_64__)
-#include "mach/i386/thread_status.h"
-#else
-#error architecture not supported
-#endif
-
-#endif /* _MACH_MACHINE_THREAD_STATUS_H_ */
\ No newline at end of file
diff --git a/lib/libc/include/x86_64-macos-gnu/mach/machine/vm_param.h b/lib/libc/include/x86_64-macos-gnu/mach/machine/vm_param.h
deleted file mode 100644
index 7f272f5b70..0000000000
--- a/lib/libc/include/x86_64-macos-gnu/mach/machine/vm_param.h
+++ /dev/null
@@ -1,38 +0,0 @@
-/*
- * Copyright (c) 2000-2007 Apple Inc. All rights reserved.
- *
- * @APPLE_OSREFERENCE_LICENSE_HEADER_START@
- *
- * This file contains Original Code and/or Modifications of Original Code
- * as defined in and that are subject to the Apple Public Source License
- * Version 2.0 (the 'License'). You may not use this file except in
- * compliance with the License. The rights granted to you under the License
- * may not be used to create, or enable the creation or redistribution of,
- * unlawful or unlicensed copies of an Apple operating system, or to
- * circumvent, violate, or enable the circumvention or violation of, any
- * terms of an Apple operating system software license agreement.
- *
- * Please obtain a copy of the License at
- * http://www.opensource.apple.com/apsl/ and read it before using this file.
- *
- * The Original Code and all software distributed under the License are
- * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
- * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
- * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
- * Please see the License for the specific language governing rights and
- * limitations under the License.
- *
- * @APPLE_OSREFERENCE_LICENSE_HEADER_END@
- */
-
-#ifndef _MACH_MACHINE_VM_PARAM_H_
-#define _MACH_MACHINE_VM_PARAM_H_
-
-#if defined (__i386__) || defined(__x86_64__)
-#include "mach/i386/vm_param.h"
-#else
-#error architecture not supported
-#endif
-
-#endif /* _MACH_MACHINE_VM_PARAM_H_ */
\ No newline at end of file
diff --git a/lib/libc/include/x86_64-macos-gnu/mach/machine/vm_types.h b/lib/libc/include/x86_64-macos-gnu/mach/machine/vm_types.h
deleted file mode 100644
index 5d16a871ea..0000000000
--- a/lib/libc/include/x86_64-macos-gnu/mach/machine/vm_types.h
+++ /dev/null
@@ -1,38 +0,0 @@
-/*
- * Copyright (c) 2000-2007 Apple Inc. All rights reserved.
- *
- * @APPLE_OSREFERENCE_LICENSE_HEADER_START@
- *
- * This file contains Original Code and/or Modifications of Original Code
- * as defined in and that are subject to the Apple Public Source License
- * Version 2.0 (the 'License'). You may not use this file except in
- * compliance with the License. The rights granted to you under the License
- * may not be used to create, or enable the creation or redistribution of,
- * unlawful or unlicensed copies of an Apple operating system, or to
- * circumvent, violate, or enable the circumvention or violation of, any
- * terms of an Apple operating system software license agreement.
- *
- * Please obtain a copy of the License at
- * http://www.opensource.apple.com/apsl/ and read it before using this file.
- *
- * The Original Code and all software distributed under the License are
- * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
- * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
- * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
- * Please see the License for the specific language governing rights and
- * limitations under the License.
- *
- * @APPLE_OSREFERENCE_LICENSE_HEADER_END@
- */
-
-#ifndef _MACH_MACHINE_VM_TYPES_H_
-#define _MACH_MACHINE_VM_TYPES_H_
-
-#if defined (__i386__) || defined(__x86_64__)
-#include "mach/i386/vm_types.h"
-#else
-#error architecture not supported
-#endif
-
-#endif /* _MACH_MACHINE_VM_TYPES_H_ */
\ No newline at end of file
diff --git a/lib/libc/include/x86_64-macos-gnu/mach/memory_object_types.h b/lib/libc/include/x86_64-macos-gnu/mach/memory_object_types.h
deleted file mode 100644
index fec6e53593..0000000000
--- a/lib/libc/include/x86_64-macos-gnu/mach/memory_object_types.h
+++ /dev/null
@@ -1,299 +0,0 @@
-/*
- * Copyright (c) 2000-2016 Apple Computer, Inc. All rights reserved.
- *
- * @APPLE_OSREFERENCE_LICENSE_HEADER_START@
- *
- * This file contains Original Code and/or Modifications of Original Code
- * as defined in and that are subject to the Apple Public Source License
- * Version 2.0 (the 'License'). You may not use this file except in
- * compliance with the License. The rights granted to you under the License
- * may not be used to create, or enable the creation or redistribution of,
- * unlawful or unlicensed copies of an Apple operating system, or to
- * circumvent, violate, or enable the circumvention or violation of, any
- * terms of an Apple operating system software license agreement.
- *
- * Please obtain a copy of the License at
- * http://www.opensource.apple.com/apsl/ and read it before using this file.
- *
- * The Original Code and all software distributed under the License are
- * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
- * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
- * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
- * Please see the License for the specific language governing rights and
- * limitations under the License.
- *
- * @APPLE_OSREFERENCE_LICENSE_HEADER_END@
- */
-/*
- * @OSF_COPYRIGHT@
- */
-/*
- * Mach Operating System
- * Copyright (c) 1991,1990,1989,1988 Carnegie Mellon University
- * All Rights Reserved.
- *
- * Permission to use, copy, modify and distribute this software and its
- * documentation is hereby granted, provided that both the copyright
- * notice and this permission notice appear in all copies of the
- * software, derivative works or modified versions, and any portions
- * thereof, and that both notices appear in supporting documentation.
- *
- * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS"
- * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR
- * ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE.
- *
- * Carnegie Mellon requests users of this software to return to
- *
- * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU
- * School of Computer Science
- * Carnegie Mellon University
- * Pittsburgh PA 15213-3890
- *
- * any improvements or extensions that they make and grant Carnegie Mellon
- * the rights to redistribute these changes.
- */
-/*
- */
-/*
- * File: memory_object.h
- * Author: Michael Wayne Young
- *
- * External memory management interface definition.
- */
-
-#ifndef _MACH_MEMORY_OBJECT_TYPES_H_
-#define _MACH_MEMORY_OBJECT_TYPES_H_
-
-/*
- * User-visible types used in the external memory
- * management interface:
- */
-
-#include
-#include
-#include
-#include
-#include
-#include
-
-#include
-
-#define VM_64_BIT_DATA_OBJECTS
-
-typedef unsigned long long memory_object_offset_t;
-typedef unsigned long long memory_object_size_t;
-typedef natural_t memory_object_cluster_size_t;
-typedef natural_t * memory_object_fault_info_t;
-
-typedef unsigned long long vm_object_id_t;
-
-
-/*
- * Temporary until real EMMI version gets re-implemented
- */
-
-
-typedef mach_port_t memory_object_t;
-typedef mach_port_t memory_object_control_t;
-
-
-typedef memory_object_t *memory_object_array_t;
-/* A memory object ... */
-/* Used by the kernel to retrieve */
-/* or store data */
-
-typedef mach_port_t memory_object_name_t;
-/* Used to describe the memory ... */
-/* object in vm_regions() calls */
-
-typedef mach_port_t memory_object_default_t;
-/* Registered with the host ... */
-/* for creating new internal objects */
-
-#define MEMORY_OBJECT_NULL ((memory_object_t) 0)
-#define MEMORY_OBJECT_CONTROL_NULL ((memory_object_control_t) 0)
-#define MEMORY_OBJECT_NAME_NULL ((memory_object_name_t) 0)
-#define MEMORY_OBJECT_DEFAULT_NULL ((memory_object_default_t) 0)
-
-
-typedef int memory_object_copy_strategy_t;
-/* How memory manager handles copy: */
-#define MEMORY_OBJECT_COPY_NONE 0
-/* ... No special support */
-#define MEMORY_OBJECT_COPY_CALL 1
-/* ... Make call on memory manager */
-#define MEMORY_OBJECT_COPY_DELAY 2
-/* ... Memory manager doesn't
- * change data externally.
- */
-#define MEMORY_OBJECT_COPY_TEMPORARY 3
-/* ... Memory manager doesn't
- * change data externally, and
- * doesn't need to see changes.
- */
-#define MEMORY_OBJECT_COPY_SYMMETRIC 4
-/* ... Memory manager doesn't
- * change data externally,
- * doesn't need to see changes,
- * and object will not be
- * multiply mapped.
- *
- * XXX
- * Not yet safe for non-kernel use.
- */
-
-#define MEMORY_OBJECT_COPY_INVALID 5
-/* ... An invalid copy strategy,
- * for external objects which
- * have not been initialized.
- * Allows copy_strategy to be
- * examined without also
- * examining pager_ready and
- * internal.
- */
-
-typedef int memory_object_return_t;
-/* Which pages to return to manager
- * this time (lock_request) */
-#define MEMORY_OBJECT_RETURN_NONE 0
-/* ... don't return any. */
-#define MEMORY_OBJECT_RETURN_DIRTY 1
-/* ... only dirty pages. */
-#define MEMORY_OBJECT_RETURN_ALL 2
-/* ... dirty and precious pages. */
-#define MEMORY_OBJECT_RETURN_ANYTHING 3
-/* ... any resident page. */
-
-/*
- * Data lock request flags
- */
-
-#define MEMORY_OBJECT_DATA_FLUSH 0x1
-#define MEMORY_OBJECT_DATA_NO_CHANGE 0x2
-#define MEMORY_OBJECT_DATA_PURGE 0x4
-#define MEMORY_OBJECT_COPY_SYNC 0x8
-#define MEMORY_OBJECT_DATA_SYNC 0x10
-#define MEMORY_OBJECT_IO_SYNC 0x20
-#define MEMORY_OBJECT_DATA_FLUSH_ALL 0x40
-
-/*
- * Types for the memory object flavor interfaces
- */
-
-#define MEMORY_OBJECT_INFO_MAX (1024)
-typedef int *memory_object_info_t;
-typedef int memory_object_flavor_t;
-typedef int memory_object_info_data_t[MEMORY_OBJECT_INFO_MAX];
-
-
-#define MEMORY_OBJECT_PERFORMANCE_INFO 11
-#define MEMORY_OBJECT_ATTRIBUTE_INFO 14
-#define MEMORY_OBJECT_BEHAVIOR_INFO 15
-
-
-struct memory_object_perf_info {
- memory_object_cluster_size_t cluster_size;
- boolean_t may_cache;
-};
-
-struct memory_object_attr_info {
- memory_object_copy_strategy_t copy_strategy;
- memory_object_cluster_size_t cluster_size;
- boolean_t may_cache_object;
- boolean_t temporary;
-};
-
-struct memory_object_behave_info {
- memory_object_copy_strategy_t copy_strategy;
- boolean_t temporary;
- boolean_t invalidate;
- boolean_t silent_overwrite;
- boolean_t advisory_pageout;
-};
-
-
-typedef struct memory_object_behave_info *memory_object_behave_info_t;
-typedef struct memory_object_behave_info memory_object_behave_info_data_t;
-
-typedef struct memory_object_perf_info *memory_object_perf_info_t;
-typedef struct memory_object_perf_info memory_object_perf_info_data_t;
-
-typedef struct memory_object_attr_info *memory_object_attr_info_t;
-typedef struct memory_object_attr_info memory_object_attr_info_data_t;
-
-#define MEMORY_OBJECT_BEHAVE_INFO_COUNT ((mach_msg_type_number_t) \
- (sizeof(memory_object_behave_info_data_t)/sizeof(int)))
-#define MEMORY_OBJECT_PERF_INFO_COUNT ((mach_msg_type_number_t) \
- (sizeof(memory_object_perf_info_data_t)/sizeof(int)))
-#define MEMORY_OBJECT_ATTR_INFO_COUNT ((mach_msg_type_number_t) \
- (sizeof(memory_object_attr_info_data_t)/sizeof(int)))
-
-#define invalid_memory_object_flavor(f) \
- (f != MEMORY_OBJECT_ATTRIBUTE_INFO && \
- f != MEMORY_OBJECT_PERFORMANCE_INFO && \
- f != OLD_MEMORY_OBJECT_BEHAVIOR_INFO && \
- f != MEMORY_OBJECT_BEHAVIOR_INFO && \
- f != OLD_MEMORY_OBJECT_ATTRIBUTE_INFO)
-
-
-/*
- * Used to support options on memory_object_release_name call
- */
-#define MEMORY_OBJECT_TERMINATE_IDLE 0x1
-#define MEMORY_OBJECT_RESPECT_CACHE 0x2
-#define MEMORY_OBJECT_RELEASE_NO_OP 0x4
-
-
-/* named entry processor mapping options */
-/* enumerated */
-#define MAP_MEM_NOOP 0
-#define MAP_MEM_COPYBACK 1
-#define MAP_MEM_IO 2
-#define MAP_MEM_WTHRU 3
-#define MAP_MEM_WCOMB 4 /* Write combining mode */
- /* aka store gather */
-#define MAP_MEM_INNERWBACK 5
-#define MAP_MEM_POSTED 6
-#define MAP_MEM_RT 7
-#define MAP_MEM_POSTED_REORDERED 8
-#define MAP_MEM_POSTED_COMBINED_REORDERED 9
-
-#define GET_MAP_MEM(flags) \
- ((((unsigned int)(flags)) >> 24) & 0xFF)
-
-#define SET_MAP_MEM(caching, flags) \
- ((flags) = ((((unsigned int)(caching)) << 24) \
- & 0xFF000000) | ((flags) & 0xFFFFFF));
-
-/* leave room for vm_prot bits (0xFF ?) */
-#define MAP_MEM_LEDGER_TAGGED 0x002000 /* object owned by a specific task and ledger */
-#define MAP_MEM_PURGABLE_KERNEL_ONLY 0x004000 /* volatility controlled by kernel */
-#define MAP_MEM_GRAB_SECLUDED 0x008000 /* can grab secluded pages */
-#define MAP_MEM_ONLY 0x010000 /* change processor caching */
-#define MAP_MEM_NAMED_CREATE 0x020000 /* create extant object */
-#define MAP_MEM_PURGABLE 0x040000 /* create a purgable VM object */
-#define MAP_MEM_NAMED_REUSE 0x080000 /* reuse provided entry if identical */
-#define MAP_MEM_USE_DATA_ADDR 0x100000 /* preserve address of data, rather than base of page */
-#define MAP_MEM_VM_COPY 0x200000 /* make a copy of a VM range */
-#define MAP_MEM_VM_SHARE 0x400000 /* extract a VM range for remap */
-#define MAP_MEM_4K_DATA_ADDR 0x800000 /* preserve 4K aligned address of data */
-
-#define MAP_MEM_FLAGS_MASK 0x00FFFF00
-#define MAP_MEM_FLAGS_USER ( \
- MAP_MEM_PURGABLE_KERNEL_ONLY | \
- MAP_MEM_GRAB_SECLUDED | \
- MAP_MEM_ONLY | \
- MAP_MEM_NAMED_CREATE | \
- MAP_MEM_PURGABLE | \
- MAP_MEM_NAMED_REUSE | \
- MAP_MEM_USE_DATA_ADDR | \
- MAP_MEM_VM_COPY | \
- MAP_MEM_VM_SHARE | \
- MAP_MEM_LEDGER_TAGGED | \
- MAP_MEM_4K_DATA_ADDR)
-#define MAP_MEM_FLAGS_ALL ( \
- MAP_MEM_FLAGS_USER)
-
-
-#endif /* _MACH_MEMORY_OBJECT_TYPES_H_ */
\ No newline at end of file
diff --git a/lib/libc/include/x86_64-macos-gnu/mach/message.h b/lib/libc/include/x86_64-macos-gnu/mach/message.h
deleted file mode 100644
index 3f9f9a0605..0000000000
--- a/lib/libc/include/x86_64-macos-gnu/mach/message.h
+++ /dev/null
@@ -1,902 +0,0 @@
-/*
- * Copyright (c) 2000-2005 Apple Computer, Inc. All rights reserved.
- *
- * @APPLE_OSREFERENCE_LICENSE_HEADER_START@
- *
- * This file contains Original Code and/or Modifications of Original Code
- * as defined in and that are subject to the Apple Public Source License
- * Version 2.0 (the 'License'). You may not use this file except in
- * compliance with the License. The rights granted to you under the License
- * may not be used to create, or enable the creation or redistribution of,
- * unlawful or unlicensed copies of an Apple operating system, or to
- * circumvent, violate, or enable the circumvention or violation of, any
- * terms of an Apple operating system software license agreement.
- *
- * Please obtain a copy of the License at
- * http://www.opensource.apple.com/apsl/ and read it before using this file.
- *
- * The Original Code and all software distributed under the License are
- * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
- * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
- * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
- * Please see the License for the specific language governing rights and
- * limitations under the License.
- *
- * @APPLE_OSREFERENCE_LICENSE_HEADER_END@
- */
-/*
- * @OSF_COPYRIGHT@
- */
-/*
- * Mach Operating System
- * Copyright (c) 1991,1990,1989,1988,1987 Carnegie Mellon University
- * All Rights Reserved.
- *
- * Permission to use, copy, modify and distribute this software and its
- * documentation is hereby granted, provided that both the copyright
- * notice and this permission notice appear in all copies of the
- * software, derivative works or modified versions, and any portions
- * thereof, and that both notices appear in supporting documentation.
- *
- * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS"
- * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR
- * ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE.
- *
- * Carnegie Mellon requests users of this software to return to
- *
- * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU
- * School of Computer Science
- * Carnegie Mellon University
- * Pittsburgh PA 15213-3890
- *
- * any improvements or extensions that they make and grant Carnegie Mellon
- * the rights to redistribute these changes.
- */
-/*
- * NOTICE: This file was modified by McAfee Research in 2004 to introduce
- * support for mandatory and extensible security protections. This notice
- * is included in support of clause 2.2 (b) of the Apple Public License,
- * Version 2.0.
- * Copyright (c) 2005 SPARTA, Inc.
- */
-/*
- */
-/*
- * File: mach/message.h
- *
- * Mach IPC message and primitive function definitions.
- */
-
-#ifndef _MACH_MESSAGE_H_
-#define _MACH_MESSAGE_H_
-
-#include
-#include
-#include
-#include
-#include
-
-#include
-#include
-#include
-
-/*
- * The timeout mechanism uses mach_msg_timeout_t values,
- * passed by value. The timeout units are milliseconds.
- * It is controlled with the MACH_SEND_TIMEOUT
- * and MACH_RCV_TIMEOUT options.
- */
-
-typedef natural_t mach_msg_timeout_t;
-
-/*
- * The value to be used when there is no timeout.
- * (No MACH_SEND_TIMEOUT/MACH_RCV_TIMEOUT option.)
- */
-
-#define MACH_MSG_TIMEOUT_NONE ((mach_msg_timeout_t) 0)
-
-/*
- * The kernel uses MACH_MSGH_BITS_COMPLEX as a hint. If it isn't on, it
- * assumes the body of the message doesn't contain port rights or OOL
- * data. The field is set in received messages. A user task must
- * use caution in interpreting the body of a message if the bit isn't
- * on, because the mach_msg_type's in the body might "lie" about the
- * contents. If the bit isn't on, but the mach_msg_types
- * in the body specify rights or OOL data, the behavior is undefined.
- * (Ie, an error may or may not be produced.)
- *
- * The value of MACH_MSGH_BITS_REMOTE determines the interpretation
- * of the msgh_remote_port field. It is handled like a msgt_name,
- * but must result in a send or send-once type right.
- *
- * The value of MACH_MSGH_BITS_LOCAL determines the interpretation
- * of the msgh_local_port field. It is handled like a msgt_name,
- * and also must result in a send or send-once type right.
- *
- * The value of MACH_MSGH_BITS_VOUCHER determines the interpretation
- * of the msgh_voucher_port field. It is handled like a msgt_name,
- * but must result in a send right (and the msgh_voucher_port field
- * must be the name of a send right to a Mach voucher kernel object.
- *
- * MACH_MSGH_BITS() combines two MACH_MSG_TYPE_* values, for the remote
- * and local fields, into a single value suitable for msgh_bits.
- *
- * MACH_MSGH_BITS_CIRCULAR should be zero; is is used internally.
- *
- * The unused bits should be zero and are reserved for the kernel
- * or for future interface expansion.
- */
-
-#define MACH_MSGH_BITS_ZERO 0x00000000
-
-#define MACH_MSGH_BITS_REMOTE_MASK 0x0000001f
-#define MACH_MSGH_BITS_LOCAL_MASK 0x00001f00
-#define MACH_MSGH_BITS_VOUCHER_MASK 0x001f0000
-
-#define MACH_MSGH_BITS_PORTS_MASK \
- (MACH_MSGH_BITS_REMOTE_MASK | \
- MACH_MSGH_BITS_LOCAL_MASK | \
- MACH_MSGH_BITS_VOUCHER_MASK)
-
-#define MACH_MSGH_BITS_COMPLEX 0x80000000U /* message is complex */
-
-#define MACH_MSGH_BITS_USER 0x801f1f1fU /* allowed bits user->kernel */
-
-#define MACH_MSGH_BITS_RAISEIMP 0x20000000U /* importance raised due to msg */
-#define MACH_MSGH_BITS_DENAP MACH_MSGH_BITS_RAISEIMP
-
-#define MACH_MSGH_BITS_IMPHOLDASRT 0x10000000U /* assertion help, userland private */
-#define MACH_MSGH_BITS_DENAPHOLDASRT MACH_MSGH_BITS_IMPHOLDASRT
-
-#define MACH_MSGH_BITS_CIRCULAR 0x10000000U /* message circular, kernel private */
-
-#define MACH_MSGH_BITS_USED 0xb01f1f1fU
-
-/* setter macros for the bits */
-#define MACH_MSGH_BITS(remote, local) /* legacy */ \
- ((remote) | ((local) << 8))
-#define MACH_MSGH_BITS_SET_PORTS(remote, local, voucher) \
- (((remote) & MACH_MSGH_BITS_REMOTE_MASK) | \
- (((local) << 8) & MACH_MSGH_BITS_LOCAL_MASK) | \
- (((voucher) << 16) & MACH_MSGH_BITS_VOUCHER_MASK))
-#define MACH_MSGH_BITS_SET(remote, local, voucher, other) \
- (MACH_MSGH_BITS_SET_PORTS((remote), (local), (voucher)) \
- | ((other) &~ MACH_MSGH_BITS_PORTS_MASK))
-
-/* getter macros for pulling values out of the bits field */
-#define MACH_MSGH_BITS_REMOTE(bits) \
- ((bits) & MACH_MSGH_BITS_REMOTE_MASK)
-#define MACH_MSGH_BITS_LOCAL(bits) \
- (((bits) & MACH_MSGH_BITS_LOCAL_MASK) >> 8)
-#define MACH_MSGH_BITS_VOUCHER(bits) \
- (((bits) & MACH_MSGH_BITS_VOUCHER_MASK) >> 16)
-#define MACH_MSGH_BITS_PORTS(bits) \
- ((bits) & MACH_MSGH_BITS_PORTS_MASK)
-#define MACH_MSGH_BITS_OTHER(bits) \
- ((bits) &~ MACH_MSGH_BITS_PORTS_MASK)
-
-/* checking macros */
-#define MACH_MSGH_BITS_HAS_REMOTE(bits) \
- (MACH_MSGH_BITS_REMOTE(bits) != MACH_MSGH_BITS_ZERO)
-#define MACH_MSGH_BITS_HAS_LOCAL(bits) \
- (MACH_MSGH_BITS_LOCAL(bits) != MACH_MSGH_BITS_ZERO)
-#define MACH_MSGH_BITS_HAS_VOUCHER(bits) \
- (MACH_MSGH_BITS_VOUCHER(bits) != MACH_MSGH_BITS_ZERO)
-#define MACH_MSGH_BITS_IS_COMPLEX(bits) \
- (((bits) & MACH_MSGH_BITS_COMPLEX) != MACH_MSGH_BITS_ZERO)
-
-/* importance checking macros */
-#define MACH_MSGH_BITS_RAISED_IMPORTANCE(bits) \
- (((bits) & MACH_MSGH_BITS_RAISEIMP) != MACH_MSGH_BITS_ZERO)
-#define MACH_MSGH_BITS_HOLDS_IMPORTANCE_ASSERTION(bits) \
- (((bits) & MACH_MSGH_BITS_IMPHOLDASRT) != MACH_MSGH_BITS_ZERO)
-
-/*
- * Every message starts with a message header.
- * Following the message header, if the message is complex, are a count
- * of type descriptors and the type descriptors themselves
- * (mach_msg_descriptor_t). The size of the message must be specified in
- * bytes, and includes the message header, descriptor count, descriptors,
- * and inline data.
- *
- * The msgh_remote_port field specifies the destination of the message.
- * It must specify a valid send or send-once right for a port.
- *
- * The msgh_local_port field specifies a "reply port". Normally,
- * This field carries a send-once right that the receiver will use
- * to reply to the message. It may carry the values MACH_PORT_NULL,
- * MACH_PORT_DEAD, a send-once right, or a send right.
- *
- * The msgh_voucher_port field specifies a Mach voucher port. Only
- * send rights to kernel-implemented Mach Voucher kernel objects in
- * addition to MACH_PORT_NULL or MACH_PORT_DEAD may be passed.
- *
- * The msgh_id field is uninterpreted by the message primitives.
- * It normally carries information specifying the format
- * or meaning of the message.
- */
-
-typedef unsigned int mach_msg_bits_t;
-typedef natural_t mach_msg_size_t;
-typedef integer_t mach_msg_id_t;
-
-#define MACH_MSG_SIZE_NULL (mach_msg_size_t *) 0
-
-typedef unsigned int mach_msg_priority_t;
-
-#define MACH_MSG_PRIORITY_UNSPECIFIED (mach_msg_priority_t) 0
-
-typedef unsigned int mach_msg_type_name_t;
-
-#define MACH_MSG_TYPE_MOVE_RECEIVE 16 /* Must hold receive right */
-#define MACH_MSG_TYPE_MOVE_SEND 17 /* Must hold send right(s) */
-#define MACH_MSG_TYPE_MOVE_SEND_ONCE 18 /* Must hold sendonce right */
-#define MACH_MSG_TYPE_COPY_SEND 19 /* Must hold send right(s) */
-#define MACH_MSG_TYPE_MAKE_SEND 20 /* Must hold receive right */
-#define MACH_MSG_TYPE_MAKE_SEND_ONCE 21 /* Must hold receive right */
-#define MACH_MSG_TYPE_COPY_RECEIVE 22 /* NOT VALID */
-#define MACH_MSG_TYPE_DISPOSE_RECEIVE 24 /* must hold receive right */
-#define MACH_MSG_TYPE_DISPOSE_SEND 25 /* must hold send right(s) */
-#define MACH_MSG_TYPE_DISPOSE_SEND_ONCE 26 /* must hold sendonce right */
-
-typedef unsigned int mach_msg_copy_options_t;
-
-#define MACH_MSG_PHYSICAL_COPY 0
-#define MACH_MSG_VIRTUAL_COPY 1
-#define MACH_MSG_ALLOCATE 2
-#define MACH_MSG_OVERWRITE 3 /* deprecated */
-#ifdef MACH_KERNEL
-#define MACH_MSG_KALLOC_COPY_T 4
-#endif /* MACH_KERNEL */
-
-#define MACH_MSG_GUARD_FLAGS_NONE 0x0000
-#define MACH_MSG_GUARD_FLAGS_IMMOVABLE_RECEIVE 0x0001 /* Move the receive right and mark it as immovable */
-#define MACH_MSG_GUARD_FLAGS_UNGUARDED_ON_SEND 0x0002 /* Verify that the port is unguarded */
-#define MACH_MSG_GUARD_FLAGS_MASK 0x0003 /* Valid flag bits */
-typedef unsigned int mach_msg_guard_flags_t;
-
-/*
- * In a complex mach message, the mach_msg_header_t is followed by
- * a descriptor count, then an array of that number of descriptors
- * (mach_msg_*_descriptor_t). The type field of mach_msg_type_descriptor_t
- * (which any descriptor can be cast to) indicates the flavor of the
- * descriptor.
- *
- * Note that in LP64, the various types of descriptors are no longer all
- * the same size as mach_msg_descriptor_t, so the array cannot be indexed
- * as expected.
- */
-
-typedef unsigned int mach_msg_descriptor_type_t;
-
-#define MACH_MSG_PORT_DESCRIPTOR 0
-#define MACH_MSG_OOL_DESCRIPTOR 1
-#define MACH_MSG_OOL_PORTS_DESCRIPTOR 2
-#define MACH_MSG_OOL_VOLATILE_DESCRIPTOR 3
-#define MACH_MSG_GUARDED_PORT_DESCRIPTOR 4
-
-#pragma pack(push, 4)
-
-typedef struct{
- natural_t pad1;
- mach_msg_size_t pad2;
- unsigned int pad3 : 24;
- mach_msg_descriptor_type_t type : 8;
-} mach_msg_type_descriptor_t;
-
-typedef struct{
- mach_port_t name;
-// Pad to 8 bytes everywhere except the K64 kernel where mach_port_t is 8 bytes
- mach_msg_size_t pad1;
- unsigned int pad2 : 16;
- mach_msg_type_name_t disposition : 8;
- mach_msg_descriptor_type_t type : 8;
-} mach_msg_port_descriptor_t;
-
-typedef struct{
- uint32_t address;
- mach_msg_size_t size;
- boolean_t deallocate: 8;
- mach_msg_copy_options_t copy: 8;
- unsigned int pad1: 8;
- mach_msg_descriptor_type_t type: 8;
-} mach_msg_ool_descriptor32_t;
-
-typedef struct{
- uint64_t address;
- boolean_t deallocate: 8;
- mach_msg_copy_options_t copy: 8;
- unsigned int pad1: 8;
- mach_msg_descriptor_type_t type: 8;
- mach_msg_size_t size;
-} mach_msg_ool_descriptor64_t;
-
-typedef struct{
- void* address;
-#if !defined(__LP64__)
- mach_msg_size_t size;
-#endif
- boolean_t deallocate: 8;
- mach_msg_copy_options_t copy: 8;
- unsigned int pad1: 8;
- mach_msg_descriptor_type_t type: 8;
-#if defined(__LP64__)
- mach_msg_size_t size;
-#endif
-} mach_msg_ool_descriptor_t;
-
-typedef struct{
- uint32_t address;
- mach_msg_size_t count;
- boolean_t deallocate: 8;
- mach_msg_copy_options_t copy: 8;
- mach_msg_type_name_t disposition : 8;
- mach_msg_descriptor_type_t type : 8;
-} mach_msg_ool_ports_descriptor32_t;
-
-typedef struct{
- uint64_t address;
- boolean_t deallocate: 8;
- mach_msg_copy_options_t copy: 8;
- mach_msg_type_name_t disposition : 8;
- mach_msg_descriptor_type_t type : 8;
- mach_msg_size_t count;
-} mach_msg_ool_ports_descriptor64_t;
-
-typedef struct{
- void* address;
-#if !defined(__LP64__)
- mach_msg_size_t count;
-#endif
- boolean_t deallocate: 8;
- mach_msg_copy_options_t copy: 8;
- mach_msg_type_name_t disposition : 8;
- mach_msg_descriptor_type_t type : 8;
-#if defined(__LP64__)
- mach_msg_size_t count;
-#endif
-} mach_msg_ool_ports_descriptor_t;
-
-typedef struct{
- uint32_t context;
- mach_port_name_t name;
- mach_msg_guard_flags_t flags : 16;
- mach_msg_type_name_t disposition : 8;
- mach_msg_descriptor_type_t type : 8;
-} mach_msg_guarded_port_descriptor32_t;
-
-typedef struct{
- uint64_t context;
- mach_msg_guard_flags_t flags : 16;
- mach_msg_type_name_t disposition : 8;
- mach_msg_descriptor_type_t type : 8;
- mach_port_name_t name;
-} mach_msg_guarded_port_descriptor64_t;
-
-typedef struct{
- mach_port_context_t context;
-#if !defined(__LP64__)
- mach_port_name_t name;
-#endif
- mach_msg_guard_flags_t flags : 16;
- mach_msg_type_name_t disposition : 8;
- mach_msg_descriptor_type_t type : 8;
-#if defined(__LP64__)
- mach_port_name_t name;
-#endif /* defined(__LP64__) */
-} mach_msg_guarded_port_descriptor_t;
-
-/*
- * LP64support - This union definition is not really
- * appropriate in LP64 mode because not all descriptors
- * are of the same size in that environment.
- */
-typedef union{
- mach_msg_port_descriptor_t port;
- mach_msg_ool_descriptor_t out_of_line;
- mach_msg_ool_ports_descriptor_t ool_ports;
- mach_msg_type_descriptor_t type;
- mach_msg_guarded_port_descriptor_t guarded_port;
-} mach_msg_descriptor_t;
-
-typedef struct{
- mach_msg_size_t msgh_descriptor_count;
-} mach_msg_body_t;
-
-#define MACH_MSG_BODY_NULL (mach_msg_body_t *) 0
-#define MACH_MSG_DESCRIPTOR_NULL (mach_msg_descriptor_t *) 0
-
-typedef struct{
- mach_msg_bits_t msgh_bits;
- mach_msg_size_t msgh_size;
- mach_port_t msgh_remote_port;
- mach_port_t msgh_local_port;
- mach_port_name_t msgh_voucher_port;
- mach_msg_id_t msgh_id;
-} mach_msg_header_t;
-
-#define msgh_reserved msgh_voucher_port
-#define MACH_MSG_NULL (mach_msg_header_t *) 0
-
-typedef struct{
- mach_msg_header_t header;
- mach_msg_body_t body;
-} mach_msg_base_t;
-
-typedef unsigned int mach_msg_trailer_type_t;
-
-#define MACH_MSG_TRAILER_FORMAT_0 0
-
-typedef unsigned int mach_msg_trailer_size_t;
-typedef char *mach_msg_trailer_info_t;
-
-typedef struct{
- mach_msg_trailer_type_t msgh_trailer_type;
- mach_msg_trailer_size_t msgh_trailer_size;
-} mach_msg_trailer_t;
-
-/*
- * The msgh_seqno field carries a sequence number
- * associated with the received-from port. A port's
- * sequence number is incremented every time a message
- * is received from it and included in the received
- * trailer to help put messages back in sequence if
- * multiple threads receive and/or process received
- * messages.
- */
-typedef struct{
- mach_msg_trailer_type_t msgh_trailer_type;
- mach_msg_trailer_size_t msgh_trailer_size;
- mach_port_seqno_t msgh_seqno;
-} mach_msg_seqno_trailer_t;
-
-typedef struct{
- unsigned int val[2];
-} security_token_t;
-
-typedef struct{
- mach_msg_trailer_type_t msgh_trailer_type;
- mach_msg_trailer_size_t msgh_trailer_size;
- mach_port_seqno_t msgh_seqno;
- security_token_t msgh_sender;
-} mach_msg_security_trailer_t;
-
-/*
- * The audit token is an opaque token which identifies
- * Mach tasks and senders of Mach messages as subjects
- * to the BSM audit system. Only the appropriate BSM
- * library routines should be used to interpret the
- * contents of the audit token as the representation
- * of the subject identity within the token may change
- * over time.
- */
-typedef struct{
- unsigned int val[8];
-} audit_token_t;
-
-typedef struct{
- mach_msg_trailer_type_t msgh_trailer_type;
- mach_msg_trailer_size_t msgh_trailer_size;
- mach_port_seqno_t msgh_seqno;
- security_token_t msgh_sender;
- audit_token_t msgh_audit;
-} mach_msg_audit_trailer_t;
-
-typedef struct{
- mach_msg_trailer_type_t msgh_trailer_type;
- mach_msg_trailer_size_t msgh_trailer_size;
- mach_port_seqno_t msgh_seqno;
- security_token_t msgh_sender;
- audit_token_t msgh_audit;
- mach_port_context_t msgh_context;
-} mach_msg_context_trailer_t;
-
-
-
-typedef struct{
- mach_port_name_t sender;
-} msg_labels_t;
-
-/*
- * Trailer type to pass MAC policy label info as a mach message trailer.
- *
- */
-
-typedef struct{
- mach_msg_trailer_type_t msgh_trailer_type;
- mach_msg_trailer_size_t msgh_trailer_size;
- mach_port_seqno_t msgh_seqno;
- security_token_t msgh_sender;
- audit_token_t msgh_audit;
- mach_port_context_t msgh_context;
- int msgh_ad;
- msg_labels_t msgh_labels;
-} mach_msg_mac_trailer_t;
-
-
-#define MACH_MSG_TRAILER_MINIMUM_SIZE sizeof(mach_msg_trailer_t)
-
-/*
- * These values can change from release to release - but clearly
- * code cannot request additional trailer elements one was not
- * compiled to understand. Therefore, it is safe to use this
- * constant when the same module specified the receive options.
- * Otherwise, you run the risk that the options requested by
- * another module may exceed the local modules notion of
- * MAX_TRAILER_SIZE.
- */
-
-typedef mach_msg_mac_trailer_t mach_msg_max_trailer_t;
-#define MAX_TRAILER_SIZE ((mach_msg_size_t)sizeof(mach_msg_max_trailer_t))
-
-/*
- * Legacy requirements keep us from ever updating these defines (even
- * when the format_0 trailers gain new option data fields in the future).
- * Therefore, they shouldn't be used going forward. Instead, the sizes
- * should be compared against the specific element size requested using
- * REQUESTED_TRAILER_SIZE.
- */
-typedef mach_msg_security_trailer_t mach_msg_format_0_trailer_t;
-
-/*typedef mach_msg_mac_trailer_t mach_msg_format_0_trailer_t;
- */
-
-#define MACH_MSG_TRAILER_FORMAT_0_SIZE sizeof(mach_msg_format_0_trailer_t)
-
-#define KERNEL_SECURITY_TOKEN_VALUE { {0, 1} }
-extern const security_token_t KERNEL_SECURITY_TOKEN;
-
-#define KERNEL_AUDIT_TOKEN_VALUE { {0, 0, 0, 0, 0, 0, 0, 0} }
-extern const audit_token_t KERNEL_AUDIT_TOKEN;
-
-typedef integer_t mach_msg_options_t;
-
-typedef struct{
- mach_msg_header_t header;
-} mach_msg_empty_send_t;
-
-typedef struct{
- mach_msg_header_t header;
- mach_msg_trailer_t trailer;
-} mach_msg_empty_rcv_t;
-
-typedef union{
- mach_msg_empty_send_t send;
- mach_msg_empty_rcv_t rcv;
-} mach_msg_empty_t;
-
-#pragma pack(pop)
-
-/* utility to round the message size - will become machine dependent */
-#define round_msg(x) (((mach_msg_size_t)(x) + sizeof (natural_t) - 1) & \
- ~(sizeof (natural_t) - 1))
-
-
-/*
- * There is no fixed upper bound to the size of Mach messages.
- */
-#define MACH_MSG_SIZE_MAX ((mach_msg_size_t) ~0)
-
-#if defined(__APPLE_API_PRIVATE)
-/*
- * But architectural limits of a given implementation, or
- * temporal conditions may cause unpredictable send failures
- * for messages larger than MACH_MSG_SIZE_RELIABLE.
- *
- * In either case, waiting for memory is [currently] outside
- * the scope of send timeout values provided to IPC.
- */
-#define MACH_MSG_SIZE_RELIABLE ((mach_msg_size_t) 256 * 1024)
-#endif
-/*
- * Compatibility definitions, for code written
- * when there was a msgh_kind instead of msgh_seqno.
- */
-#define MACH_MSGH_KIND_NORMAL 0x00000000
-#define MACH_MSGH_KIND_NOTIFICATION 0x00000001
-#define msgh_kind msgh_seqno
-#define mach_msg_kind_t mach_port_seqno_t
-
-typedef natural_t mach_msg_type_size_t;
-typedef natural_t mach_msg_type_number_t;
-
-/*
- * Values received/carried in messages. Tells the receiver what
- * sort of port right he now has.
- *
- * MACH_MSG_TYPE_PORT_NAME is used to transfer a port name
- * which should remain uninterpreted by the kernel. (Port rights
- * are not transferred, just the port name.)
- */
-
-#define MACH_MSG_TYPE_PORT_NONE 0
-
-#define MACH_MSG_TYPE_PORT_NAME 15
-#define MACH_MSG_TYPE_PORT_RECEIVE MACH_MSG_TYPE_MOVE_RECEIVE
-#define MACH_MSG_TYPE_PORT_SEND MACH_MSG_TYPE_MOVE_SEND
-#define MACH_MSG_TYPE_PORT_SEND_ONCE MACH_MSG_TYPE_MOVE_SEND_ONCE
-
-#define MACH_MSG_TYPE_LAST 22 /* Last assigned */
-
-/*
- * A dummy value. Mostly used to indicate that the actual value
- * will be filled in later, dynamically.
- */
-
-#define MACH_MSG_TYPE_POLYMORPHIC ((mach_msg_type_name_t) -1)
-
-/*
- * Is a given item a port type?
- */
-
-#define MACH_MSG_TYPE_PORT_ANY(x) \
- (((x) >= MACH_MSG_TYPE_MOVE_RECEIVE) && \
- ((x) <= MACH_MSG_TYPE_MAKE_SEND_ONCE))
-
-#define MACH_MSG_TYPE_PORT_ANY_SEND(x) \
- (((x) >= MACH_MSG_TYPE_MOVE_SEND) && \
- ((x) <= MACH_MSG_TYPE_MAKE_SEND_ONCE))
-
-#define MACH_MSG_TYPE_PORT_ANY_RIGHT(x) \
- (((x) >= MACH_MSG_TYPE_MOVE_RECEIVE) && \
- ((x) <= MACH_MSG_TYPE_MOVE_SEND_ONCE))
-
-typedef integer_t mach_msg_option_t;
-
-#define MACH_MSG_OPTION_NONE 0x00000000
-
-#define MACH_SEND_MSG 0x00000001
-#define MACH_RCV_MSG 0x00000002
-
-#define MACH_RCV_LARGE 0x00000004 /* report large message sizes */
-#define MACH_RCV_LARGE_IDENTITY 0x00000008 /* identify source of large messages */
-
-#define MACH_SEND_TIMEOUT 0x00000010 /* timeout value applies to send */
-#define MACH_SEND_OVERRIDE 0x00000020 /* priority override for send */
-#define MACH_SEND_INTERRUPT 0x00000040 /* don't restart interrupted sends */
-#define MACH_SEND_NOTIFY 0x00000080 /* arm send-possible notify */
-#define MACH_SEND_ALWAYS 0x00010000 /* ignore qlimits - kernel only */
-#define MACH_SEND_TRAILER 0x00020000 /* sender-provided trailer */
-#define MACH_SEND_NOIMPORTANCE 0x00040000 /* msg won't carry importance */
-#define MACH_SEND_NODENAP MACH_SEND_NOIMPORTANCE
-#define MACH_SEND_IMPORTANCE 0x00080000 /* msg carries importance - kernel only */
-#define MACH_SEND_SYNC_OVERRIDE 0x00100000 /* msg should do sync ipc override */
-#define MACH_SEND_PROPAGATE_QOS 0x00200000 /* IPC should propagate the caller's QoS */
-#define MACH_SEND_SYNC_USE_THRPRI MACH_SEND_PROPAGATE_QOS /* obsolete name */
-#define MACH_SEND_KERNEL 0x00400000 /* full send from kernel space - kernel only */
-#define MACH_SEND_SYNC_BOOTSTRAP_CHECKIN 0x00800000 /* special reply port should boost thread doing sync bootstrap checkin */
-
-#define MACH_RCV_TIMEOUT 0x00000100 /* timeout value applies to receive */
-#define MACH_RCV_NOTIFY 0x00000000 /* legacy name (value was: 0x00000200) */
-#define MACH_RCV_INTERRUPT 0x00000400 /* don't restart interrupted receive */
-#define MACH_RCV_VOUCHER 0x00000800 /* willing to receive voucher port */
-#define MACH_RCV_OVERWRITE 0x00000000 /* scatter receive (deprecated) */
-#define MACH_RCV_GUARDED_DESC 0x00001000 /* Can receive new guarded descriptor */
-#define MACH_RCV_SYNC_WAIT 0x00004000 /* sync waiter waiting for rcv */
-#define MACH_RCV_SYNC_PEEK 0x00008000 /* sync waiter waiting to peek */
-
-#define MACH_MSG_STRICT_REPLY 0x00000200 /* Enforce specific properties about the reply port, and
- * the context in which a thread replies to a message.
- * This flag must be passed on both the SEND and RCV */
-
-
-/*
- * NOTE: a 0x00------ RCV mask implies to ask for
- * a MACH_MSG_TRAILER_FORMAT_0 with 0 Elements,
- * which is equivalent to a mach_msg_trailer_t.
- *
- * XXXMAC: unlike the rest of the MACH_RCV_* flags, MACH_RCV_TRAILER_LABELS
- * needs its own private bit since we only calculate its fields when absolutely
- * required.
- */
-#define MACH_RCV_TRAILER_NULL 0
-#define MACH_RCV_TRAILER_SEQNO 1
-#define MACH_RCV_TRAILER_SENDER 2
-#define MACH_RCV_TRAILER_AUDIT 3
-#define MACH_RCV_TRAILER_CTX 4
-#define MACH_RCV_TRAILER_AV 7
-#define MACH_RCV_TRAILER_LABELS 8
-
-#define MACH_RCV_TRAILER_TYPE(x) (((x) & 0xf) << 28)
-#define MACH_RCV_TRAILER_ELEMENTS(x) (((x) & 0xf) << 24)
-#define MACH_RCV_TRAILER_MASK ((0xf << 24))
-
-#define GET_RCV_ELEMENTS(y) (((y) >> 24) & 0xf)
-
-
-/*
- * XXXMAC: note that in the case of MACH_RCV_TRAILER_LABELS,
- * we just fall through to mach_msg_max_trailer_t.
- * This is correct behavior since mach_msg_max_trailer_t is defined as
- * mac_msg_mac_trailer_t which is used for the LABELS trailer.
- * It also makes things work properly if MACH_RCV_TRAILER_LABELS is ORed
- * with one of the other options.
- */
-
-#define REQUESTED_TRAILER_SIZE_NATIVE(y) \
- ((mach_msg_trailer_size_t) \
- ((GET_RCV_ELEMENTS(y) == MACH_RCV_TRAILER_NULL) ? \
- sizeof(mach_msg_trailer_t) : \
- ((GET_RCV_ELEMENTS(y) == MACH_RCV_TRAILER_SEQNO) ? \
- sizeof(mach_msg_seqno_trailer_t) : \
- ((GET_RCV_ELEMENTS(y) == MACH_RCV_TRAILER_SENDER) ? \
- sizeof(mach_msg_security_trailer_t) : \
- ((GET_RCV_ELEMENTS(y) == MACH_RCV_TRAILER_AUDIT) ? \
- sizeof(mach_msg_audit_trailer_t) : \
- ((GET_RCV_ELEMENTS(y) == MACH_RCV_TRAILER_CTX) ? \
- sizeof(mach_msg_context_trailer_t) : \
- ((GET_RCV_ELEMENTS(y) == MACH_RCV_TRAILER_AV) ? \
- sizeof(mach_msg_mac_trailer_t) : \
- sizeof(mach_msg_max_trailer_t))))))))
-
-
-#define REQUESTED_TRAILER_SIZE(y) REQUESTED_TRAILER_SIZE_NATIVE(y)
-
-/*
- * Much code assumes that mach_msg_return_t == kern_return_t.
- * This definition is useful for descriptive purposes.
- *
- * See for the format of error codes.
- * IPC errors are system 4. Send errors are subsystem 0;
- * receive errors are subsystem 1. The code field is always non-zero.
- * The high bits of the code field communicate extra information
- * for some error codes. MACH_MSG_MASK masks off these special bits.
- */
-
-typedef kern_return_t mach_msg_return_t;
-
-#define MACH_MSG_SUCCESS 0x00000000
-
-
-#define MACH_MSG_MASK 0x00003e00
-/* All special error code bits defined below. */
-#define MACH_MSG_IPC_SPACE 0x00002000
-/* No room in IPC name space for another capability name. */
-#define MACH_MSG_VM_SPACE 0x00001000
-/* No room in VM address space for out-of-line memory. */
-#define MACH_MSG_IPC_KERNEL 0x00000800
-/* Kernel resource shortage handling an IPC capability. */
-#define MACH_MSG_VM_KERNEL 0x00000400
-/* Kernel resource shortage handling out-of-line memory. */
-
-#define MACH_SEND_IN_PROGRESS 0x10000001
-/* Thread is waiting to send. (Internal use only.) */
-#define MACH_SEND_INVALID_DATA 0x10000002
-/* Bogus in-line data. */
-#define MACH_SEND_INVALID_DEST 0x10000003
-/* Bogus destination port. */
-#define MACH_SEND_TIMED_OUT 0x10000004
-/* Message not sent before timeout expired. */
-#define MACH_SEND_INVALID_VOUCHER 0x10000005
-/* Bogus voucher port. */
-#define MACH_SEND_INTERRUPTED 0x10000007
-/* Software interrupt. */
-#define MACH_SEND_MSG_TOO_SMALL 0x10000008
-/* Data doesn't contain a complete message. */
-#define MACH_SEND_INVALID_REPLY 0x10000009
-/* Bogus reply port. */
-#define MACH_SEND_INVALID_RIGHT 0x1000000a
-/* Bogus port rights in the message body. */
-#define MACH_SEND_INVALID_NOTIFY 0x1000000b
-/* Bogus notify port argument. */
-#define MACH_SEND_INVALID_MEMORY 0x1000000c
-/* Invalid out-of-line memory pointer. */
-#define MACH_SEND_NO_BUFFER 0x1000000d
-/* No message buffer is available. */
-#define MACH_SEND_TOO_LARGE 0x1000000e
-/* Send is too large for port */
-#define MACH_SEND_INVALID_TYPE 0x1000000f
-/* Invalid msg-type specification. */
-#define MACH_SEND_INVALID_HEADER 0x10000010
-/* A field in the header had a bad value. */
-#define MACH_SEND_INVALID_TRAILER 0x10000011
-/* The trailer to be sent does not match kernel format. */
-#define MACH_SEND_INVALID_CONTEXT 0x10000012
-/* The sending thread context did not match the context on the dest port */
-#define MACH_SEND_INVALID_RT_OOL_SIZE 0x10000015
-/* compatibility: no longer a returned error */
-#define MACH_SEND_NO_GRANT_DEST 0x10000016
-/* The destination port doesn't accept ports in body */
-
-#define MACH_RCV_IN_PROGRESS 0x10004001
-/* Thread is waiting for receive. (Internal use only.) */
-#define MACH_RCV_INVALID_NAME 0x10004002
-/* Bogus name for receive port/port-set. */
-#define MACH_RCV_TIMED_OUT 0x10004003
-/* Didn't get a message within the timeout value. */
-#define MACH_RCV_TOO_LARGE 0x10004004
-/* Message buffer is not large enough for inline data. */
-#define MACH_RCV_INTERRUPTED 0x10004005
-/* Software interrupt. */
-#define MACH_RCV_PORT_CHANGED 0x10004006
-/* compatibility: no longer a returned error */
-#define MACH_RCV_INVALID_NOTIFY 0x10004007
-/* Bogus notify port argument. */
-#define MACH_RCV_INVALID_DATA 0x10004008
-/* Bogus message buffer for inline data. */
-#define MACH_RCV_PORT_DIED 0x10004009
-/* Port/set was sent away/died during receive. */
-#define MACH_RCV_IN_SET 0x1000400a
-/* compatibility: no longer a returned error */
-#define MACH_RCV_HEADER_ERROR 0x1000400b
-/* Error receiving message header. See special bits. */
-#define MACH_RCV_BODY_ERROR 0x1000400c
-/* Error receiving message body. See special bits. */
-#define MACH_RCV_INVALID_TYPE 0x1000400d
-/* Invalid msg-type specification in scatter list. */
-#define MACH_RCV_SCATTER_SMALL 0x1000400e
-/* Out-of-line overwrite region is not large enough */
-#define MACH_RCV_INVALID_TRAILER 0x1000400f
-/* trailer type or number of trailer elements not supported */
-#define MACH_RCV_IN_PROGRESS_TIMED 0x10004011
-/* Waiting for receive with timeout. (Internal use only.) */
-#define MACH_RCV_INVALID_REPLY 0x10004012
-/* invalid reply port used in a STRICT_REPLY message */
-
-
-
-__BEGIN_DECLS
-
-/*
- * Routine: mach_msg_overwrite
- * Purpose:
- * Send and/or receive a message. If the message operation
- * is interrupted, and the user did not request an indication
- * of that fact, then restart the appropriate parts of the
- * operation silently (trap version does not restart).
- *
- * Distinct send and receive buffers may be specified. If
- * no separate receive buffer is specified, the msg parameter
- * will be used for both send and receive operations.
- *
- * In addition to a distinct receive buffer, that buffer may
- * already contain scatter control information to direct the
- * receiving of the message.
- */
-__WATCHOS_PROHIBITED __TVOS_PROHIBITED
-extern mach_msg_return_t mach_msg_overwrite(
- mach_msg_header_t *msg,
- mach_msg_option_t option,
- mach_msg_size_t send_size,
- mach_msg_size_t rcv_size,
- mach_port_name_t rcv_name,
- mach_msg_timeout_t timeout,
- mach_port_name_t notify,
- mach_msg_header_t *rcv_msg,
- mach_msg_size_t rcv_limit);
-
-
-/*
- * Routine: mach_msg
- * Purpose:
- * Send and/or receive a message. If the message operation
- * is interrupted, and the user did not request an indication
- * of that fact, then restart the appropriate parts of the
- * operation silently (trap version does not restart).
- */
-__WATCHOS_PROHIBITED __TVOS_PROHIBITED
-extern mach_msg_return_t mach_msg(
- mach_msg_header_t *msg,
- mach_msg_option_t option,
- mach_msg_size_t send_size,
- mach_msg_size_t rcv_size,
- mach_port_name_t rcv_name,
- mach_msg_timeout_t timeout,
- mach_port_name_t notify);
-
-/*
- * Routine: mach_voucher_deallocate
- * Purpose:
- * Deallocate a mach voucher created or received in a message. Drops
- * one (send right) reference to the voucher.
- */
-__WATCHOS_PROHIBITED __TVOS_PROHIBITED
-extern kern_return_t mach_voucher_deallocate(
- mach_port_name_t voucher);
-
-
-__END_DECLS
-
-#endif /* _MACH_MESSAGE_H_ */
\ No newline at end of file
diff --git a/lib/libc/include/x86_64-macos-gnu/mach/port.h b/lib/libc/include/x86_64-macos-gnu/mach/port.h
deleted file mode 100644
index 3547576e80..0000000000
--- a/lib/libc/include/x86_64-macos-gnu/mach/port.h
+++ /dev/null
@@ -1,422 +0,0 @@
-/*
- * Copyright (c) 2000-2006 Apple Computer, Inc. All rights reserved.
- *
- * @APPLE_OSREFERENCE_LICENSE_HEADER_START@
- *
- * This file contains Original Code and/or Modifications of Original Code
- * as defined in and that are subject to the Apple Public Source License
- * Version 2.0 (the 'License'). You may not use this file except in
- * compliance with the License. The rights granted to you under the License
- * may not be used to create, or enable the creation or redistribution of,
- * unlawful or unlicensed copies of an Apple operating system, or to
- * circumvent, violate, or enable the circumvention or violation of, any
- * terms of an Apple operating system software license agreement.
- *
- * Please obtain a copy of the License at
- * http://www.opensource.apple.com/apsl/ and read it before using this file.
- *
- * The Original Code and all software distributed under the License are
- * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
- * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
- * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
- * Please see the License for the specific language governing rights and
- * limitations under the License.
- *
- * @APPLE_OSREFERENCE_LICENSE_HEADER_END@
- */
-/*
- * @OSF_COPYRIGHT@
- */
-/*
- * Mach Operating System
- * Copyright (c) 1991,1990,1989,1988,1987 Carnegie Mellon University
- * All Rights Reserved.
- *
- * Permission to use, copy, modify and distribute this software and its
- * documentation is hereby granted, provided that both the copyright
- * notice and this permission notice appear in all copies of the
- * software, derivative works or modified versions, and any portions
- * thereof, and that both notices appear in supporting documentation.
- *
- * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS"
- * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR
- * ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE.
- *
- * Carnegie Mellon requests users of this software to return to
- *
- * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU
- * School of Computer Science
- * Carnegie Mellon University
- * Pittsburgh PA 15213-3890
- *
- * any improvements or extensions that they make and grant Carnegie Mellon
- * the rights to redistribute these changes.
- */
-/*
- * NOTICE: This file was modified by McAfee Research in 2004 to introduce
- * support for mandatory and extensible security protections. This notice
- * is included in support of clause 2.2 (b) of the Apple Public License,
- * Version 2.0.
- */
-/*
- */
-/*
- * File: mach/port.h
- *
- * Definition of a Mach port
- *
- * Mach ports are the endpoints to Mach-implemented communications
- * channels (usually uni-directional message queues, but other types
- * also exist).
- *
- * Unique collections of these endpoints are maintained for each
- * Mach task. Each Mach port in the task's collection is given a
- * [task-local] name to identify it - and the the various "rights"
- * held by the task for that specific endpoint.
- *
- * This header defines the types used to identify these Mach ports
- * and the various rights associated with them. For more info see:
- *
- * - manipulation of port rights in a given space
- * - message queue [and port right passing] mechanism
- *
- */
-
-#ifndef _MACH_PORT_H_
-#define _MACH_PORT_H_
-
-#include
-#include
-#include
-#include
-
-/*
- * mach_port_name_t - the local identity for a Mach port
- *
- * The name is Mach port namespace specific. It is used to
- * identify the rights held for that port by the task whose
- * namespace is implied [or specifically provided].
- *
- * Use of this type usually implies just a name - no rights.
- * See mach_port_t for a type that implies a "named right."
- *
- */
-
-typedef natural_t mach_port_name_t;
-typedef mach_port_name_t *mach_port_name_array_t;
-
-
-/*
- * mach_port_t - a named port right
- *
- * In user-space, "rights" are represented by the name of the
- * right in the Mach port namespace. Even so, this type is
- * presented as a unique one to more clearly denote the presence
- * of a right coming along with the name.
- *
- * Often, various rights for a port held in a single name space
- * will coalesce and are, therefore, be identified by a single name
- * [this is the case for send and receive rights]. But not
- * always [send-once rights currently get a unique name for
- * each right].
- *
- */
-
-#include
-#include
-
-
-typedef mach_port_t *mach_port_array_t;
-
-/*
- * MACH_PORT_NULL is a legal value that can be carried in messages.
- * It indicates the absence of any port or port rights. (A port
- * argument keeps the message from being "simple", even if the
- * value is MACH_PORT_NULL.) The value MACH_PORT_DEAD is also a legal
- * value that can be carried in messages. It indicates
- * that a port right was present, but it died.
- */
-
-#define MACH_PORT_NULL 0 /* intentional loose typing */
-#define MACH_PORT_DEAD ((mach_port_name_t) ~0)
-#define MACH_PORT_VALID(name) \
- (((name) != MACH_PORT_NULL) && \
- ((name) != MACH_PORT_DEAD))
-
-
-/*
- * For kernel-selected [assigned] port names, the name is
- * comprised of two parts: a generation number and an index.
- * This approach keeps the exact same name from being generated
- * and reused too quickly [to catch right/reference counting bugs].
- * The dividing line between the constituent parts is exposed so
- * that efficient "mach_port_name_t to data structure pointer"
- * conversion implementation can be made. But it is possible
- * for user-level code to assign their own names to Mach ports.
- * These are not required to participate in this algorithm. So
- * care should be taken before "assuming" this model.
- *
- */
-
-#ifndef NO_PORT_GEN
-
-#define MACH_PORT_INDEX(name) ((name) >> 8)
-#define MACH_PORT_GEN(name) (((name) & 0xff) << 24)
-#define MACH_PORT_MAKE(index, gen) \
- (((index) << 8) | (gen) >> 24)
-
-#else /* NO_PORT_GEN */
-
-#define MACH_PORT_INDEX(name) (name)
-#define MACH_PORT_GEN(name) (0)
-#define MACH_PORT_MAKE(index, gen) (index)
-
-#endif /* NO_PORT_GEN */
-
-
-/*
- * These are the different rights a task may have for a port.
- * The MACH_PORT_RIGHT_* definitions are used as arguments
- * to mach_port_allocate, mach_port_get_refs, etc, to specify
- * a particular right to act upon. The mach_port_names and
- * mach_port_type calls return bitmasks using the MACH_PORT_TYPE_*
- * definitions. This is because a single name may denote
- * multiple rights.
- */
-
-typedef natural_t mach_port_right_t;
-
-#define MACH_PORT_RIGHT_SEND ((mach_port_right_t) 0)
-#define MACH_PORT_RIGHT_RECEIVE ((mach_port_right_t) 1)
-#define MACH_PORT_RIGHT_SEND_ONCE ((mach_port_right_t) 2)
-#define MACH_PORT_RIGHT_PORT_SET ((mach_port_right_t) 3)
-#define MACH_PORT_RIGHT_DEAD_NAME ((mach_port_right_t) 4)
-#define MACH_PORT_RIGHT_LABELH ((mach_port_right_t) 5) /* obsolete right */
-#define MACH_PORT_RIGHT_NUMBER ((mach_port_right_t) 6) /* right not implemented */
-
-
-typedef natural_t mach_port_type_t;
-typedef mach_port_type_t *mach_port_type_array_t;
-
-#define MACH_PORT_TYPE(right) \
- ((mach_port_type_t)(((mach_port_type_t) 1) \
- << ((right) + ((mach_port_right_t) 16))))
-#define MACH_PORT_TYPE_NONE ((mach_port_type_t) 0L)
-#define MACH_PORT_TYPE_SEND MACH_PORT_TYPE(MACH_PORT_RIGHT_SEND)
-#define MACH_PORT_TYPE_RECEIVE MACH_PORT_TYPE(MACH_PORT_RIGHT_RECEIVE)
-#define MACH_PORT_TYPE_SEND_ONCE MACH_PORT_TYPE(MACH_PORT_RIGHT_SEND_ONCE)
-#define MACH_PORT_TYPE_PORT_SET MACH_PORT_TYPE(MACH_PORT_RIGHT_PORT_SET)
-#define MACH_PORT_TYPE_DEAD_NAME MACH_PORT_TYPE(MACH_PORT_RIGHT_DEAD_NAME)
-#define MACH_PORT_TYPE_LABELH MACH_PORT_TYPE(MACH_PORT_RIGHT_LABELH) /* obsolete */
-
-
-
-/* Convenient combinations. */
-
-#define MACH_PORT_TYPE_SEND_RECEIVE \
- (MACH_PORT_TYPE_SEND|MACH_PORT_TYPE_RECEIVE)
-#define MACH_PORT_TYPE_SEND_RIGHTS \
- (MACH_PORT_TYPE_SEND|MACH_PORT_TYPE_SEND_ONCE)
-#define MACH_PORT_TYPE_PORT_RIGHTS \
- (MACH_PORT_TYPE_SEND_RIGHTS|MACH_PORT_TYPE_RECEIVE)
-#define MACH_PORT_TYPE_PORT_OR_DEAD \
- (MACH_PORT_TYPE_PORT_RIGHTS|MACH_PORT_TYPE_DEAD_NAME)
-#define MACH_PORT_TYPE_ALL_RIGHTS \
- (MACH_PORT_TYPE_PORT_OR_DEAD|MACH_PORT_TYPE_PORT_SET)
-
-/* Dummy type bits that mach_port_type/mach_port_names can return. */
-
-#define MACH_PORT_TYPE_DNREQUEST 0x80000000
-#define MACH_PORT_TYPE_SPREQUEST 0x40000000
-#define MACH_PORT_TYPE_SPREQUEST_DELAYED 0x20000000
-
-/* User-references for capabilities. */
-
-typedef natural_t mach_port_urefs_t;
-typedef integer_t mach_port_delta_t; /* change in urefs */
-
-/* Attributes of ports. (See mach_port_get_receive_status.) */
-
-typedef natural_t mach_port_seqno_t; /* sequence number */
-typedef natural_t mach_port_mscount_t; /* make-send count */
-typedef natural_t mach_port_msgcount_t; /* number of msgs */
-typedef natural_t mach_port_rights_t; /* number of rights */
-
-/*
- * Are there outstanding send rights for a given port?
- */
-#define MACH_PORT_SRIGHTS_NONE 0 /* no srights */
-#define MACH_PORT_SRIGHTS_PRESENT 1 /* srights */
-typedef unsigned int mach_port_srights_t; /* status of send rights */
-
-typedef struct mach_port_status {
- mach_port_rights_t mps_pset; /* count of containing port sets */
- mach_port_seqno_t mps_seqno; /* sequence number */
- mach_port_mscount_t mps_mscount; /* make-send count */
- mach_port_msgcount_t mps_qlimit; /* queue limit */
- mach_port_msgcount_t mps_msgcount; /* number in the queue */
- mach_port_rights_t mps_sorights; /* how many send-once rights */
- boolean_t mps_srights; /* do send rights exist? */
- boolean_t mps_pdrequest; /* port-deleted requested? */
- boolean_t mps_nsrequest; /* no-senders requested? */
- natural_t mps_flags; /* port flags */
-} mach_port_status_t;
-
-/* System-wide values for setting queue limits on a port */
-#define MACH_PORT_QLIMIT_ZERO (0)
-#define MACH_PORT_QLIMIT_BASIC (5)
-#define MACH_PORT_QLIMIT_SMALL (16)
-#define MACH_PORT_QLIMIT_LARGE (1024)
-#define MACH_PORT_QLIMIT_KERNEL (65534)
-#define MACH_PORT_QLIMIT_MIN MACH_PORT_QLIMIT_ZERO
-#define MACH_PORT_QLIMIT_DEFAULT MACH_PORT_QLIMIT_BASIC
-#define MACH_PORT_QLIMIT_MAX MACH_PORT_QLIMIT_LARGE
-
-typedef struct mach_port_limits {
- mach_port_msgcount_t mpl_qlimit; /* number of msgs */
-} mach_port_limits_t;
-
-/* Possible values for mps_flags (part of mach_port_status_t) */
-#define MACH_PORT_STATUS_FLAG_TEMPOWNER 0x01
-#define MACH_PORT_STATUS_FLAG_GUARDED 0x02
-#define MACH_PORT_STATUS_FLAG_STRICT_GUARD 0x04
-#define MACH_PORT_STATUS_FLAG_IMP_DONATION 0x08
-#define MACH_PORT_STATUS_FLAG_REVIVE 0x10
-#define MACH_PORT_STATUS_FLAG_TASKPTR 0x20
-#define MACH_PORT_STATUS_FLAG_GUARD_IMMOVABLE_RECEIVE 0x40
-#define MACH_PORT_STATUS_FLAG_NO_GRANT 0x80
-
-typedef struct mach_port_info_ext {
- mach_port_status_t mpie_status;
- mach_port_msgcount_t mpie_boost_cnt;
- uint32_t reserved[6];
-} mach_port_info_ext_t;
-
-typedef integer_t *mach_port_info_t; /* varying array of natural_t */
-
-/* Flavors for mach_port_get/set_attributes() */
-typedef int mach_port_flavor_t;
-#define MACH_PORT_LIMITS_INFO 1 /* uses mach_port_limits_t */
-#define MACH_PORT_RECEIVE_STATUS 2 /* uses mach_port_status_t */
-#define MACH_PORT_DNREQUESTS_SIZE 3 /* info is int */
-#define MACH_PORT_TEMPOWNER 4 /* indicates receive right will be reassigned to another task */
-#define MACH_PORT_IMPORTANCE_RECEIVER 5 /* indicates recieve right accepts priority donation */
-#define MACH_PORT_DENAP_RECEIVER 6 /* indicates receive right accepts de-nap donation */
-#define MACH_PORT_INFO_EXT 7 /* uses mach_port_info_ext_t */
-
-#define MACH_PORT_LIMITS_INFO_COUNT ((natural_t) \
- (sizeof(mach_port_limits_t)/sizeof(natural_t)))
-#define MACH_PORT_RECEIVE_STATUS_COUNT ((natural_t) \
- (sizeof(mach_port_status_t)/sizeof(natural_t)))
-#define MACH_PORT_DNREQUESTS_SIZE_COUNT 1
-#define MACH_PORT_INFO_EXT_COUNT ((natural_t) \
- (sizeof(mach_port_info_ext_t)/sizeof(natural_t)))
-/*
- * Structure used to pass information about port allocation requests.
- * Must be padded to 64-bits total length.
- */
-typedef struct mach_port_qos {
- unsigned int name:1; /* name given */
- unsigned int prealloc:1; /* prealloced message */
- boolean_t pad1:30;
- natural_t len;
-} mach_port_qos_t;
-
-/* Mach Port Guarding definitions */
-
-/*
- * Flags for mach_port_options (used for
- * invocation of mach_port_construct).
- * Indicates attributes to be set for the newly
- * allocated port.
- */
-#define MPO_CONTEXT_AS_GUARD 0x01 /* Add guard to the port */
-#define MPO_QLIMIT 0x02 /* Set qlimit for the port msg queue */
-#define MPO_TEMPOWNER 0x04 /* Set the tempowner bit of the port */
-#define MPO_IMPORTANCE_RECEIVER 0x08 /* Mark the port as importance receiver */
-#define MPO_INSERT_SEND_RIGHT 0x10 /* Insert a send right for the port */
-#define MPO_STRICT 0x20 /* Apply strict guarding for port */
-#define MPO_DENAP_RECEIVER 0x40 /* Mark the port as App de-nap receiver */
-#define MPO_IMMOVABLE_RECEIVE 0x80 /* Mark the port as immovable; protected by the guard context */
-/*
- * Structure to define optional attributes for a newly
- * constructed port.
- */
-typedef struct mach_port_options {
- uint32_t flags; /* Flags defining attributes for port */
- mach_port_limits_t mpl; /* Message queue limit for port */
- uint64_t reserved[2]; /* Reserved */
-}mach_port_options_t;
-
-typedef mach_port_options_t *mach_port_options_ptr_t;
-
-/*
- * EXC_GUARD represents a guard violation for both
- * mach ports and file descriptors. GUARD_TYPE_ is used
- * to differentiate among them.
- */
-#define GUARD_TYPE_MACH_PORT 0x1
-
-/* Reasons for exception for a guarded mach port */
-enum mach_port_guard_exception_codes {
- kGUARD_EXC_DESTROY = 1u << 0,
- kGUARD_EXC_MOD_REFS = 1u << 1,
- kGUARD_EXC_SET_CONTEXT = 1u << 2,
- kGUARD_EXC_UNGUARDED = 1u << 3,
- kGUARD_EXC_INCORRECT_GUARD = 1u << 4,
- kGUARD_EXC_IMMOVABLE = 1u << 5,
- kGUARD_EXC_STRICT_REPLY = 1u << 6,
- /* start of [optionally] non-fatal guards */
- kGUARD_EXC_INVALID_RIGHT = 1u << 8,
- kGUARD_EXC_INVALID_NAME = 1u << 9,
- kGUARD_EXC_INVALID_VALUE = 1u << 10,
- kGUARD_EXC_INVALID_ARGUMENT = 1u << 11,
- kGUARD_EXC_RIGHT_EXISTS = 1u << 12,
- kGUARD_EXC_KERN_NO_SPACE = 1u << 13,
- kGUARD_EXC_KERN_FAILURE = 1u << 14,
- kGUARD_EXC_KERN_RESOURCE = 1u << 15,
- kGUARD_EXC_SEND_INVALID_REPLY = 1u << 16,
- kGUARD_EXC_SEND_INVALID_VOUCHER = 1u << 17,
- kGUARD_EXC_SEND_INVALID_RIGHT = 1u << 18,
- kGUARD_EXC_RCV_INVALID_NAME = 1u << 19,
- kGUARD_EXC_RCV_GUARDED_DESC = 1u << 20, /* should never be fatal; for development only */
-};
-
-#define MAX_FATAL_kGUARD_EXC_CODE (1u << 6)
-
-/*
- * These flags are used as bits in the subcode of kGUARD_EXC_STRICT_REPLY exceptions.
- */
-#define MPG_FLAGS_STRICT_REPLY_INVALID_REPLY_DISP (0x01ull << 56)
-#define MPG_FLAGS_STRICT_REPLY_INVALID_REPLY_PORT (0x02ull << 56)
-#define MPG_FLAGS_STRICT_REPLY_INVALID_VOUCHER (0x04ull << 56)
-#define MPG_FLAGS_STRICT_REPLY_NO_BANK_ATTR (0x08ull << 56)
-#define MPG_FLAGS_STRICT_REPLY_MISMATCHED_PERSONA (0x10ull << 56)
-#define MPG_FLAGS_STRICT_REPLY_MASK (0xffull << 56)
-
-/*
- * Flags for mach_port_guard_with_flags. These flags extend
- * the attributes associated with a guarded port.
- */
-#define MPG_STRICT 0x01 /* Apply strict guarding for a port */
-#define MPG_IMMOVABLE_RECEIVE 0x02 /* Receive right cannot be moved out of the space */
-
-#if !__DARWIN_UNIX03 && !defined(_NO_PORT_T_FROM_MACH)
-/*
- * Mach 3.0 renamed everything to have mach_ in front of it.
- * These types and macros are provided for backward compatibility
- * but are deprecated.
- */
-typedef mach_port_t port_t;
-typedef mach_port_name_t port_name_t;
-typedef mach_port_name_t *port_name_array_t;
-
-#define PORT_NULL ((port_t) 0)
-#define PORT_DEAD ((port_t) ~0)
-#define PORT_VALID(name) \
- ((port_t)(name) != PORT_NULL && (port_t)(name) != PORT_DEAD)
-
-#endif /* !__DARWIN_UNIX03 && !_NO_PORT_T_FROM_MACH */
-
-#endif /* _MACH_PORT_H_ */
\ No newline at end of file
diff --git a/lib/libc/include/x86_64-macos-gnu/mach/processor_set.h b/lib/libc/include/x86_64-macos-gnu/mach/processor_set.h
deleted file mode 100644
index c7637d1f19..0000000000
--- a/lib/libc/include/x86_64-macos-gnu/mach/processor_set.h
+++ /dev/null
@@ -1,540 +0,0 @@
-#ifndef _processor_set_user_
-#define _processor_set_user_
-
-/* Module processor_set */
-
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-
-/* BEGIN MIG_STRNCPY_ZEROFILL CODE */
-
-#if defined(__has_include)
-#if __has_include()
-#ifndef USING_MIG_STRNCPY_ZEROFILL
-#define USING_MIG_STRNCPY_ZEROFILL
-#endif
-#ifndef __MIG_STRNCPY_ZEROFILL_FORWARD_TYPE_DECLS__
-#define __MIG_STRNCPY_ZEROFILL_FORWARD_TYPE_DECLS__
-#ifdef __cplusplus
-extern "C" {
-#endif
- extern int mig_strncpy_zerofill(char *dest, const char *src, int len) __attribute__((weak_import));
-#ifdef __cplusplus
-}
-#endif
-#endif /* __MIG_STRNCPY_ZEROFILL_FORWARD_TYPE_DECLS__ */
-#endif /* __has_include() */
-#endif /* __has_include */
-
-/* END MIG_STRNCPY_ZEROFILL CODE */
-
-
-#ifdef AUTOTEST
-#ifndef FUNCTION_PTR_T
-#define FUNCTION_PTR_T
-typedef void (*function_ptr_t)(mach_port_t, char *, mach_msg_type_number_t);
-typedef struct {
- char *name;
- function_ptr_t function;
-} function_table_entry;
-typedef function_table_entry *function_table_t;
-#endif /* FUNCTION_PTR_T */
-#endif /* AUTOTEST */
-
-#ifndef processor_set_MSG_COUNT
-#define processor_set_MSG_COUNT 10
-#endif /* processor_set_MSG_COUNT */
-
-#include
-#include
-#include
-#include
-
-#ifdef __BeforeMigUserHeader
-__BeforeMigUserHeader
-#endif /* __BeforeMigUserHeader */
-
-#include
-__BEGIN_DECLS
-
-
-/* Routine processor_set_statistics */
-#ifdef mig_external
-mig_external
-#else
-extern
-#endif /* mig_external */
-kern_return_t processor_set_statistics
-(
- processor_set_name_t pset,
- processor_set_flavor_t flavor,
- processor_set_info_t info_out,
- mach_msg_type_number_t *info_outCnt
-);
-
-/* Routine processor_set_destroy */
-#ifdef mig_external
-mig_external
-#else
-extern
-#endif /* mig_external */
-kern_return_t processor_set_destroy
-(
- processor_set_t set
-);
-
-/* Routine processor_set_max_priority */
-#ifdef mig_external
-mig_external
-#else
-extern
-#endif /* mig_external */
-kern_return_t processor_set_max_priority
-(
- processor_set_t processor_set,
- int max_priority,
- boolean_t change_threads
-);
-
-/* Routine processor_set_policy_enable */
-#ifdef mig_external
-mig_external
-#else
-extern
-#endif /* mig_external */
-kern_return_t processor_set_policy_enable
-(
- processor_set_t processor_set,
- int policy
-);
-
-/* Routine processor_set_policy_disable */
-#ifdef mig_external
-mig_external
-#else
-extern
-#endif /* mig_external */
-kern_return_t processor_set_policy_disable
-(
- processor_set_t processor_set,
- int policy,
- boolean_t change_threads
-);
-
-/* Routine processor_set_tasks */
-#ifdef mig_external
-mig_external
-#else
-extern
-#endif /* mig_external */
-kern_return_t processor_set_tasks
-(
- processor_set_t processor_set,
- task_array_t *task_list,
- mach_msg_type_number_t *task_listCnt
-);
-
-/* Routine processor_set_threads */
-#ifdef mig_external
-mig_external
-#else
-extern
-#endif /* mig_external */
-kern_return_t processor_set_threads
-(
- processor_set_t processor_set,
- thread_act_array_t *thread_list,
- mach_msg_type_number_t *thread_listCnt
-);
-
-/* Routine processor_set_policy_control */
-#ifdef mig_external
-mig_external
-#else
-extern
-#endif /* mig_external */
-kern_return_t processor_set_policy_control
-(
- processor_set_t pset,
- processor_set_flavor_t flavor,
- processor_set_info_t policy_info,
- mach_msg_type_number_t policy_infoCnt,
- boolean_t change
-);
-
-/* Routine processor_set_stack_usage */
-#ifdef mig_external
-mig_external
-#else
-extern
-#endif /* mig_external */
-kern_return_t processor_set_stack_usage
-(
- processor_set_t pset,
- unsigned *ltotal,
- vm_size_t *space,
- vm_size_t *resident,
- vm_size_t *maxusage,
- vm_offset_t *maxstack
-);
-
-/* Routine processor_set_info */
-#ifdef mig_external
-mig_external
-#else
-extern
-#endif /* mig_external */
-kern_return_t processor_set_info
-(
- processor_set_name_t set_name,
- int flavor,
- host_t *host,
- processor_set_info_t info_out,
- mach_msg_type_number_t *info_outCnt
-);
-
-__END_DECLS
-
-/********************** Caution **************************/
-/* The following data types should be used to calculate */
-/* maximum message sizes only. The actual message may be */
-/* smaller, and the position of the arguments within the */
-/* message layout may vary from what is presented here. */
-/* For example, if any of the arguments are variable- */
-/* sized, and less than the maximum is sent, the data */
-/* will be packed tight in the actual message to reduce */
-/* the presence of holes. */
-/********************** Caution **************************/
-
-/* typedefs for all requests */
-
-#ifndef __Request__processor_set_subsystem__defined
-#define __Request__processor_set_subsystem__defined
-
-#ifdef __MigPackStructs
-#pragma pack(push, 4)
-#endif
- typedef struct {
- mach_msg_header_t Head;
- NDR_record_t NDR;
- processor_set_flavor_t flavor;
- mach_msg_type_number_t info_outCnt;
- } __Request__processor_set_statistics_t __attribute__((unused));
-#ifdef __MigPackStructs
-#pragma pack(pop)
-#endif
-
-#ifdef __MigPackStructs
-#pragma pack(push, 4)
-#endif
- typedef struct {
- mach_msg_header_t Head;
- } __Request__processor_set_destroy_t __attribute__((unused));
-#ifdef __MigPackStructs
-#pragma pack(pop)
-#endif
-
-#ifdef __MigPackStructs
-#pragma pack(push, 4)
-#endif
- typedef struct {
- mach_msg_header_t Head;
- NDR_record_t NDR;
- int max_priority;
- boolean_t change_threads;
- } __Request__processor_set_max_priority_t __attribute__((unused));
-#ifdef __MigPackStructs
-#pragma pack(pop)
-#endif
-
-#ifdef __MigPackStructs
-#pragma pack(push, 4)
-#endif
- typedef struct {
- mach_msg_header_t Head;
- NDR_record_t NDR;
- int policy;
- } __Request__processor_set_policy_enable_t __attribute__((unused));
-#ifdef __MigPackStructs
-#pragma pack(pop)
-#endif
-
-#ifdef __MigPackStructs
-#pragma pack(push, 4)
-#endif
- typedef struct {
- mach_msg_header_t Head;
- NDR_record_t NDR;
- int policy;
- boolean_t change_threads;
- } __Request__processor_set_policy_disable_t __attribute__((unused));
-#ifdef __MigPackStructs
-#pragma pack(pop)
-#endif
-
-#ifdef __MigPackStructs
-#pragma pack(push, 4)
-#endif
- typedef struct {
- mach_msg_header_t Head;
- } __Request__processor_set_tasks_t __attribute__((unused));
-#ifdef __MigPackStructs
-#pragma pack(pop)
-#endif
-
-#ifdef __MigPackStructs
-#pragma pack(push, 4)
-#endif
- typedef struct {
- mach_msg_header_t Head;
- } __Request__processor_set_threads_t __attribute__((unused));
-#ifdef __MigPackStructs
-#pragma pack(pop)
-#endif
-
-#ifdef __MigPackStructs
-#pragma pack(push, 4)
-#endif
- typedef struct {
- mach_msg_header_t Head;
- NDR_record_t NDR;
- processor_set_flavor_t flavor;
- mach_msg_type_number_t policy_infoCnt;
- integer_t policy_info[5];
- boolean_t change;
- } __Request__processor_set_policy_control_t __attribute__((unused));
-#ifdef __MigPackStructs
-#pragma pack(pop)
-#endif
-
-#ifdef __MigPackStructs
-#pragma pack(push, 4)
-#endif
- typedef struct {
- mach_msg_header_t Head;
- } __Request__processor_set_stack_usage_t __attribute__((unused));
-#ifdef __MigPackStructs
-#pragma pack(pop)
-#endif
-
-#ifdef __MigPackStructs
-#pragma pack(push, 4)
-#endif
- typedef struct {
- mach_msg_header_t Head;
- NDR_record_t NDR;
- int flavor;
- mach_msg_type_number_t info_outCnt;
- } __Request__processor_set_info_t __attribute__((unused));
-#ifdef __MigPackStructs
-#pragma pack(pop)
-#endif
-#endif /* !__Request__processor_set_subsystem__defined */
-
-/* union of all requests */
-
-#ifndef __RequestUnion__processor_set_subsystem__defined
-#define __RequestUnion__processor_set_subsystem__defined
-union __RequestUnion__processor_set_subsystem {
- __Request__processor_set_statistics_t Request_processor_set_statistics;
- __Request__processor_set_destroy_t Request_processor_set_destroy;
- __Request__processor_set_max_priority_t Request_processor_set_max_priority;
- __Request__processor_set_policy_enable_t Request_processor_set_policy_enable;
- __Request__processor_set_policy_disable_t Request_processor_set_policy_disable;
- __Request__processor_set_tasks_t Request_processor_set_tasks;
- __Request__processor_set_threads_t Request_processor_set_threads;
- __Request__processor_set_policy_control_t Request_processor_set_policy_control;
- __Request__processor_set_stack_usage_t Request_processor_set_stack_usage;
- __Request__processor_set_info_t Request_processor_set_info;
-};
-#endif /* !__RequestUnion__processor_set_subsystem__defined */
-/* typedefs for all replies */
-
-#ifndef __Reply__processor_set_subsystem__defined
-#define __Reply__processor_set_subsystem__defined
-
-#ifdef __MigPackStructs
-#pragma pack(push, 4)
-#endif
- typedef struct {
- mach_msg_header_t Head;
- NDR_record_t NDR;
- kern_return_t RetCode;
- mach_msg_type_number_t info_outCnt;
- integer_t info_out[5];
- } __Reply__processor_set_statistics_t __attribute__((unused));
-#ifdef __MigPackStructs
-#pragma pack(pop)
-#endif
-
-#ifdef __MigPackStructs
-#pragma pack(push, 4)
-#endif
- typedef struct {
- mach_msg_header_t Head;
- NDR_record_t NDR;
- kern_return_t RetCode;
- } __Reply__processor_set_destroy_t __attribute__((unused));
-#ifdef __MigPackStructs
-#pragma pack(pop)
-#endif
-
-#ifdef __MigPackStructs
-#pragma pack(push, 4)
-#endif
- typedef struct {
- mach_msg_header_t Head;
- NDR_record_t NDR;
- kern_return_t RetCode;
- } __Reply__processor_set_max_priority_t __attribute__((unused));
-#ifdef __MigPackStructs
-#pragma pack(pop)
-#endif
-
-#ifdef __MigPackStructs
-#pragma pack(push, 4)
-#endif
- typedef struct {
- mach_msg_header_t Head;
- NDR_record_t NDR;
- kern_return_t RetCode;
- } __Reply__processor_set_policy_enable_t __attribute__((unused));
-#ifdef __MigPackStructs
-#pragma pack(pop)
-#endif
-
-#ifdef __MigPackStructs
-#pragma pack(push, 4)
-#endif
- typedef struct {
- mach_msg_header_t Head;
- NDR_record_t NDR;
- kern_return_t RetCode;
- } __Reply__processor_set_policy_disable_t __attribute__((unused));
-#ifdef __MigPackStructs
-#pragma pack(pop)
-#endif
-
-#ifdef __MigPackStructs
-#pragma pack(push, 4)
-#endif
- typedef struct {
- mach_msg_header_t Head;
- /* start of the kernel processed data */
- mach_msg_body_t msgh_body;
- mach_msg_ool_ports_descriptor_t task_list;
- /* end of the kernel processed data */
- NDR_record_t NDR;
- mach_msg_type_number_t task_listCnt;
- } __Reply__processor_set_tasks_t __attribute__((unused));
-#ifdef __MigPackStructs
-#pragma pack(pop)
-#endif
-
-#ifdef __MigPackStructs
-#pragma pack(push, 4)
-#endif
- typedef struct {
- mach_msg_header_t Head;
- /* start of the kernel processed data */
- mach_msg_body_t msgh_body;
- mach_msg_ool_ports_descriptor_t thread_list;
- /* end of the kernel processed data */
- NDR_record_t NDR;
- mach_msg_type_number_t thread_listCnt;
- } __Reply__processor_set_threads_t __attribute__((unused));
-#ifdef __MigPackStructs
-#pragma pack(pop)
-#endif
-
-#ifdef __MigPackStructs
-#pragma pack(push, 4)
-#endif
- typedef struct {
- mach_msg_header_t Head;
- NDR_record_t NDR;
- kern_return_t RetCode;
- } __Reply__processor_set_policy_control_t __attribute__((unused));
-#ifdef __MigPackStructs
-#pragma pack(pop)
-#endif
-
-#ifdef __MigPackStructs
-#pragma pack(push, 4)
-#endif
- typedef struct {
- mach_msg_header_t Head;
- NDR_record_t NDR;
- kern_return_t RetCode;
- unsigned ltotal;
- vm_size_t space;
- vm_size_t resident;
- vm_size_t maxusage;
- vm_offset_t maxstack;
- } __Reply__processor_set_stack_usage_t __attribute__((unused));
-#ifdef __MigPackStructs
-#pragma pack(pop)
-#endif
-
-#ifdef __MigPackStructs
-#pragma pack(push, 4)
-#endif
- typedef struct {
- mach_msg_header_t Head;
- /* start of the kernel processed data */
- mach_msg_body_t msgh_body;
- mach_msg_port_descriptor_t host;
- /* end of the kernel processed data */
- NDR_record_t NDR;
- mach_msg_type_number_t info_outCnt;
- integer_t info_out[5];
- } __Reply__processor_set_info_t __attribute__((unused));
-#ifdef __MigPackStructs
-#pragma pack(pop)
-#endif
-#endif /* !__Reply__processor_set_subsystem__defined */
-
-/* union of all replies */
-
-#ifndef __ReplyUnion__processor_set_subsystem__defined
-#define __ReplyUnion__processor_set_subsystem__defined
-union __ReplyUnion__processor_set_subsystem {
- __Reply__processor_set_statistics_t Reply_processor_set_statistics;
- __Reply__processor_set_destroy_t Reply_processor_set_destroy;
- __Reply__processor_set_max_priority_t Reply_processor_set_max_priority;
- __Reply__processor_set_policy_enable_t Reply_processor_set_policy_enable;
- __Reply__processor_set_policy_disable_t Reply_processor_set_policy_disable;
- __Reply__processor_set_tasks_t Reply_processor_set_tasks;
- __Reply__processor_set_threads_t Reply_processor_set_threads;
- __Reply__processor_set_policy_control_t Reply_processor_set_policy_control;
- __Reply__processor_set_stack_usage_t Reply_processor_set_stack_usage;
- __Reply__processor_set_info_t Reply_processor_set_info;
-};
-#endif /* !__RequestUnion__processor_set_subsystem__defined */
-
-#ifndef subsystem_to_name_map_processor_set
-#define subsystem_to_name_map_processor_set \
- { "processor_set_statistics", 4000 },\
- { "processor_set_destroy", 4001 },\
- { "processor_set_max_priority", 4002 },\
- { "processor_set_policy_enable", 4003 },\
- { "processor_set_policy_disable", 4004 },\
- { "processor_set_tasks", 4005 },\
- { "processor_set_threads", 4006 },\
- { "processor_set_policy_control", 4007 },\
- { "processor_set_stack_usage", 4008 },\
- { "processor_set_info", 4009 }
-#endif
-
-#ifdef __AfterMigUserHeader
-__AfterMigUserHeader
-#endif /* __AfterMigUserHeader */
-
-#endif /* _processor_set_user_ */
\ No newline at end of file
diff --git a/lib/libc/include/x86_64-macos-gnu/mach/task.h b/lib/libc/include/x86_64-macos-gnu/mach/task.h
deleted file mode 100644
index 5f0de2dcd5..0000000000
--- a/lib/libc/include/x86_64-macos-gnu/mach/task.h
+++ /dev/null
@@ -1,2523 +0,0 @@
-#ifndef _task_user_
-#define _task_user_
-
-/* Module task */
-
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-
-/* BEGIN MIG_STRNCPY_ZEROFILL CODE */
-
-#if defined(__has_include)
-#if __has_include()
-#ifndef USING_MIG_STRNCPY_ZEROFILL
-#define USING_MIG_STRNCPY_ZEROFILL
-#endif
-#ifndef __MIG_STRNCPY_ZEROFILL_FORWARD_TYPE_DECLS__
-#define __MIG_STRNCPY_ZEROFILL_FORWARD_TYPE_DECLS__
-#ifdef __cplusplus
-extern "C" {
-#endif
- extern int mig_strncpy_zerofill(char *dest, const char *src, int len) __attribute__((weak_import));
-#ifdef __cplusplus
-}
-#endif
-#endif /* __MIG_STRNCPY_ZEROFILL_FORWARD_TYPE_DECLS__ */
-#endif /* __has_include() */
-#endif /* __has_include */
-
-/* END MIG_STRNCPY_ZEROFILL CODE */
-
-
-#ifdef AUTOTEST
-#ifndef FUNCTION_PTR_T
-#define FUNCTION_PTR_T
-typedef void (*function_ptr_t)(mach_port_t, char *, mach_msg_type_number_t);
-typedef struct {
- char *name;
- function_ptr_t function;
-} function_table_entry;
-typedef function_table_entry *function_table_t;
-#endif /* FUNCTION_PTR_T */
-#endif /* AUTOTEST */
-
-#ifndef task_MSG_COUNT
-#define task_MSG_COUNT 55
-#endif /* task_MSG_COUNT */
-
-#include
-#include
-#include
-#include
-#include
-
-#ifdef __BeforeMigUserHeader
-__BeforeMigUserHeader
-#endif /* __BeforeMigUserHeader */
-
-#include
-__BEGIN_DECLS
-
-
-/* Routine task_create */
-#ifdef mig_external
-mig_external
-#else
-extern
-#endif /* mig_external */
-kern_return_t task_create
-(
- task_t target_task,
- ledger_array_t ledgers,
- mach_msg_type_number_t ledgersCnt,
- boolean_t inherit_memory,
- task_t *child_task
-);
-
-/* Routine task_terminate */
-#ifdef mig_external
-mig_external
-#else
-extern
-#endif /* mig_external */
-kern_return_t task_terminate
-(
- task_t target_task
-);
-
-/* Routine task_threads */
-#ifdef mig_external
-mig_external
-#else
-extern
-#endif /* mig_external */
-kern_return_t task_threads
-(
- task_inspect_t target_task,
- thread_act_array_t *act_list,
- mach_msg_type_number_t *act_listCnt
-);
-
-/* Routine mach_ports_register */
-#ifdef mig_external
-mig_external
-#else
-extern
-#endif /* mig_external */
-__WATCHOS_PROHIBITED
-__TVOS_PROHIBITED
-kern_return_t mach_ports_register
-(
- task_t target_task,
- mach_port_array_t init_port_set,
- mach_msg_type_number_t init_port_setCnt
-);
-
-/* Routine mach_ports_lookup */
-#ifdef mig_external
-mig_external
-#else
-extern
-#endif /* mig_external */
-__WATCHOS_PROHIBITED
-__TVOS_PROHIBITED
-kern_return_t mach_ports_lookup
-(
- task_t target_task,
- mach_port_array_t *init_port_set,
- mach_msg_type_number_t *init_port_setCnt
-);
-
-/* Routine task_info */
-#ifdef mig_external
-mig_external
-#else
-extern
-#endif /* mig_external */
-kern_return_t task_info
-(
- task_name_t target_task,
- task_flavor_t flavor,
- task_info_t task_info_out,
- mach_msg_type_number_t *task_info_outCnt
-);
-
-/* Routine task_set_info */
-#ifdef mig_external
-mig_external
-#else
-extern
-#endif /* mig_external */
-__WATCHOS_PROHIBITED
-__TVOS_PROHIBITED
-kern_return_t task_set_info
-(
- task_t target_task,
- task_flavor_t flavor,
- task_info_t task_info_in,
- mach_msg_type_number_t task_info_inCnt
-);
-
-/* Routine task_suspend */
-#ifdef mig_external
-mig_external
-#else
-extern
-#endif /* mig_external */
-__WATCHOS_PROHIBITED
-__TVOS_PROHIBITED
-kern_return_t task_suspend
-(
- task_t target_task
-);
-
-/* Routine task_resume */
-#ifdef mig_external
-mig_external
-#else
-extern
-#endif /* mig_external */
-__WATCHOS_PROHIBITED
-__TVOS_PROHIBITED
-kern_return_t task_resume
-(
- task_t target_task
-);
-
-/* Routine task_get_special_port */
-#ifdef mig_external
-mig_external
-#else
-extern
-#endif /* mig_external */
-__WATCHOS_PROHIBITED
-__TVOS_PROHIBITED
-kern_return_t task_get_special_port
-(
- task_inspect_t task,
- int which_port,
- mach_port_t *special_port
-);
-
-/* Routine task_set_special_port */
-#ifdef mig_external
-mig_external
-#else
-extern
-#endif /* mig_external */
-__WATCHOS_PROHIBITED
-__TVOS_PROHIBITED
-kern_return_t task_set_special_port
-(
- task_t task,
- int which_port,
- mach_port_t special_port
-);
-
-/* Routine thread_create */
-#ifdef mig_external
-mig_external
-#else
-extern
-#endif /* mig_external */
-__WATCHOS_PROHIBITED
-__TVOS_PROHIBITED
-kern_return_t thread_create
-(
- task_t parent_task,
- thread_act_t *child_act
-);
-
-/* Routine thread_create_running */
-#ifdef mig_external
-mig_external
-#else
-extern
-#endif /* mig_external */
-__WATCHOS_PROHIBITED
-__TVOS_PROHIBITED
-kern_return_t thread_create_running
-(
- task_t parent_task,
- thread_state_flavor_t flavor,
- thread_state_t new_state,
- mach_msg_type_number_t new_stateCnt,
- thread_act_t *child_act
-);
-
-/* Routine task_set_exception_ports */
-#ifdef mig_external
-mig_external
-#else
-extern
-#endif /* mig_external */
-__WATCHOS_PROHIBITED
-__TVOS_PROHIBITED
-kern_return_t task_set_exception_ports
-(
- task_t task,
- exception_mask_t exception_mask,
- mach_port_t new_port,
- exception_behavior_t behavior,
- thread_state_flavor_t new_flavor
-);
-
-/* Routine task_get_exception_ports */
-#ifdef mig_external
-mig_external
-#else
-extern
-#endif /* mig_external */
-__WATCHOS_PROHIBITED
-__TVOS_PROHIBITED
-kern_return_t task_get_exception_ports
-(
- task_inspect_t task,
- exception_mask_t exception_mask,
- exception_mask_array_t masks,
- mach_msg_type_number_t *masksCnt,
- exception_handler_array_t old_handlers,
- exception_behavior_array_t old_behaviors,
- exception_flavor_array_t old_flavors
-);
-
-/* Routine task_swap_exception_ports */
-#ifdef mig_external
-mig_external
-#else
-extern
-#endif /* mig_external */
-__WATCHOS_PROHIBITED
-__TVOS_PROHIBITED
-kern_return_t task_swap_exception_ports
-(
- task_t task,
- exception_mask_t exception_mask,
- mach_port_t new_port,
- exception_behavior_t behavior,
- thread_state_flavor_t new_flavor,
- exception_mask_array_t masks,
- mach_msg_type_number_t *masksCnt,
- exception_handler_array_t old_handlerss,
- exception_behavior_array_t old_behaviors,
- exception_flavor_array_t old_flavors
-);
-
-/* Routine lock_set_create */
-#ifdef mig_external
-mig_external
-#else
-extern
-#endif /* mig_external */
-kern_return_t lock_set_create
-(
- task_t task,
- lock_set_t *new_lock_set,
- int n_ulocks,
- int policy
-);
-
-/* Routine lock_set_destroy */
-#ifdef mig_external
-mig_external
-#else
-extern
-#endif /* mig_external */
-kern_return_t lock_set_destroy
-(
- task_t task,
- lock_set_t lock_set
-);
-
-/* Routine semaphore_create */
-#ifdef mig_external
-mig_external
-#else
-extern
-#endif /* mig_external */
-kern_return_t semaphore_create
-(
- task_t task,
- semaphore_t *semaphore,
- int policy,
- int value
-);
-
-/* Routine semaphore_destroy */
-#ifdef mig_external
-mig_external
-#else
-extern
-#endif /* mig_external */
-kern_return_t semaphore_destroy
-(
- task_t task,
- semaphore_t semaphore
-);
-
-/* Routine task_policy_set */
-#ifdef mig_external
-mig_external
-#else
-extern
-#endif /* mig_external */
-__WATCHOS_PROHIBITED
-__TVOS_PROHIBITED
-kern_return_t task_policy_set
-(
- task_t task,
- task_policy_flavor_t flavor,
- task_policy_t policy_info,
- mach_msg_type_number_t policy_infoCnt
-);
-
-/* Routine task_policy_get */
-#ifdef mig_external
-mig_external
-#else
-extern
-#endif /* mig_external */
-__WATCHOS_PROHIBITED
-__TVOS_PROHIBITED
-kern_return_t task_policy_get
-(
- task_t task,
- task_policy_flavor_t flavor,
- task_policy_t policy_info,
- mach_msg_type_number_t *policy_infoCnt,
- boolean_t *get_default
-);
-
-/* Routine task_sample */
-#ifdef mig_external
-mig_external
-#else
-extern
-#endif /* mig_external */
-kern_return_t task_sample
-(
- task_t task,
- mach_port_t reply
-);
-
-/* Routine task_policy */
-#ifdef mig_external
-mig_external
-#else
-extern
-#endif /* mig_external */
-kern_return_t task_policy
-(
- task_t task,
- policy_t policy,
- policy_base_t base,
- mach_msg_type_number_t baseCnt,
- boolean_t set_limit,
- boolean_t change
-);
-
-/* Routine task_set_emulation */
-#ifdef mig_external
-mig_external
-#else
-extern
-#endif /* mig_external */
-kern_return_t task_set_emulation
-(
- task_t target_port,
- vm_address_t routine_entry_pt,
- int routine_number
-);
-
-/* Routine task_get_emulation_vector */
-#ifdef mig_external
-mig_external
-#else
-extern
-#endif /* mig_external */
-kern_return_t task_get_emulation_vector
-(
- task_t task,
- int *vector_start,
- emulation_vector_t *emulation_vector,
- mach_msg_type_number_t *emulation_vectorCnt
-);
-
-/* Routine task_set_emulation_vector */
-#ifdef mig_external
-mig_external
-#else
-extern
-#endif /* mig_external */
-kern_return_t task_set_emulation_vector
-(
- task_t task,
- int vector_start,
- emulation_vector_t emulation_vector,
- mach_msg_type_number_t emulation_vectorCnt
-);
-
-/* Routine task_set_ras_pc */
-#ifdef mig_external
-mig_external
-#else
-extern
-#endif /* mig_external */
-kern_return_t task_set_ras_pc
-(
- task_t target_task,
- vm_address_t basepc,
- vm_address_t boundspc
-);
-
-/* Routine task_zone_info */
-#ifdef mig_external
-mig_external
-#else
-extern
-#endif /* mig_external */
-__WATCHOS_PROHIBITED
-__TVOS_PROHIBITED
-kern_return_t task_zone_info
-(
- task_t target_task,
- mach_zone_name_array_t *names,
- mach_msg_type_number_t *namesCnt,
- task_zone_info_array_t *info,
- mach_msg_type_number_t *infoCnt
-);
-
-/* Routine task_assign */
-#ifdef mig_external
-mig_external
-#else
-extern
-#endif /* mig_external */
-kern_return_t task_assign
-(
- task_t task,
- processor_set_t new_set,
- boolean_t assign_threads
-);
-
-/* Routine task_assign_default */
-#ifdef mig_external
-mig_external
-#else
-extern
-#endif /* mig_external */
-kern_return_t task_assign_default
-(
- task_t task,
- boolean_t assign_threads
-);
-
-/* Routine task_get_assignment */
-#ifdef mig_external
-mig_external
-#else
-extern
-#endif /* mig_external */
-kern_return_t task_get_assignment
-(
- task_t task,
- processor_set_name_t *assigned_set
-);
-
-/* Routine task_set_policy */
-#ifdef mig_external
-mig_external
-#else
-extern
-#endif /* mig_external */
-kern_return_t task_set_policy
-(
- task_t task,
- processor_set_t pset,
- policy_t policy,
- policy_base_t base,
- mach_msg_type_number_t baseCnt,
- policy_limit_t limit,
- mach_msg_type_number_t limitCnt,
- boolean_t change
-);
-
-/* Routine task_get_state */
-#ifdef mig_external
-mig_external
-#else
-extern
-#endif /* mig_external */
-__WATCHOS_PROHIBITED
-__TVOS_PROHIBITED
-kern_return_t task_get_state
-(
- task_t task,
- thread_state_flavor_t flavor,
- thread_state_t old_state,
- mach_msg_type_number_t *old_stateCnt
-);
-
-/* Routine task_set_state */
-#ifdef mig_external
-mig_external
-#else
-extern
-#endif /* mig_external */
-__WATCHOS_PROHIBITED
-__TVOS_PROHIBITED
-kern_return_t task_set_state
-(
- task_t task,
- thread_state_flavor_t flavor,
- thread_state_t new_state,
- mach_msg_type_number_t new_stateCnt
-);
-
-/* Routine task_set_phys_footprint_limit */
-#ifdef mig_external
-mig_external
-#else
-extern
-#endif /* mig_external */
-__WATCHOS_PROHIBITED
-__TVOS_PROHIBITED
-kern_return_t task_set_phys_footprint_limit
-(
- task_t task,
- int new_limit,
- int *old_limit
-);
-
-/* Routine task_suspend2 */
-#ifdef mig_external
-mig_external
-#else
-extern
-#endif /* mig_external */
-__WATCHOS_PROHIBITED
-__TVOS_PROHIBITED
-kern_return_t task_suspend2
-(
- task_t target_task,
- task_suspension_token_t *suspend_token
-);
-
-/* Routine task_resume2 */
-#ifdef mig_external
-mig_external
-#else
-extern
-#endif /* mig_external */
-__WATCHOS_PROHIBITED
-__TVOS_PROHIBITED
-kern_return_t task_resume2
-(
- task_suspension_token_t suspend_token
-);
-
-/* Routine task_purgable_info */
-#ifdef mig_external
-mig_external
-#else
-extern
-#endif /* mig_external */
-kern_return_t task_purgable_info
-(
- task_t task,
- task_purgable_info_t *stats
-);
-
-/* Routine task_get_mach_voucher */
-#ifdef mig_external
-mig_external
-#else
-extern
-#endif /* mig_external */
-__WATCHOS_PROHIBITED
-__TVOS_PROHIBITED
-kern_return_t task_get_mach_voucher
-(
- task_t task,
- mach_voucher_selector_t which,
- ipc_voucher_t *voucher
-);
-
-/* Routine task_set_mach_voucher */
-#ifdef mig_external
-mig_external
-#else
-extern
-#endif /* mig_external */
-__WATCHOS_PROHIBITED
-__TVOS_PROHIBITED
-kern_return_t task_set_mach_voucher
-(
- task_t task,
- ipc_voucher_t voucher
-);
-
-/* Routine task_swap_mach_voucher */
-#ifdef mig_external
-mig_external
-#else
-extern
-#endif /* mig_external */
-__WATCHOS_PROHIBITED
-__TVOS_PROHIBITED
-kern_return_t task_swap_mach_voucher
-(
- task_t task,
- ipc_voucher_t new_voucher,
- ipc_voucher_t *old_voucher
-);
-
-/* Routine task_generate_corpse */
-#ifdef mig_external
-mig_external
-#else
-extern
-#endif /* mig_external */
-kern_return_t task_generate_corpse
-(
- task_t task,
- mach_port_t *corpse_task_port
-);
-
-/* Routine task_map_corpse_info */
-#ifdef mig_external
-mig_external
-#else
-extern
-#endif /* mig_external */
-kern_return_t task_map_corpse_info
-(
- task_t task,
- task_t corspe_task,
- vm_address_t *kcd_addr_begin,
- uint32_t *kcd_size
-);
-
-/* Routine task_register_dyld_image_infos */
-#ifdef mig_external
-mig_external
-#else
-extern
-#endif /* mig_external */
-kern_return_t task_register_dyld_image_infos
-(
- task_t task,
- dyld_kernel_image_info_array_t dyld_images,
- mach_msg_type_number_t dyld_imagesCnt
-);
-
-/* Routine task_unregister_dyld_image_infos */
-#ifdef mig_external
-mig_external
-#else
-extern
-#endif /* mig_external */
-kern_return_t task_unregister_dyld_image_infos
-(
- task_t task,
- dyld_kernel_image_info_array_t dyld_images,
- mach_msg_type_number_t dyld_imagesCnt
-);
-
-/* Routine task_get_dyld_image_infos */
-#ifdef mig_external
-mig_external
-#else
-extern
-#endif /* mig_external */
-kern_return_t task_get_dyld_image_infos
-(
- task_inspect_t task,
- dyld_kernel_image_info_array_t *dyld_images,
- mach_msg_type_number_t *dyld_imagesCnt
-);
-
-/* Routine task_register_dyld_shared_cache_image_info */
-#ifdef mig_external
-mig_external
-#else
-extern
-#endif /* mig_external */
-kern_return_t task_register_dyld_shared_cache_image_info
-(
- task_t task,
- dyld_kernel_image_info_t dyld_cache_image,
- boolean_t no_cache,
- boolean_t private_cache
-);
-
-/* Routine task_register_dyld_set_dyld_state */
-#ifdef mig_external
-mig_external
-#else
-extern
-#endif /* mig_external */
-kern_return_t task_register_dyld_set_dyld_state
-(
- task_t task,
- uint8_t dyld_state
-);
-
-/* Routine task_register_dyld_get_process_state */
-#ifdef mig_external
-mig_external
-#else
-extern
-#endif /* mig_external */
-kern_return_t task_register_dyld_get_process_state
-(
- task_t task,
- dyld_kernel_process_info_t *dyld_process_state
-);
-
-/* Routine task_map_corpse_info_64 */
-#ifdef mig_external
-mig_external
-#else
-extern
-#endif /* mig_external */
-kern_return_t task_map_corpse_info_64
-(
- task_t task,
- task_t corspe_task,
- mach_vm_address_t *kcd_addr_begin,
- mach_vm_size_t *kcd_size
-);
-
-/* Routine task_inspect */
-#ifdef mig_external
-mig_external
-#else
-extern
-#endif /* mig_external */
-kern_return_t task_inspect
-(
- task_inspect_t task,
- task_inspect_flavor_t flavor,
- task_inspect_info_t info_out,
- mach_msg_type_number_t *info_outCnt
-);
-
-/* Routine task_get_exc_guard_behavior */
-#ifdef mig_external
-mig_external
-#else
-extern
-#endif /* mig_external */
-kern_return_t task_get_exc_guard_behavior
-(
- task_inspect_t task,
- task_exc_guard_behavior_t *behavior
-);
-
-/* Routine task_set_exc_guard_behavior */
-#ifdef mig_external
-mig_external
-#else
-extern
-#endif /* mig_external */
-kern_return_t task_set_exc_guard_behavior
-(
- task_t task,
- task_exc_guard_behavior_t behavior
-);
-
-/* Routine task_create_suid_cred */
-#ifdef mig_external
-mig_external
-#else
-extern
-#endif /* mig_external */
-kern_return_t task_create_suid_cred
-(
- task_t task,
- suid_cred_path_t path,
- suid_cred_uid_t uid,
- suid_cred_t *delegation
-);
-
-__END_DECLS
-
-/********************** Caution **************************/
-/* The following data types should be used to calculate */
-/* maximum message sizes only. The actual message may be */
-/* smaller, and the position of the arguments within the */
-/* message layout may vary from what is presented here. */
-/* For example, if any of the arguments are variable- */
-/* sized, and less than the maximum is sent, the data */
-/* will be packed tight in the actual message to reduce */
-/* the presence of holes. */
-/********************** Caution **************************/
-
-/* typedefs for all requests */
-
-#ifndef __Request__task_subsystem__defined
-#define __Request__task_subsystem__defined
-
-#ifdef __MigPackStructs
-#pragma pack(push, 4)
-#endif
- typedef struct {
- mach_msg_header_t Head;
- /* start of the kernel processed data */
- mach_msg_body_t msgh_body;
- mach_msg_ool_ports_descriptor_t ledgers;
- /* end of the kernel processed data */
- NDR_record_t NDR;
- mach_msg_type_number_t ledgersCnt;
- boolean_t inherit_memory;
- } __Request__task_create_t __attribute__((unused));
-#ifdef __MigPackStructs
-#pragma pack(pop)
-#endif
-
-#ifdef __MigPackStructs
-#pragma pack(push, 4)
-#endif
- typedef struct {
- mach_msg_header_t Head;
- } __Request__task_terminate_t __attribute__((unused));
-#ifdef __MigPackStructs
-#pragma pack(pop)
-#endif
-
-#ifdef __MigPackStructs
-#pragma pack(push, 4)
-#endif
- typedef struct {
- mach_msg_header_t Head;
- } __Request__task_threads_t __attribute__((unused));
-#ifdef __MigPackStructs
-#pragma pack(pop)
-#endif
-
-#ifdef __MigPackStructs
-#pragma pack(push, 4)
-#endif
- typedef struct {
- mach_msg_header_t Head;
- /* start of the kernel processed data */
- mach_msg_body_t msgh_body;
- mach_msg_ool_ports_descriptor_t init_port_set;
- /* end of the kernel processed data */
- NDR_record_t NDR;
- mach_msg_type_number_t init_port_setCnt;
- } __Request__mach_ports_register_t __attribute__((unused));
-#ifdef __MigPackStructs
-#pragma pack(pop)
-#endif
-
-#ifdef __MigPackStructs
-#pragma pack(push, 4)
-#endif
- typedef struct {
- mach_msg_header_t Head;
- } __Request__mach_ports_lookup_t __attribute__((unused));
-#ifdef __MigPackStructs
-#pragma pack(pop)
-#endif
-
-#ifdef __MigPackStructs
-#pragma pack(push, 4)
-#endif
- typedef struct {
- mach_msg_header_t Head;
- NDR_record_t NDR;
- task_flavor_t flavor;
- mach_msg_type_number_t task_info_outCnt;
- } __Request__task_info_t __attribute__((unused));
-#ifdef __MigPackStructs
-#pragma pack(pop)
-#endif
-
-#ifdef __MigPackStructs
-#pragma pack(push, 4)
-#endif
- typedef struct {
- mach_msg_header_t Head;
- NDR_record_t NDR;
- task_flavor_t flavor;
- mach_msg_type_number_t task_info_inCnt;
- integer_t task_info_in[87];
- } __Request__task_set_info_t __attribute__((unused));
-#ifdef __MigPackStructs
-#pragma pack(pop)
-#endif
-
-#ifdef __MigPackStructs
-#pragma pack(push, 4)
-#endif
- typedef struct {
- mach_msg_header_t Head;
- } __Request__task_suspend_t __attribute__((unused));
-#ifdef __MigPackStructs
-#pragma pack(pop)
-#endif
-
-#ifdef __MigPackStructs
-#pragma pack(push, 4)
-#endif
- typedef struct {
- mach_msg_header_t Head;
- } __Request__task_resume_t __attribute__((unused));
-#ifdef __MigPackStructs
-#pragma pack(pop)
-#endif
-
-#ifdef __MigPackStructs
-#pragma pack(push, 4)
-#endif
- typedef struct {
- mach_msg_header_t Head;
- NDR_record_t NDR;
- int which_port;
- } __Request__task_get_special_port_t __attribute__((unused));
-#ifdef __MigPackStructs
-#pragma pack(pop)
-#endif
-
-#ifdef __MigPackStructs
-#pragma pack(push, 4)
-#endif
- typedef struct {
- mach_msg_header_t Head;
- /* start of the kernel processed data */
- mach_msg_body_t msgh_body;
- mach_msg_port_descriptor_t special_port;
- /* end of the kernel processed data */
- NDR_record_t NDR;
- int which_port;
- } __Request__task_set_special_port_t __attribute__((unused));
-#ifdef __MigPackStructs
-#pragma pack(pop)
-#endif
-
-#ifdef __MigPackStructs
-#pragma pack(push, 4)
-#endif
- typedef struct {
- mach_msg_header_t Head;
- } __Request__thread_create_t __attribute__((unused));
-#ifdef __MigPackStructs
-#pragma pack(pop)
-#endif
-
-#ifdef __MigPackStructs
-#pragma pack(push, 4)
-#endif
- typedef struct {
- mach_msg_header_t Head;
- NDR_record_t NDR;
- thread_state_flavor_t flavor;
- mach_msg_type_number_t new_stateCnt;
- natural_t new_state[614];
- } __Request__thread_create_running_t __attribute__((unused));
-#ifdef __MigPackStructs
-#pragma pack(pop)
-#endif
-
-#ifdef __MigPackStructs
-#pragma pack(push, 4)
-#endif
- typedef struct {
- mach_msg_header_t Head;
- /* start of the kernel processed data */
- mach_msg_body_t msgh_body;
- mach_msg_port_descriptor_t new_port;
- /* end of the kernel processed data */
- NDR_record_t NDR;
- exception_mask_t exception_mask;
- exception_behavior_t behavior;
- thread_state_flavor_t new_flavor;
- } __Request__task_set_exception_ports_t __attribute__((unused));
-#ifdef __MigPackStructs
-#pragma pack(pop)
-#endif
-
-#ifdef __MigPackStructs
-#pragma pack(push, 4)
-#endif
- typedef struct {
- mach_msg_header_t Head;
- NDR_record_t NDR;
- exception_mask_t exception_mask;
- } __Request__task_get_exception_ports_t __attribute__((unused));
-#ifdef __MigPackStructs
-#pragma pack(pop)
-#endif
-
-#ifdef __MigPackStructs
-#pragma pack(push, 4)
-#endif
- typedef struct {
- mach_msg_header_t Head;
- /* start of the kernel processed data */
- mach_msg_body_t msgh_body;
- mach_msg_port_descriptor_t new_port;
- /* end of the kernel processed data */
- NDR_record_t NDR;
- exception_mask_t exception_mask;
- exception_behavior_t behavior;
- thread_state_flavor_t new_flavor;
- } __Request__task_swap_exception_ports_t __attribute__((unused));
-#ifdef __MigPackStructs
-#pragma pack(pop)
-#endif
-
-#ifdef __MigPackStructs
-#pragma pack(push, 4)
-#endif
- typedef struct {
- mach_msg_header_t Head;
- NDR_record_t NDR;
- int n_ulocks;
- int policy;
- } __Request__lock_set_create_t __attribute__((unused));
-#ifdef __MigPackStructs
-#pragma pack(pop)
-#endif
-
-#ifdef __MigPackStructs
-#pragma pack(push, 4)
-#endif
- typedef struct {
- mach_msg_header_t Head;
- /* start of the kernel processed data */
- mach_msg_body_t msgh_body;
- mach_msg_port_descriptor_t lock_set;
- /* end of the kernel processed data */
- } __Request__lock_set_destroy_t __attribute__((unused));
-#ifdef __MigPackStructs
-#pragma pack(pop)
-#endif
-
-#ifdef __MigPackStructs
-#pragma pack(push, 4)
-#endif
- typedef struct {
- mach_msg_header_t Head;
- NDR_record_t NDR;
- int policy;
- int value;
- } __Request__semaphore_create_t __attribute__((unused));
-#ifdef __MigPackStructs
-#pragma pack(pop)
-#endif
-
-#ifdef __MigPackStructs
-#pragma pack(push, 4)
-#endif
- typedef struct {
- mach_msg_header_t Head;
- /* start of the kernel processed data */
- mach_msg_body_t msgh_body;
- mach_msg_port_descriptor_t semaphore;
- /* end of the kernel processed data */
- } __Request__semaphore_destroy_t __attribute__((unused));
-#ifdef __MigPackStructs
-#pragma pack(pop)
-#endif
-
-#ifdef __MigPackStructs
-#pragma pack(push, 4)
-#endif
- typedef struct {
- mach_msg_header_t Head;
- NDR_record_t NDR;
- task_policy_flavor_t flavor;
- mach_msg_type_number_t policy_infoCnt;
- integer_t policy_info[16];
- } __Request__task_policy_set_t __attribute__((unused));
-#ifdef __MigPackStructs
-#pragma pack(pop)
-#endif
-
-#ifdef __MigPackStructs
-#pragma pack(push, 4)
-#endif
- typedef struct {
- mach_msg_header_t Head;
- NDR_record_t NDR;
- task_policy_flavor_t flavor;
- mach_msg_type_number_t policy_infoCnt;
- boolean_t get_default;
- } __Request__task_policy_get_t __attribute__((unused));
-#ifdef __MigPackStructs
-#pragma pack(pop)
-#endif
-
-#ifdef __MigPackStructs
-#pragma pack(push, 4)
-#endif
- typedef struct {
- mach_msg_header_t Head;
- /* start of the kernel processed data */
- mach_msg_body_t msgh_body;
- mach_msg_port_descriptor_t reply;
- /* end of the kernel processed data */
- } __Request__task_sample_t __attribute__((unused));
-#ifdef __MigPackStructs
-#pragma pack(pop)
-#endif
-
-#ifdef __MigPackStructs
-#pragma pack(push, 4)
-#endif
- typedef struct {
- mach_msg_header_t Head;
- NDR_record_t NDR;
- policy_t policy;
- mach_msg_type_number_t baseCnt;
- integer_t base[5];
- boolean_t set_limit;
- boolean_t change;
- } __Request__task_policy_t __attribute__((unused));
-#ifdef __MigPackStructs
-#pragma pack(pop)
-#endif
-
-#ifdef __MigPackStructs
-#pragma pack(push, 4)
-#endif
- typedef struct {
- mach_msg_header_t Head;
- NDR_record_t NDR;
- vm_address_t routine_entry_pt;
- int routine_number;
- } __Request__task_set_emulation_t __attribute__((unused));
-#ifdef __MigPackStructs
-#pragma pack(pop)
-#endif
-
-#ifdef __MigPackStructs
-#pragma pack(push, 4)
-#endif
- typedef struct {
- mach_msg_header_t Head;
- } __Request__task_get_emulation_vector_t __attribute__((unused));
-#ifdef __MigPackStructs
-#pragma pack(pop)
-#endif
-
-#ifdef __MigPackStructs
-#pragma pack(push, 4)
-#endif
- typedef struct {
- mach_msg_header_t Head;
- /* start of the kernel processed data */
- mach_msg_body_t msgh_body;
- mach_msg_ool_descriptor_t emulation_vector;
- /* end of the kernel processed data */
- NDR_record_t NDR;
- int vector_start;
- mach_msg_type_number_t emulation_vectorCnt;
- } __Request__task_set_emulation_vector_t __attribute__((unused));
-#ifdef __MigPackStructs
-#pragma pack(pop)
-#endif
-
-#ifdef __MigPackStructs
-#pragma pack(push, 4)
-#endif
- typedef struct {
- mach_msg_header_t Head;
- NDR_record_t NDR;
- vm_address_t basepc;
- vm_address_t boundspc;
- } __Request__task_set_ras_pc_t __attribute__((unused));
-#ifdef __MigPackStructs
-#pragma pack(pop)
-#endif
-
-#ifdef __MigPackStructs
-#pragma pack(push, 4)
-#endif
- typedef struct {
- mach_msg_header_t Head;
- } __Request__task_zone_info_t __attribute__((unused));
-#ifdef __MigPackStructs
-#pragma pack(pop)
-#endif
-
-#ifdef __MigPackStructs
-#pragma pack(push, 4)
-#endif
- typedef struct {
- mach_msg_header_t Head;
- /* start of the kernel processed data */
- mach_msg_body_t msgh_body;
- mach_msg_port_descriptor_t new_set;
- /* end of the kernel processed data */
- NDR_record_t NDR;
- boolean_t assign_threads;
- } __Request__task_assign_t __attribute__((unused));
-#ifdef __MigPackStructs
-#pragma pack(pop)
-#endif
-
-#ifdef __MigPackStructs
-#pragma pack(push, 4)
-#endif
- typedef struct {
- mach_msg_header_t Head;
- NDR_record_t NDR;
- boolean_t assign_threads;
- } __Request__task_assign_default_t __attribute__((unused));
-#ifdef __MigPackStructs
-#pragma pack(pop)
-#endif
-
-#ifdef __MigPackStructs
-#pragma pack(push, 4)
-#endif
- typedef struct {
- mach_msg_header_t Head;
- } __Request__task_get_assignment_t __attribute__((unused));
-#ifdef __MigPackStructs
-#pragma pack(pop)
-#endif
-
-#ifdef __MigPackStructs
-#pragma pack(push, 4)
-#endif
- typedef struct {
- mach_msg_header_t Head;
- /* start of the kernel processed data */
- mach_msg_body_t msgh_body;
- mach_msg_port_descriptor_t pset;
- /* end of the kernel processed data */
- NDR_record_t NDR;
- policy_t policy;
- mach_msg_type_number_t baseCnt;
- integer_t base[5];
- mach_msg_type_number_t limitCnt;
- integer_t limit[1];
- boolean_t change;
- } __Request__task_set_policy_t __attribute__((unused));
-#ifdef __MigPackStructs
-#pragma pack(pop)
-#endif
-
-#ifdef __MigPackStructs
-#pragma pack(push, 4)
-#endif
- typedef struct {
- mach_msg_header_t Head;
- NDR_record_t NDR;
- thread_state_flavor_t flavor;
- mach_msg_type_number_t old_stateCnt;
- } __Request__task_get_state_t __attribute__((unused));
-#ifdef __MigPackStructs
-#pragma pack(pop)
-#endif
-
-#ifdef __MigPackStructs
-#pragma pack(push, 4)
-#endif
- typedef struct {
- mach_msg_header_t Head;
- NDR_record_t NDR;
- thread_state_flavor_t flavor;
- mach_msg_type_number_t new_stateCnt;
- natural_t new_state[614];
- } __Request__task_set_state_t __attribute__((unused));
-#ifdef __MigPackStructs
-#pragma pack(pop)
-#endif
-
-#ifdef __MigPackStructs
-#pragma pack(push, 4)
-#endif
- typedef struct {
- mach_msg_header_t Head;
- NDR_record_t NDR;
- int new_limit;
- } __Request__task_set_phys_footprint_limit_t __attribute__((unused));
-#ifdef __MigPackStructs
-#pragma pack(pop)
-#endif
-
-#ifdef __MigPackStructs
-#pragma pack(push, 4)
-#endif
- typedef struct {
- mach_msg_header_t Head;
- } __Request__task_suspend2_t __attribute__((unused));
-#ifdef __MigPackStructs
-#pragma pack(pop)
-#endif
-
-#ifdef __MigPackStructs
-#pragma pack(push, 4)
-#endif
- typedef struct {
- mach_msg_header_t Head;
- } __Request__task_resume2_t __attribute__((unused));
-#ifdef __MigPackStructs
-#pragma pack(pop)
-#endif
-
-#ifdef __MigPackStructs
-#pragma pack(push, 4)
-#endif
- typedef struct {
- mach_msg_header_t Head;
- } __Request__task_purgable_info_t __attribute__((unused));
-#ifdef __MigPackStructs
-#pragma pack(pop)
-#endif
-
-#ifdef __MigPackStructs
-#pragma pack(push, 4)
-#endif
- typedef struct {
- mach_msg_header_t Head;
- NDR_record_t NDR;
- mach_voucher_selector_t which;
- } __Request__task_get_mach_voucher_t __attribute__((unused));
-#ifdef __MigPackStructs
-#pragma pack(pop)
-#endif
-
-#ifdef __MigPackStructs
-#pragma pack(push, 4)
-#endif
- typedef struct {
- mach_msg_header_t Head;
- /* start of the kernel processed data */
- mach_msg_body_t msgh_body;
- mach_msg_port_descriptor_t voucher;
- /* end of the kernel processed data */
- } __Request__task_set_mach_voucher_t __attribute__((unused));
-#ifdef __MigPackStructs
-#pragma pack(pop)
-#endif
-
-#ifdef __MigPackStructs
-#pragma pack(push, 4)
-#endif
- typedef struct {
- mach_msg_header_t Head;
- /* start of the kernel processed data */
- mach_msg_body_t msgh_body;
- mach_msg_port_descriptor_t new_voucher;
- mach_msg_port_descriptor_t old_voucher;
- /* end of the kernel processed data */
- } __Request__task_swap_mach_voucher_t __attribute__((unused));
-#ifdef __MigPackStructs
-#pragma pack(pop)
-#endif
-
-#ifdef __MigPackStructs
-#pragma pack(push, 4)
-#endif
- typedef struct {
- mach_msg_header_t Head;
- } __Request__task_generate_corpse_t __attribute__((unused));
-#ifdef __MigPackStructs
-#pragma pack(pop)
-#endif
-
-#ifdef __MigPackStructs
-#pragma pack(push, 4)
-#endif
- typedef struct {
- mach_msg_header_t Head;
- /* start of the kernel processed data */
- mach_msg_body_t msgh_body;
- mach_msg_port_descriptor_t corspe_task;
- /* end of the kernel processed data */
- } __Request__task_map_corpse_info_t __attribute__((unused));
-#ifdef __MigPackStructs
-#pragma pack(pop)
-#endif
-
-#ifdef __MigPackStructs
-#pragma pack(push, 4)
-#endif
- typedef struct {
- mach_msg_header_t Head;
- /* start of the kernel processed data */
- mach_msg_body_t msgh_body;
- mach_msg_ool_descriptor_t dyld_images;
- /* end of the kernel processed data */
- NDR_record_t NDR;
- mach_msg_type_number_t dyld_imagesCnt;
- } __Request__task_register_dyld_image_infos_t __attribute__((unused));
-#ifdef __MigPackStructs
-#pragma pack(pop)
-#endif
-
-#ifdef __MigPackStructs
-#pragma pack(push, 4)
-#endif
- typedef struct {
- mach_msg_header_t Head;
- /* start of the kernel processed data */
- mach_msg_body_t msgh_body;
- mach_msg_ool_descriptor_t dyld_images;
- /* end of the kernel processed data */
- NDR_record_t NDR;
- mach_msg_type_number_t dyld_imagesCnt;
- } __Request__task_unregister_dyld_image_infos_t __attribute__((unused));
-#ifdef __MigPackStructs
-#pragma pack(pop)
-#endif
-
-#ifdef __MigPackStructs
-#pragma pack(push, 4)
-#endif
- typedef struct {
- mach_msg_header_t Head;
- } __Request__task_get_dyld_image_infos_t __attribute__((unused));
-#ifdef __MigPackStructs
-#pragma pack(pop)
-#endif
-
-#ifdef __MigPackStructs
-#pragma pack(push, 4)
-#endif
- typedef struct {
- mach_msg_header_t Head;
- NDR_record_t NDR;
- dyld_kernel_image_info_t dyld_cache_image;
- boolean_t no_cache;
- boolean_t private_cache;
- } __Request__task_register_dyld_shared_cache_image_info_t __attribute__((unused));
-#ifdef __MigPackStructs
-#pragma pack(pop)
-#endif
-
-#ifdef __MigPackStructs
-#pragma pack(push, 4)
-#endif
- typedef struct {
- mach_msg_header_t Head;
- NDR_record_t NDR;
- uint8_t dyld_state;
- char dyld_statePad[3];
- } __Request__task_register_dyld_set_dyld_state_t __attribute__((unused));
-#ifdef __MigPackStructs
-#pragma pack(pop)
-#endif
-
-#ifdef __MigPackStructs
-#pragma pack(push, 4)
-#endif
- typedef struct {
- mach_msg_header_t Head;
- } __Request__task_register_dyld_get_process_state_t __attribute__((unused));
-#ifdef __MigPackStructs
-#pragma pack(pop)
-#endif
-
-#ifdef __MigPackStructs
-#pragma pack(push, 4)
-#endif
- typedef struct {
- mach_msg_header_t Head;
- /* start of the kernel processed data */
- mach_msg_body_t msgh_body;
- mach_msg_port_descriptor_t corspe_task;
- /* end of the kernel processed data */
- } __Request__task_map_corpse_info_64_t __attribute__((unused));
-#ifdef __MigPackStructs
-#pragma pack(pop)
-#endif
-
-#ifdef __MigPackStructs
-#pragma pack(push, 4)
-#endif
- typedef struct {
- mach_msg_header_t Head;
- NDR_record_t NDR;
- task_inspect_flavor_t flavor;
- mach_msg_type_number_t info_outCnt;
- } __Request__task_inspect_t __attribute__((unused));
-#ifdef __MigPackStructs
-#pragma pack(pop)
-#endif
-
-#ifdef __MigPackStructs
-#pragma pack(push, 4)
-#endif
- typedef struct {
- mach_msg_header_t Head;
- } __Request__task_get_exc_guard_behavior_t __attribute__((unused));
-#ifdef __MigPackStructs
-#pragma pack(pop)
-#endif
-
-#ifdef __MigPackStructs
-#pragma pack(push, 4)
-#endif
- typedef struct {
- mach_msg_header_t Head;
- NDR_record_t NDR;
- task_exc_guard_behavior_t behavior;
- } __Request__task_set_exc_guard_behavior_t __attribute__((unused));
-#ifdef __MigPackStructs
-#pragma pack(pop)
-#endif
-
-#ifdef __MigPackStructs
-#pragma pack(push, 4)
-#endif
- typedef struct {
- mach_msg_header_t Head;
- NDR_record_t NDR;
- mach_msg_type_number_t pathOffset; /* MiG doesn't use it */
- mach_msg_type_number_t pathCnt;
- char path[1024];
- suid_cred_uid_t uid;
- } __Request__task_create_suid_cred_t __attribute__((unused));
-#ifdef __MigPackStructs
-#pragma pack(pop)
-#endif
-#endif /* !__Request__task_subsystem__defined */
-
-/* union of all requests */
-
-#ifndef __RequestUnion__task_subsystem__defined
-#define __RequestUnion__task_subsystem__defined
-union __RequestUnion__task_subsystem {
- __Request__task_create_t Request_task_create;
- __Request__task_terminate_t Request_task_terminate;
- __Request__task_threads_t Request_task_threads;
- __Request__mach_ports_register_t Request_mach_ports_register;
- __Request__mach_ports_lookup_t Request_mach_ports_lookup;
- __Request__task_info_t Request_task_info;
- __Request__task_set_info_t Request_task_set_info;
- __Request__task_suspend_t Request_task_suspend;
- __Request__task_resume_t Request_task_resume;
- __Request__task_get_special_port_t Request_task_get_special_port;
- __Request__task_set_special_port_t Request_task_set_special_port;
- __Request__thread_create_t Request_thread_create;
- __Request__thread_create_running_t Request_thread_create_running;
- __Request__task_set_exception_ports_t Request_task_set_exception_ports;
- __Request__task_get_exception_ports_t Request_task_get_exception_ports;
- __Request__task_swap_exception_ports_t Request_task_swap_exception_ports;
- __Request__lock_set_create_t Request_lock_set_create;
- __Request__lock_set_destroy_t Request_lock_set_destroy;
- __Request__semaphore_create_t Request_semaphore_create;
- __Request__semaphore_destroy_t Request_semaphore_destroy;
- __Request__task_policy_set_t Request_task_policy_set;
- __Request__task_policy_get_t Request_task_policy_get;
- __Request__task_sample_t Request_task_sample;
- __Request__task_policy_t Request_task_policy;
- __Request__task_set_emulation_t Request_task_set_emulation;
- __Request__task_get_emulation_vector_t Request_task_get_emulation_vector;
- __Request__task_set_emulation_vector_t Request_task_set_emulation_vector;
- __Request__task_set_ras_pc_t Request_task_set_ras_pc;
- __Request__task_zone_info_t Request_task_zone_info;
- __Request__task_assign_t Request_task_assign;
- __Request__task_assign_default_t Request_task_assign_default;
- __Request__task_get_assignment_t Request_task_get_assignment;
- __Request__task_set_policy_t Request_task_set_policy;
- __Request__task_get_state_t Request_task_get_state;
- __Request__task_set_state_t Request_task_set_state;
- __Request__task_set_phys_footprint_limit_t Request_task_set_phys_footprint_limit;
- __Request__task_suspend2_t Request_task_suspend2;
- __Request__task_resume2_t Request_task_resume2;
- __Request__task_purgable_info_t Request_task_purgable_info;
- __Request__task_get_mach_voucher_t Request_task_get_mach_voucher;
- __Request__task_set_mach_voucher_t Request_task_set_mach_voucher;
- __Request__task_swap_mach_voucher_t Request_task_swap_mach_voucher;
- __Request__task_generate_corpse_t Request_task_generate_corpse;
- __Request__task_map_corpse_info_t Request_task_map_corpse_info;
- __Request__task_register_dyld_image_infos_t Request_task_register_dyld_image_infos;
- __Request__task_unregister_dyld_image_infos_t Request_task_unregister_dyld_image_infos;
- __Request__task_get_dyld_image_infos_t Request_task_get_dyld_image_infos;
- __Request__task_register_dyld_shared_cache_image_info_t Request_task_register_dyld_shared_cache_image_info;
- __Request__task_register_dyld_set_dyld_state_t Request_task_register_dyld_set_dyld_state;
- __Request__task_register_dyld_get_process_state_t Request_task_register_dyld_get_process_state;
- __Request__task_map_corpse_info_64_t Request_task_map_corpse_info_64;
- __Request__task_inspect_t Request_task_inspect;
- __Request__task_get_exc_guard_behavior_t Request_task_get_exc_guard_behavior;
- __Request__task_set_exc_guard_behavior_t Request_task_set_exc_guard_behavior;
- __Request__task_create_suid_cred_t Request_task_create_suid_cred;
-};
-#endif /* !__RequestUnion__task_subsystem__defined */
-/* typedefs for all replies */
-
-#ifndef __Reply__task_subsystem__defined
-#define __Reply__task_subsystem__defined
-
-#ifdef __MigPackStructs
-#pragma pack(push, 4)
-#endif
- typedef struct {
- mach_msg_header_t Head;
- /* start of the kernel processed data */
- mach_msg_body_t msgh_body;
- mach_msg_port_descriptor_t child_task;
- /* end of the kernel processed data */
- } __Reply__task_create_t __attribute__((unused));
-#ifdef __MigPackStructs
-#pragma pack(pop)
-#endif
-
-#ifdef __MigPackStructs
-#pragma pack(push, 4)
-#endif
- typedef struct {
- mach_msg_header_t Head;
- NDR_record_t NDR;
- kern_return_t RetCode;
- } __Reply__task_terminate_t __attribute__((unused));
-#ifdef __MigPackStructs
-#pragma pack(pop)
-#endif
-
-#ifdef __MigPackStructs
-#pragma pack(push, 4)
-#endif
- typedef struct {
- mach_msg_header_t Head;
- /* start of the kernel processed data */
- mach_msg_body_t msgh_body;
- mach_msg_ool_ports_descriptor_t act_list;
- /* end of the kernel processed data */
- NDR_record_t NDR;
- mach_msg_type_number_t act_listCnt;
- } __Reply__task_threads_t __attribute__((unused));
-#ifdef __MigPackStructs
-#pragma pack(pop)
-#endif
-
-#ifdef __MigPackStructs
-#pragma pack(push, 4)
-#endif
- typedef struct {
- mach_msg_header_t Head;
- NDR_record_t NDR;
- kern_return_t RetCode;
- } __Reply__mach_ports_register_t __attribute__((unused));
-#ifdef __MigPackStructs
-#pragma pack(pop)
-#endif
-
-#ifdef __MigPackStructs
-#pragma pack(push, 4)
-#endif
- typedef struct {
- mach_msg_header_t Head;
- /* start of the kernel processed data */
- mach_msg_body_t msgh_body;
- mach_msg_ool_ports_descriptor_t init_port_set;
- /* end of the kernel processed data */
- NDR_record_t NDR;
- mach_msg_type_number_t init_port_setCnt;
- } __Reply__mach_ports_lookup_t __attribute__((unused));
-#ifdef __MigPackStructs
-#pragma pack(pop)
-#endif
-
-#ifdef __MigPackStructs
-#pragma pack(push, 4)
-#endif
- typedef struct {
- mach_msg_header_t Head;
- NDR_record_t NDR;
- kern_return_t RetCode;
- mach_msg_type_number_t task_info_outCnt;
- integer_t task_info_out[87];
- } __Reply__task_info_t __attribute__((unused));
-#ifdef __MigPackStructs
-#pragma pack(pop)
-#endif
-
-#ifdef __MigPackStructs
-#pragma pack(push, 4)
-#endif
- typedef struct {
- mach_msg_header_t Head;
- NDR_record_t NDR;
- kern_return_t RetCode;
- } __Reply__task_set_info_t __attribute__((unused));
-#ifdef __MigPackStructs
-#pragma pack(pop)
-#endif
-
-#ifdef __MigPackStructs
-#pragma pack(push, 4)
-#endif
- typedef struct {
- mach_msg_header_t Head;
- NDR_record_t NDR;
- kern_return_t RetCode;
- } __Reply__task_suspend_t __attribute__((unused));
-#ifdef __MigPackStructs
-#pragma pack(pop)
-#endif
-
-#ifdef __MigPackStructs
-#pragma pack(push, 4)
-#endif
- typedef struct {
- mach_msg_header_t Head;
- NDR_record_t NDR;
- kern_return_t RetCode;
- } __Reply__task_resume_t __attribute__((unused));
-#ifdef __MigPackStructs
-#pragma pack(pop)
-#endif
-
-#ifdef __MigPackStructs
-#pragma pack(push, 4)
-#endif
- typedef struct {
- mach_msg_header_t Head;
- /* start of the kernel processed data */
- mach_msg_body_t msgh_body;
- mach_msg_port_descriptor_t special_port;
- /* end of the kernel processed data */
- } __Reply__task_get_special_port_t __attribute__((unused));
-#ifdef __MigPackStructs
-#pragma pack(pop)
-#endif
-
-#ifdef __MigPackStructs
-#pragma pack(push, 4)
-#endif
- typedef struct {
- mach_msg_header_t Head;
- NDR_record_t NDR;
- kern_return_t RetCode;
- } __Reply__task_set_special_port_t __attribute__((unused));
-#ifdef __MigPackStructs
-#pragma pack(pop)
-#endif
-
-#ifdef __MigPackStructs
-#pragma pack(push, 4)
-#endif
- typedef struct {
- mach_msg_header_t Head;
- /* start of the kernel processed data */
- mach_msg_body_t msgh_body;
- mach_msg_port_descriptor_t child_act;
- /* end of the kernel processed data */
- } __Reply__thread_create_t __attribute__((unused));
-#ifdef __MigPackStructs
-#pragma pack(pop)
-#endif
-
-#ifdef __MigPackStructs
-#pragma pack(push, 4)
-#endif
- typedef struct {
- mach_msg_header_t Head;
- /* start of the kernel processed data */
- mach_msg_body_t msgh_body;
- mach_msg_port_descriptor_t child_act;
- /* end of the kernel processed data */
- } __Reply__thread_create_running_t __attribute__((unused));
-#ifdef __MigPackStructs
-#pragma pack(pop)
-#endif
-
-#ifdef __MigPackStructs
-#pragma pack(push, 4)
-#endif
- typedef struct {
- mach_msg_header_t Head;
- NDR_record_t NDR;
- kern_return_t RetCode;
- } __Reply__task_set_exception_ports_t __attribute__((unused));
-#ifdef __MigPackStructs
-#pragma pack(pop)
-#endif
-
-#ifdef __MigPackStructs
-#pragma pack(push, 4)
-#endif
- typedef struct {
- mach_msg_header_t Head;
- /* start of the kernel processed data */
- mach_msg_body_t msgh_body;
- mach_msg_port_descriptor_t old_handlers[32];
- /* end of the kernel processed data */
- NDR_record_t NDR;
- mach_msg_type_number_t masksCnt;
- exception_mask_t masks[32];
- exception_behavior_t old_behaviors[32];
- thread_state_flavor_t old_flavors[32];
- } __Reply__task_get_exception_ports_t __attribute__((unused));
-#ifdef __MigPackStructs
-#pragma pack(pop)
-#endif
-
-#ifdef __MigPackStructs
-#pragma pack(push, 4)
-#endif
- typedef struct {
- mach_msg_header_t Head;
- /* start of the kernel processed data */
- mach_msg_body_t msgh_body;
- mach_msg_port_descriptor_t old_handlerss[32];
- /* end of the kernel processed data */
- NDR_record_t NDR;
- mach_msg_type_number_t masksCnt;
- exception_mask_t masks[32];
- exception_behavior_t old_behaviors[32];
- thread_state_flavor_t old_flavors[32];
- } __Reply__task_swap_exception_ports_t __attribute__((unused));
-#ifdef __MigPackStructs
-#pragma pack(pop)
-#endif
-
-#ifdef __MigPackStructs
-#pragma pack(push, 4)
-#endif
- typedef struct {
- mach_msg_header_t Head;
- /* start of the kernel processed data */
- mach_msg_body_t msgh_body;
- mach_msg_port_descriptor_t new_lock_set;
- /* end of the kernel processed data */
- } __Reply__lock_set_create_t __attribute__((unused));
-#ifdef __MigPackStructs
-#pragma pack(pop)
-#endif
-
-#ifdef __MigPackStructs
-#pragma pack(push, 4)
-#endif
- typedef struct {
- mach_msg_header_t Head;
- NDR_record_t NDR;
- kern_return_t RetCode;
- } __Reply__lock_set_destroy_t __attribute__((unused));
-#ifdef __MigPackStructs
-#pragma pack(pop)
-#endif
-
-#ifdef __MigPackStructs
-#pragma pack(push, 4)
-#endif
- typedef struct {
- mach_msg_header_t Head;
- /* start of the kernel processed data */
- mach_msg_body_t msgh_body;
- mach_msg_port_descriptor_t semaphore;
- /* end of the kernel processed data */
- } __Reply__semaphore_create_t __attribute__((unused));
-#ifdef __MigPackStructs
-#pragma pack(pop)
-#endif
-
-#ifdef __MigPackStructs
-#pragma pack(push, 4)
-#endif
- typedef struct {
- mach_msg_header_t Head;
- NDR_record_t NDR;
- kern_return_t RetCode;
- } __Reply__semaphore_destroy_t __attribute__((unused));
-#ifdef __MigPackStructs
-#pragma pack(pop)
-#endif
-
-#ifdef __MigPackStructs
-#pragma pack(push, 4)
-#endif
- typedef struct {
- mach_msg_header_t Head;
- NDR_record_t NDR;
- kern_return_t RetCode;
- } __Reply__task_policy_set_t __attribute__((unused));
-#ifdef __MigPackStructs
-#pragma pack(pop)
-#endif
-
-#ifdef __MigPackStructs
-#pragma pack(push, 4)
-#endif
- typedef struct {
- mach_msg_header_t Head;
- NDR_record_t NDR;
- kern_return_t RetCode;
- mach_msg_type_number_t policy_infoCnt;
- integer_t policy_info[16];
- boolean_t get_default;
- } __Reply__task_policy_get_t __attribute__((unused));
-#ifdef __MigPackStructs
-#pragma pack(pop)
-#endif
-
-#ifdef __MigPackStructs
-#pragma pack(push, 4)
-#endif
- typedef struct {
- mach_msg_header_t Head;
- NDR_record_t NDR;
- kern_return_t RetCode;
- } __Reply__task_sample_t __attribute__((unused));
-#ifdef __MigPackStructs
-#pragma pack(pop)
-#endif
-
-#ifdef __MigPackStructs
-#pragma pack(push, 4)
-#endif
- typedef struct {
- mach_msg_header_t Head;
- NDR_record_t NDR;
- kern_return_t RetCode;
- } __Reply__task_policy_t __attribute__((unused));
-#ifdef __MigPackStructs
-#pragma pack(pop)
-#endif
-
-#ifdef __MigPackStructs
-#pragma pack(push, 4)
-#endif
- typedef struct {
- mach_msg_header_t Head;
- NDR_record_t NDR;
- kern_return_t RetCode;
- } __Reply__task_set_emulation_t __attribute__((unused));
-#ifdef __MigPackStructs
-#pragma pack(pop)
-#endif
-
-#ifdef __MigPackStructs
-#pragma pack(push, 4)
-#endif
- typedef struct {
- mach_msg_header_t Head;
- /* start of the kernel processed data */
- mach_msg_body_t msgh_body;
- mach_msg_ool_descriptor_t emulation_vector;
- /* end of the kernel processed data */
- NDR_record_t NDR;
- int vector_start;
- mach_msg_type_number_t emulation_vectorCnt;
- } __Reply__task_get_emulation_vector_t __attribute__((unused));
-#ifdef __MigPackStructs
-#pragma pack(pop)
-#endif
-
-#ifdef __MigPackStructs
-#pragma pack(push, 4)
-#endif
- typedef struct {
- mach_msg_header_t Head;
- NDR_record_t NDR;
- kern_return_t RetCode;
- } __Reply__task_set_emulation_vector_t __attribute__((unused));
-#ifdef __MigPackStructs
-#pragma pack(pop)
-#endif
-
-#ifdef __MigPackStructs
-#pragma pack(push, 4)
-#endif
- typedef struct {
- mach_msg_header_t Head;
- NDR_record_t NDR;
- kern_return_t RetCode;
- } __Reply__task_set_ras_pc_t __attribute__((unused));
-#ifdef __MigPackStructs
-#pragma pack(pop)
-#endif
-
-#ifdef __MigPackStructs
-#pragma pack(push, 4)
-#endif
- typedef struct {
- mach_msg_header_t Head;
- /* start of the kernel processed data */
- mach_msg_body_t msgh_body;
- mach_msg_ool_descriptor_t names;
- mach_msg_ool_descriptor_t info;
- /* end of the kernel processed data */
- NDR_record_t NDR;
- mach_msg_type_number_t namesCnt;
- mach_msg_type_number_t infoCnt;
- } __Reply__task_zone_info_t __attribute__((unused));
-#ifdef __MigPackStructs
-#pragma pack(pop)
-#endif
-
-#ifdef __MigPackStructs
-#pragma pack(push, 4)
-#endif
- typedef struct {
- mach_msg_header_t Head;
- NDR_record_t NDR;
- kern_return_t RetCode;
- } __Reply__task_assign_t __attribute__((unused));
-#ifdef __MigPackStructs
-#pragma pack(pop)
-#endif
-
-#ifdef __MigPackStructs
-#pragma pack(push, 4)
-#endif
- typedef struct {
- mach_msg_header_t Head;
- NDR_record_t NDR;
- kern_return_t RetCode;
- } __Reply__task_assign_default_t __attribute__((unused));
-#ifdef __MigPackStructs
-#pragma pack(pop)
-#endif
-
-#ifdef __MigPackStructs
-#pragma pack(push, 4)
-#endif
- typedef struct {
- mach_msg_header_t Head;
- /* start of the kernel processed data */
- mach_msg_body_t msgh_body;
- mach_msg_port_descriptor_t assigned_set;
- /* end of the kernel processed data */
- } __Reply__task_get_assignment_t __attribute__((unused));
-#ifdef __MigPackStructs
-#pragma pack(pop)
-#endif
-
-#ifdef __MigPackStructs
-#pragma pack(push, 4)
-#endif
- typedef struct {
- mach_msg_header_t Head;
- NDR_record_t NDR;
- kern_return_t RetCode;
- } __Reply__task_set_policy_t __attribute__((unused));
-#ifdef __MigPackStructs
-#pragma pack(pop)
-#endif
-
-#ifdef __MigPackStructs
-#pragma pack(push, 4)
-#endif
- typedef struct {
- mach_msg_header_t Head;
- NDR_record_t NDR;
- kern_return_t RetCode;
- mach_msg_type_number_t old_stateCnt;
- natural_t old_state[614];
- } __Reply__task_get_state_t __attribute__((unused));
-#ifdef __MigPackStructs
-#pragma pack(pop)
-#endif
-
-#ifdef __MigPackStructs
-#pragma pack(push, 4)
-#endif
- typedef struct {
- mach_msg_header_t Head;
- NDR_record_t NDR;
- kern_return_t RetCode;
- } __Reply__task_set_state_t __attribute__((unused));
-#ifdef __MigPackStructs
-#pragma pack(pop)
-#endif
-
-#ifdef __MigPackStructs
-#pragma pack(push, 4)
-#endif
- typedef struct {
- mach_msg_header_t Head;
- NDR_record_t NDR;
- kern_return_t RetCode;
- int old_limit;
- } __Reply__task_set_phys_footprint_limit_t __attribute__((unused));
-#ifdef __MigPackStructs
-#pragma pack(pop)
-#endif
-
-#ifdef __MigPackStructs
-#pragma pack(push, 4)
-#endif
- typedef struct {
- mach_msg_header_t Head;
- /* start of the kernel processed data */
- mach_msg_body_t msgh_body;
- mach_msg_port_descriptor_t suspend_token;
- /* end of the kernel processed data */
- } __Reply__task_suspend2_t __attribute__((unused));
-#ifdef __MigPackStructs
-#pragma pack(pop)
-#endif
-
-#ifdef __MigPackStructs
-#pragma pack(push, 4)
-#endif
- typedef struct {
- mach_msg_header_t Head;
- NDR_record_t NDR;
- kern_return_t RetCode;
- } __Reply__task_resume2_t __attribute__((unused));
-#ifdef __MigPackStructs
-#pragma pack(pop)
-#endif
-
-#ifdef __MigPackStructs
-#pragma pack(push, 4)
-#endif
- typedef struct {
- mach_msg_header_t Head;
- NDR_record_t NDR;
- kern_return_t RetCode;
- task_purgable_info_t stats;
- } __Reply__task_purgable_info_t __attribute__((unused));
-#ifdef __MigPackStructs
-#pragma pack(pop)
-#endif
-
-#ifdef __MigPackStructs
-#pragma pack(push, 4)
-#endif
- typedef struct {
- mach_msg_header_t Head;
- /* start of the kernel processed data */
- mach_msg_body_t msgh_body;
- mach_msg_port_descriptor_t voucher;
- /* end of the kernel processed data */
- } __Reply__task_get_mach_voucher_t __attribute__((unused));
-#ifdef __MigPackStructs
-#pragma pack(pop)
-#endif
-
-#ifdef __MigPackStructs
-#pragma pack(push, 4)
-#endif
- typedef struct {
- mach_msg_header_t Head;
- NDR_record_t NDR;
- kern_return_t RetCode;
- } __Reply__task_set_mach_voucher_t __attribute__((unused));
-#ifdef __MigPackStructs
-#pragma pack(pop)
-#endif
-
-#ifdef __MigPackStructs
-#pragma pack(push, 4)
-#endif
- typedef struct {
- mach_msg_header_t Head;
- /* start of the kernel processed data */
- mach_msg_body_t msgh_body;
- mach_msg_port_descriptor_t old_voucher;
- /* end of the kernel processed data */
- } __Reply__task_swap_mach_voucher_t __attribute__((unused));
-#ifdef __MigPackStructs
-#pragma pack(pop)
-#endif
-
-#ifdef __MigPackStructs
-#pragma pack(push, 4)
-#endif
- typedef struct {
- mach_msg_header_t Head;
- /* start of the kernel processed data */
- mach_msg_body_t msgh_body;
- mach_msg_port_descriptor_t corpse_task_port;
- /* end of the kernel processed data */
- } __Reply__task_generate_corpse_t __attribute__((unused));
-#ifdef __MigPackStructs
-#pragma pack(pop)
-#endif
-
-#ifdef __MigPackStructs
-#pragma pack(push, 4)
-#endif
- typedef struct {
- mach_msg_header_t Head;
- NDR_record_t NDR;
- kern_return_t RetCode;
- vm_address_t kcd_addr_begin;
- uint32_t kcd_size;
- } __Reply__task_map_corpse_info_t __attribute__((unused));
-#ifdef __MigPackStructs
-#pragma pack(pop)
-#endif
-
-#ifdef __MigPackStructs
-#pragma pack(push, 4)
-#endif
- typedef struct {
- mach_msg_header_t Head;
- NDR_record_t NDR;
- kern_return_t RetCode;
- } __Reply__task_register_dyld_image_infos_t __attribute__((unused));
-#ifdef __MigPackStructs
-#pragma pack(pop)
-#endif
-
-#ifdef __MigPackStructs
-#pragma pack(push, 4)
-#endif
- typedef struct {
- mach_msg_header_t Head;
- NDR_record_t NDR;
- kern_return_t RetCode;
- } __Reply__task_unregister_dyld_image_infos_t __attribute__((unused));
-#ifdef __MigPackStructs
-#pragma pack(pop)
-#endif
-
-#ifdef __MigPackStructs
-#pragma pack(push, 4)
-#endif
- typedef struct {
- mach_msg_header_t Head;
- /* start of the kernel processed data */
- mach_msg_body_t msgh_body;
- mach_msg_ool_descriptor_t dyld_images;
- /* end of the kernel processed data */
- NDR_record_t NDR;
- mach_msg_type_number_t dyld_imagesCnt;
- } __Reply__task_get_dyld_image_infos_t __attribute__((unused));
-#ifdef __MigPackStructs
-#pragma pack(pop)
-#endif
-
-#ifdef __MigPackStructs
-#pragma pack(push, 4)
-#endif
- typedef struct {
- mach_msg_header_t Head;
- NDR_record_t NDR;
- kern_return_t RetCode;
- } __Reply__task_register_dyld_shared_cache_image_info_t __attribute__((unused));
-#ifdef __MigPackStructs
-#pragma pack(pop)
-#endif
-
-#ifdef __MigPackStructs
-#pragma pack(push, 4)
-#endif
- typedef struct {
- mach_msg_header_t Head;
- NDR_record_t NDR;
- kern_return_t RetCode;
- } __Reply__task_register_dyld_set_dyld_state_t __attribute__((unused));
-#ifdef __MigPackStructs
-#pragma pack(pop)
-#endif
-
-#ifdef __MigPackStructs
-#pragma pack(push, 4)
-#endif
- typedef struct {
- mach_msg_header_t Head;
- NDR_record_t NDR;
- kern_return_t RetCode;
- dyld_kernel_process_info_t dyld_process_state;
- } __Reply__task_register_dyld_get_process_state_t __attribute__((unused));
-#ifdef __MigPackStructs
-#pragma pack(pop)
-#endif
-
-#ifdef __MigPackStructs
-#pragma pack(push, 4)
-#endif
- typedef struct {
- mach_msg_header_t Head;
- NDR_record_t NDR;
- kern_return_t RetCode;
- mach_vm_address_t kcd_addr_begin;
- mach_vm_size_t kcd_size;
- } __Reply__task_map_corpse_info_64_t __attribute__((unused));
-#ifdef __MigPackStructs
-#pragma pack(pop)
-#endif
-
-#ifdef __MigPackStructs
-#pragma pack(push, 4)
-#endif
- typedef struct {
- mach_msg_header_t Head;
- NDR_record_t NDR;
- kern_return_t RetCode;
- mach_msg_type_number_t info_outCnt;
- integer_t info_out[4];
- } __Reply__task_inspect_t __attribute__((unused));
-#ifdef __MigPackStructs
-#pragma pack(pop)
-#endif
-
-#ifdef __MigPackStructs
-#pragma pack(push, 4)
-#endif
- typedef struct {
- mach_msg_header_t Head;
- NDR_record_t NDR;
- kern_return_t RetCode;
- task_exc_guard_behavior_t behavior;
- } __Reply__task_get_exc_guard_behavior_t __attribute__((unused));
-#ifdef __MigPackStructs
-#pragma pack(pop)
-#endif
-
-#ifdef __MigPackStructs
-#pragma pack(push, 4)
-#endif
- typedef struct {
- mach_msg_header_t Head;
- NDR_record_t NDR;
- kern_return_t RetCode;
- } __Reply__task_set_exc_guard_behavior_t __attribute__((unused));
-#ifdef __MigPackStructs
-#pragma pack(pop)
-#endif
-
-#ifdef __MigPackStructs
-#pragma pack(push, 4)
-#endif
- typedef struct {
- mach_msg_header_t Head;
- /* start of the kernel processed data */
- mach_msg_body_t msgh_body;
- mach_msg_port_descriptor_t delegation;
- /* end of the kernel processed data */
- } __Reply__task_create_suid_cred_t __attribute__((unused));
-#ifdef __MigPackStructs
-#pragma pack(pop)
-#endif
-#endif /* !__Reply__task_subsystem__defined */
-
-/* union of all replies */
-
-#ifndef __ReplyUnion__task_subsystem__defined
-#define __ReplyUnion__task_subsystem__defined
-union __ReplyUnion__task_subsystem {
- __Reply__task_create_t Reply_task_create;
- __Reply__task_terminate_t Reply_task_terminate;
- __Reply__task_threads_t Reply_task_threads;
- __Reply__mach_ports_register_t Reply_mach_ports_register;
- __Reply__mach_ports_lookup_t Reply_mach_ports_lookup;
- __Reply__task_info_t Reply_task_info;
- __Reply__task_set_info_t Reply_task_set_info;
- __Reply__task_suspend_t Reply_task_suspend;
- __Reply__task_resume_t Reply_task_resume;
- __Reply__task_get_special_port_t Reply_task_get_special_port;
- __Reply__task_set_special_port_t Reply_task_set_special_port;
- __Reply__thread_create_t Reply_thread_create;
- __Reply__thread_create_running_t Reply_thread_create_running;
- __Reply__task_set_exception_ports_t Reply_task_set_exception_ports;
- __Reply__task_get_exception_ports_t Reply_task_get_exception_ports;
- __Reply__task_swap_exception_ports_t Reply_task_swap_exception_ports;
- __Reply__lock_set_create_t Reply_lock_set_create;
- __Reply__lock_set_destroy_t Reply_lock_set_destroy;
- __Reply__semaphore_create_t Reply_semaphore_create;
- __Reply__semaphore_destroy_t Reply_semaphore_destroy;
- __Reply__task_policy_set_t Reply_task_policy_set;
- __Reply__task_policy_get_t Reply_task_policy_get;
- __Reply__task_sample_t Reply_task_sample;
- __Reply__task_policy_t Reply_task_policy;
- __Reply__task_set_emulation_t Reply_task_set_emulation;
- __Reply__task_get_emulation_vector_t Reply_task_get_emulation_vector;
- __Reply__task_set_emulation_vector_t Reply_task_set_emulation_vector;
- __Reply__task_set_ras_pc_t Reply_task_set_ras_pc;
- __Reply__task_zone_info_t Reply_task_zone_info;
- __Reply__task_assign_t Reply_task_assign;
- __Reply__task_assign_default_t Reply_task_assign_default;
- __Reply__task_get_assignment_t Reply_task_get_assignment;
- __Reply__task_set_policy_t Reply_task_set_policy;
- __Reply__task_get_state_t Reply_task_get_state;
- __Reply__task_set_state_t Reply_task_set_state;
- __Reply__task_set_phys_footprint_limit_t Reply_task_set_phys_footprint_limit;
- __Reply__task_suspend2_t Reply_task_suspend2;
- __Reply__task_resume2_t Reply_task_resume2;
- __Reply__task_purgable_info_t Reply_task_purgable_info;
- __Reply__task_get_mach_voucher_t Reply_task_get_mach_voucher;
- __Reply__task_set_mach_voucher_t Reply_task_set_mach_voucher;
- __Reply__task_swap_mach_voucher_t Reply_task_swap_mach_voucher;
- __Reply__task_generate_corpse_t Reply_task_generate_corpse;
- __Reply__task_map_corpse_info_t Reply_task_map_corpse_info;
- __Reply__task_register_dyld_image_infos_t Reply_task_register_dyld_image_infos;
- __Reply__task_unregister_dyld_image_infos_t Reply_task_unregister_dyld_image_infos;
- __Reply__task_get_dyld_image_infos_t Reply_task_get_dyld_image_infos;
- __Reply__task_register_dyld_shared_cache_image_info_t Reply_task_register_dyld_shared_cache_image_info;
- __Reply__task_register_dyld_set_dyld_state_t Reply_task_register_dyld_set_dyld_state;
- __Reply__task_register_dyld_get_process_state_t Reply_task_register_dyld_get_process_state;
- __Reply__task_map_corpse_info_64_t Reply_task_map_corpse_info_64;
- __Reply__task_inspect_t Reply_task_inspect;
- __Reply__task_get_exc_guard_behavior_t Reply_task_get_exc_guard_behavior;
- __Reply__task_set_exc_guard_behavior_t Reply_task_set_exc_guard_behavior;
- __Reply__task_create_suid_cred_t Reply_task_create_suid_cred;
-};
-#endif /* !__RequestUnion__task_subsystem__defined */
-
-#ifndef subsystem_to_name_map_task
-#define subsystem_to_name_map_task \
- { "task_create", 3400 },\
- { "task_terminate", 3401 },\
- { "task_threads", 3402 },\
- { "mach_ports_register", 3403 },\
- { "mach_ports_lookup", 3404 },\
- { "task_info", 3405 },\
- { "task_set_info", 3406 },\
- { "task_suspend", 3407 },\
- { "task_resume", 3408 },\
- { "task_get_special_port", 3409 },\
- { "task_set_special_port", 3410 },\
- { "thread_create", 3411 },\
- { "thread_create_running", 3412 },\
- { "task_set_exception_ports", 3413 },\
- { "task_get_exception_ports", 3414 },\
- { "task_swap_exception_ports", 3415 },\
- { "lock_set_create", 3416 },\
- { "lock_set_destroy", 3417 },\
- { "semaphore_create", 3418 },\
- { "semaphore_destroy", 3419 },\
- { "task_policy_set", 3420 },\
- { "task_policy_get", 3421 },\
- { "task_sample", 3422 },\
- { "task_policy", 3423 },\
- { "task_set_emulation", 3424 },\
- { "task_get_emulation_vector", 3425 },\
- { "task_set_emulation_vector", 3426 },\
- { "task_set_ras_pc", 3427 },\
- { "task_zone_info", 3428 },\
- { "task_assign", 3429 },\
- { "task_assign_default", 3430 },\
- { "task_get_assignment", 3431 },\
- { "task_set_policy", 3432 },\
- { "task_get_state", 3433 },\
- { "task_set_state", 3434 },\
- { "task_set_phys_footprint_limit", 3435 },\
- { "task_suspend2", 3436 },\
- { "task_resume2", 3437 },\
- { "task_purgable_info", 3438 },\
- { "task_get_mach_voucher", 3439 },\
- { "task_set_mach_voucher", 3440 },\
- { "task_swap_mach_voucher", 3441 },\
- { "task_generate_corpse", 3442 },\
- { "task_map_corpse_info", 3443 },\
- { "task_register_dyld_image_infos", 3444 },\
- { "task_unregister_dyld_image_infos", 3445 },\
- { "task_get_dyld_image_infos", 3446 },\
- { "task_register_dyld_shared_cache_image_info", 3447 },\
- { "task_register_dyld_set_dyld_state", 3448 },\
- { "task_register_dyld_get_process_state", 3449 },\
- { "task_map_corpse_info_64", 3450 },\
- { "task_inspect", 3451 },\
- { "task_get_exc_guard_behavior", 3452 },\
- { "task_set_exc_guard_behavior", 3453 },\
- { "task_create_suid_cred", 3454 }
-#endif
-
-#ifdef __AfterMigUserHeader
-__AfterMigUserHeader
-#endif /* __AfterMigUserHeader */
-
-#endif /* _task_user_ */
\ No newline at end of file
diff --git a/lib/libc/include/x86_64-macos-gnu/mach/task_info.h b/lib/libc/include/x86_64-macos-gnu/mach/task_info.h
deleted file mode 100644
index 5b2046a700..0000000000
--- a/lib/libc/include/x86_64-macos-gnu/mach/task_info.h
+++ /dev/null
@@ -1,478 +0,0 @@
-/*
- * Copyright (c) 2000-2007, 2015 Apple Inc. All rights reserved.
- *
- * @APPLE_OSREFERENCE_LICENSE_HEADER_START@
- *
- * This file contains Original Code and/or Modifications of Original Code
- * as defined in and that are subject to the Apple Public Source License
- * Version 2.0 (the 'License'). You may not use this file except in
- * compliance with the License. The rights granted to you under the License
- * may not be used to create, or enable the creation or redistribution of,
- * unlawful or unlicensed copies of an Apple operating system, or to
- * circumvent, violate, or enable the circumvention or violation of, any
- * terms of an Apple operating system software license agreement.
- *
- * Please obtain a copy of the License at
- * http://www.opensource.apple.com/apsl/ and read it before using this file.
- *
- * The Original Code and all software distributed under the License are
- * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
- * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
- * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
- * Please see the License for the specific language governing rights and
- * limitations under the License.
- *
- * @APPLE_OSREFERENCE_LICENSE_HEADER_END@
- */
-/*
- * @OSF_COPYRIGHT@
- */
-/*
- * Mach Operating System
- * Copyright (c) 1991,1990,1989,1988,1987 Carnegie Mellon University
- * All Rights Reserved.
- *
- * Permission to use, copy, modify and distribute this software and its
- * documentation is hereby granted, provided that both the copyright
- * notice and this permission notice appear in all copies of the
- * software, derivative works or modified versions, and any portions
- * thereof, and that both notices appear in supporting documentation.
- *
- * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS"
- * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR
- * ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE.
- *
- * Carnegie Mellon requests users of this software to return to
- *
- * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU
- * School of Computer Science
- * Carnegie Mellon University
- * Pittsburgh PA 15213-3890
- *
- * any improvements or extensions that they make and grant Carnegie Mellon
- * the rights to redistribute these changes.
- */
-/*
- * Machine-independent task information structures and definitions.
- *
- * The definitions in this file are exported to the user. The kernel
- * will translate its internal data structures to these structures
- * as appropriate.
- *
- */
-
-#ifndef _MACH_TASK_INFO_H_
-#define _MACH_TASK_INFO_H_
-
-#include