Skip to content

Commit

Permalink
Update Sources To Use New "<darling/emulation/...>" Path
Browse files Browse the repository at this point in the history
  • Loading branch information
CuriousTommy committed Nov 3, 2024
1 parent 30b2c3c commit ba97388
Show file tree
Hide file tree
Showing 12 changed files with 26 additions and 24 deletions.
6 changes: 3 additions & 3 deletions src/frameworks/CoreServices/src/CarbonCore/FileManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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;

Expand All @@ -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;

Expand Down
2 changes: 1 addition & 1 deletion src/frameworks/CoreServices/src/FSEvents/FSEventsImpl.m
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down
12 changes: 6 additions & 6 deletions src/frameworks/CoreServices/src/FSEvents/fseventsd.m
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand Down Expand Up @@ -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);
}

Expand Down
2 changes: 1 addition & 1 deletion src/xtrace/bsd_trace.cpp
Original file line number Diff line number Diff line change
@@ -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>
Expand Down
2 changes: 1 addition & 1 deletion src/xtrace/lock.h
Original file line number Diff line number Diff line change
@@ -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"
Expand Down
2 changes: 1 addition & 1 deletion src/xtrace/mach_trace.cpp
Original file line number Diff line number Diff line change
@@ -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>
Expand Down
2 changes: 1 addition & 1 deletion src/xtrace/mig_trace.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
2 changes: 1 addition & 1 deletion src/xtrace/posix_spawn_args.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
2 changes: 1 addition & 1 deletion src/xtrace/string.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
#include <assert.h>
#include <cstring>

#include <darling/emulation/simple.h>
#include <darling/emulation/syscall/common/simple.h>

//
// Helper Functions
Expand Down
12 changes: 7 additions & 5 deletions src/xtrace/tls.cpp
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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

Expand Down
4 changes: 2 additions & 2 deletions src/xtrace/xtracelib.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,15 @@
#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"
#include "lock.h"
#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>

Expand Down
2 changes: 1 addition & 1 deletion src/xtrace/xtracelib.h
Original file line number Diff line number Diff line change
@@ -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"
Expand Down

0 comments on commit ba97388

Please sign in to comment.