From ba9738809e84190ecaf607300605a1c9660411f6 Mon Sep 17 00:00:00 2001 From: "Thomas A." <curioustommy@protonmail.com> Date: Sat, 14 Sep 2024 13:39:41 -0700 Subject: [PATCH] Update Sources To Use New "<darling/emulation/...>" Path --- .../CoreServices/src/CarbonCore/FileManager.cpp | 6 +++--- .../CoreServices/src/FSEvents/FSEventsImpl.m | 2 +- src/frameworks/CoreServices/src/FSEvents/fseventsd.m | 12 ++++++------ src/xtrace/bsd_trace.cpp | 2 +- src/xtrace/lock.h | 2 +- src/xtrace/mach_trace.cpp | 2 +- src/xtrace/mig_trace.cpp | 2 +- src/xtrace/posix_spawn_args.cpp | 2 +- src/xtrace/string.cpp | 2 +- src/xtrace/tls.cpp | 12 +++++++----- src/xtrace/xtracelib.cpp | 4 ++-- src/xtrace/xtracelib.h | 2 +- 12 files changed, 26 insertions(+), 24 deletions(-) diff --git a/src/frameworks/CoreServices/src/CarbonCore/FileManager.cpp b/src/frameworks/CoreServices/src/CarbonCore/FileManager.cpp index 3746cd7eff..4c5d522b33 100644 --- a/src/frameworks/CoreServices/src/CarbonCore/FileManager.cpp +++ b/src/frameworks/CoreServices/src/CarbonCore/FileManager.cpp @@ -38,7 +38,7 @@ along with Darling. If not, see <http://www.gnu.org/licenses/>. #include <vector> #include <CarbonCore/DateTimeUtils.h> #include <errno.h> -#include <ext/file_handle.h> +#include <darling/emulation/syscall/linux/ext/file_handle.h> #define STUB() // TODO @@ -59,7 +59,7 @@ OSStatus FSPathMakeRefWithOptions(const uint8_t* path, long options, FSRef* fsre if (options & kFSPathMakeRefDoNotFollowLeafSymlink) flags = 0; - int err = sys_name_to_handle((const char*) path, (RefData*) fsref, flags); + int err = linux_name_to_handle((const char*) path, (RefData*) fsref, flags); if (err != 0) return fnfErr; @@ -84,7 +84,7 @@ OSStatus FSPathMakeRefWithOptions(const uint8_t* path, long options, FSRef* fsre bool FSRefMakePath(const FSRef* fsref, std::string& out) { char name[4096]; - int ret = sys_handle_to_name((RefData*) fsref, name); + int ret = linux_handle_to_name((RefData*) fsref, name); if (ret != 0) return false; diff --git a/src/frameworks/CoreServices/src/FSEvents/FSEventsImpl.m b/src/frameworks/CoreServices/src/FSEvents/FSEventsImpl.m index b11778690f..5bd0e02cf7 100644 --- a/src/frameworks/CoreServices/src/FSEvents/FSEventsImpl.m +++ b/src/frameworks/CoreServices/src/FSEvents/FSEventsImpl.m @@ -23,7 +23,7 @@ #include <stdlib.h> #include <errno.h> #include <string.h> -#include <ext/sys/inotify.h> +#include <darling/emulation/syscall/linux/ext/sys/inotify.h> static dispatch_queue_t g_fsEventsQueue = NULL; diff --git a/src/frameworks/CoreServices/src/FSEvents/fseventsd.m b/src/frameworks/CoreServices/src/FSEvents/fseventsd.m index dc3fd5e6a8..294d5ad886 100644 --- a/src/frameworks/CoreServices/src/FSEvents/fseventsd.m +++ b/src/frameworks/CoreServices/src/FSEvents/fseventsd.m @@ -22,8 +22,8 @@ #include <stdio.h> #include <string.h> #include <stdlib.h> -#include <ext/fanotify.h> -#include <ext/file_handle.h> +#include <darling/emulation/syscall/linux/ext/fanotify.h> +#include <darling/emulation/syscall/linux/ext/file_handle.h> #include "./linux/fanotify.h" #include <dispatch/dispatch.h> #include <CoreServices/FileManager.h> @@ -139,18 +139,18 @@ void setupFANotify(void) { // FAN_REPORT_FID = provide file handles // Linux file handle = FSRef in Darling - g_fanotify = fanotify_init(FAN_REPORT_FID, 0); + g_fanotify = linux_fanotify_init(FAN_REPORT_FID, 0); if (g_fanotify == -1) { - perror("fanotify_init"); + perror("linux_fanotify_init"); exit(EXIT_FAILURE); } - int rv = fanotify_mark(g_fanotify, FAN_MARK_ADD | FAN_MARK_FILESYSTEM, + int rv = linux_fanotify_mark(g_fanotify, FAN_MARK_ADD | FAN_MARK_FILESYSTEM, FAN_CREATE | FAN_DELETE | FAN_MOVED_FROM | FAN_MOVED_TO | FAN_MODIFY | FAN_ONDIR, AT_FDCWD, "/"); if (rv == -1) { - perror("fanotify_mark"); + perror("linux_fanotify_mark"); exit(EXIT_FAILURE); } diff --git a/src/xtrace/bsd_trace.cpp b/src/xtrace/bsd_trace.cpp index 4c099a5dea..7513fd5a0e 100644 --- a/src/xtrace/bsd_trace.cpp +++ b/src/xtrace/bsd_trace.cpp @@ -1,4 +1,4 @@ -#include <darling/emulation/simple.h> +#include <darling/emulation/syscall/common/simple.h> #include <unistd.h> #include <fcntl.h> #include <sys/mman.h> diff --git a/src/xtrace/lock.h b/src/xtrace/lock.h index e69e1165b5..fb316eac76 100644 --- a/src/xtrace/lock.h +++ b/src/xtrace/lock.h @@ -1,7 +1,7 @@ #ifndef _XTRACE_LOCK_H_ #define _XTRACE_LOCK_H_ -#include <darling/emulation/ext/futex.h> +#include <darling/emulation/syscall/linux/ext/futex.h> #include <stdint.h> #include "base.h" diff --git a/src/xtrace/mach_trace.cpp b/src/xtrace/mach_trace.cpp index b00fe57816..52281a3545 100644 --- a/src/xtrace/mach_trace.cpp +++ b/src/xtrace/mach_trace.cpp @@ -1,4 +1,4 @@ -#include <darling/emulation/simple.h> +#include <darling/emulation/syscall/common/simple.h> #include <unistd.h> #include <dlfcn.h> #include <mach/message.h> diff --git a/src/xtrace/mig_trace.cpp b/src/xtrace/mig_trace.cpp index a3cfcf4d72..66aea81c5e 100644 --- a/src/xtrace/mig_trace.cpp +++ b/src/xtrace/mig_trace.cpp @@ -8,7 +8,7 @@ #include <mach/mach.h> -#include <darling/emulation/simple.h> +#include <darling/emulation/syscall/common/simple.h> #include "xtracelib.h" #include "mach_trace.h" #include "bsd_trace.h" diff --git a/src/xtrace/posix_spawn_args.cpp b/src/xtrace/posix_spawn_args.cpp index e8ea37c443..e2276b8bc8 100644 --- a/src/xtrace/posix_spawn_args.cpp +++ b/src/xtrace/posix_spawn_args.cpp @@ -7,7 +7,7 @@ #include <sys/spawn_internal.h> #include <spawn_private.h> -#include <darling/emulation/simple.h> +#include <darling/emulation/syscall/common/simple.h> #include "bsd_trace.h" #include "xtracelib.h" diff --git a/src/xtrace/string.cpp b/src/xtrace/string.cpp index 48c48306a6..dbfd95c8e8 100644 --- a/src/xtrace/string.cpp +++ b/src/xtrace/string.cpp @@ -4,7 +4,7 @@ #include <assert.h> #include <cstring> -#include <darling/emulation/simple.h> +#include <darling/emulation/syscall/common/simple.h> // // Helper Functions diff --git a/src/xtrace/tls.cpp b/src/xtrace/tls.cpp index 1ccfd97c99..440a4453a0 100644 --- a/src/xtrace/tls.cpp +++ b/src/xtrace/tls.cpp @@ -1,12 +1,14 @@ -#include <stdlib.h> -#include <darling/emulation/ext/for-xtrace.h> #include "tls.h" #include "memory.h" #include "lock.h" -#include <darling/emulation/simple.h> -#include <pthread/tsd_private.h> #include "xtracelib.h" +#include <stdlib.h> +#include <pthread/tsd_private.h> + +#include <darling/emulation/syscall/common/trace/xtrace_api.h> +#include <darling/emulation/syscall/common/simple.h> + #ifndef XTRACE_TLS_DEBUG #define XTRACE_TLS_DEBUG 0 #endif @@ -30,7 +32,7 @@ struct tls_table { // we have to use a slightly hackier technique: using one of the system's reserved but unused TLS keys; we use one from the range we currently reserve // for Darling. -#include <darling/emulation/tsd.h> +#include <darling/emulation/syscall/common/darling_tsd.h> // TODO: also perform TLS cleanup for other threads when doing a fork diff --git a/src/xtrace/xtracelib.cpp b/src/xtrace/xtracelib.cpp index 43a8b582c4..c1a42bcac7 100644 --- a/src/xtrace/xtracelib.cpp +++ b/src/xtrace/xtracelib.cpp @@ -4,7 +4,7 @@ #include <stdlib.h> #include <pthread.h> #include <string.h> -#include <darling/emulation/simple.h> +#include <darling/emulation/syscall/common/simple.h> #include "xtracelib.h" #include "mig_trace.h" #include "tls.h" @@ -12,7 +12,7 @@ #include "memory.h" #include <limits.h> -#include <darling/emulation/ext/for-xtrace.h> +#include <darling/emulation/syscall/common/trace/xtrace_api.h> #include <fcntl.h> #include <signal.h> diff --git a/src/xtrace/xtracelib.h b/src/xtrace/xtracelib.h index fc3277e613..1da0f287d5 100644 --- a/src/xtrace/xtracelib.h +++ b/src/xtrace/xtracelib.h @@ -1,7 +1,7 @@ #ifndef _XTRACELIB_H_ #define _XTRACELIB_H_ #include <stdint.h> -#include <darling/emulation/simple.h> +#include <darling/emulation/syscall/common/simple.h> #include "base.h" #include "string.h"