Unverified Commit 908dbbfe authored by PETAR ANDRIC's avatar PETAR ANDRIC
Browse files

Detect architecture

parent 170add97
Loading
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -3,7 +3,7 @@ SYSCALL="getpid"
BUILD=../build

REPEATS=20
ARCH="X86"
ARCH="$(uname -m 2>/dev/null || echo -n unknown)"

NATIVE="$BUILD/opendevnull --syscall $SYSCALL"
INTERC="$BUILD/opendevnull --syscall $SYSCALL"
+5 −0
Original line number Diff line number Diff line
@@ -12,7 +12,12 @@ stop_interception() __attribute__((destructor));
int
hook_openat(int dirfd, const char* cpath, int flags, mode_t mode) {

#if defined(__x86_64) || defined(__x86_64__)
    return syscall_no_intercept(SYS_openat, dirfd, cpath, flags, mode);
#elif defined(__riscv) || defined(__riscv__)
    wrapper_ret ret = syscall_no_intercept(SYS_openat, dirfd, cpath, flags, mode);
    return (int)ret.a0;
#endif
}

int