Skip to content
Commits on Source (3)
...@@ -3,7 +3,7 @@ SYSCALL="getpid" ...@@ -3,7 +3,7 @@ SYSCALL="getpid"
BUILD=../build BUILD=../build
REPEATS=20 REPEATS=20
ARCH="X86" ARCH="$(uname -m 2>/dev/null || echo -n unknown)"
NATIVE="$BUILD/opendevnull --syscall $SYSCALL" NATIVE="$BUILD/opendevnull --syscall $SYSCALL"
INTERC="$BUILD/opendevnull --syscall $SYSCALL" INTERC="$BUILD/opendevnull --syscall $SYSCALL"
...@@ -22,6 +22,7 @@ calculate_stats() { ...@@ -22,6 +22,7 @@ calculate_stats() {
local count=${#values[@]} local count=${#values[@]}
local min=${values[0]} local min=${values[0]}
local max=${values[0]} local max=${values[0]}
local variance=0
# Calculate sum, min, and max # Calculate sum, min, and max
for value in "${values[@]}"; do for value in "${values[@]}"; do
......
...@@ -12,7 +12,12 @@ stop_interception() __attribute__((destructor)); ...@@ -12,7 +12,12 @@ stop_interception() __attribute__((destructor));
int int
hook_openat(int dirfd, const char* cpath, int flags, mode_t mode) { 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); 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 int
......