Verified Commit a15c37ea authored by Tommaso Tocci's avatar Tommaso Tocci
Browse files

syscall_intercept

parent 796aab52
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -36,6 +36,8 @@ RUN yum -y -q update && yum -y -q install \
	libzstd-devel \
	lz4-devel \
	bzip2-devel \
	# syscall_intercept dependencies
	capstone-devel \
	# ada-fs requires C++ 14
	devtoolset-7-gcc \
	devtoolset-7-gcc-c++ \
@@ -90,6 +92,8 @@ RUN yum -y -q update && yum -y -q install \
	libzstd-devel \
	lz4-devel \
	bzip2-devel \
	# syscall_intercept dependencies
	capstone-devel \
	# ada-fs requires C++ 14
	devtoolset-7-gcc \
	devtoolset-7-gcc-c++ \
+41 −0
Original line number Diff line number Diff line
find_package(PkgConfig)
pkg_check_modules(PC_Syscall_intercept QUIET libsyscall_intercept)

find_path(Syscall_intercept_INCLUDE_DIR
  NAMES libsyscall_intercept_hook_point.h
  PATHS ${PC_Syscall_intercept_INCLUDE_DIRS}
)

find_library(Syscall_intercept_LIBRARY
  NAMES syscall_intercept
  PATHS ${PC_Syscall_intercept_LIBRARY_DIRS}
)

include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(
	Syscall_intercept
	DEFAULT_MSG
	Syscall_intercept_INCLUDE_DIR
	Syscall_intercept_LIBRARY
)

if(Syscall_intercept_FOUND)
  set(Syscall_intercept_LIBRARIES ${Syscall_intercept_LIBRARY})
  set(Syscall_intercept_INCLUDE_DIRS ${Syscall_intercept_INCLUDE_DIR})
  set(Syscall_intercept_DEFINITIONS ${PC_Syscall_intercept_CFLAGS_OTHER})

  if(NOT TARGET Syscall_intercept::Syscall_intercept)
	  add_library(Syscall_intercept::Syscall_intercept UNKNOWN IMPORTED)
	  set_target_properties(Syscall_intercept::Syscall_intercept PROPERTIES
		IMPORTED_LOCATION "${Syscall_intercept_LIBRARY}"
		INTERFACE_COMPILE_OPTIONS "${PC_Syscall_intercept_CFLAGS_OTHER}"
		INTERFACE_INCLUDE_DIRECTORIES "${Syscall_intercept_INCLUDE_DIR}"
	  )
	endif()
endif()


mark_as_advanced(
	Syscall_intercept_INCLUDE_DIR
	Syscall_intercept_LIBRARY
)
+1 −0
Original line number Diff line number Diff line
@@ -43,6 +43,7 @@ find_package(RocksDB REQUIRED)
find_package(Mercury REQUIRED)
find_package(Abt REQUIRED)
find_package(Margo REQUIRED)
find_package(Syscall_intercept REQUIRED)

# boost dependencies, system is required for filesystem
find_package(Boost 1.53 REQUIRED
+9 −0
Original line number Diff line number Diff line
#ifndef IFS_HOOKS_HPP
#define IFS_HOOKS_HPP

#include <fcntl.h>


int hook_openat(int dirfd, const char *cpath, int flags, mode_t mode);

#endif
+13 −0
Original line number Diff line number Diff line
#ifndef IFS_INTERCEPT_HPP
#define IFS_INTERCEPT_HPP

int
hook_guard_wrapper(long syscall_number,
                   long arg0, long arg1, long arg2,
                   long arg3, long arg4, long arg5,
                   long *syscall_return_value);

void start_interception();
void stop_interception();

#endif
Loading