Loading ifs/include/preload/passthrough.hpp +1 −0 Original line number Diff line number Diff line Loading @@ -86,6 +86,7 @@ extern void* libc_dup; extern void* libc_dup2; extern void* libc_dup3; extern void* libc_dirfd; extern void* libc_opendir; extern void* libc_fdopendir; extern void* libc_readdir; Loading ifs/src/preload/intcp_functions.cpp +15 −0 Original line number Diff line number Diff line Loading @@ -1123,6 +1123,21 @@ inline DIR* fd_to_dirp(const int fd){ return reinterpret_cast<DIR*>(fd); } int dirfd(DIR *dirp) { init_passthrough_if_needed(); if(CTX->initialized()) { if(dirp == nullptr){ errno = EINVAL; return -1; } auto fd = dirp_to_fd(dirp); if(CTX->file_map()->exist(fd)) { return fd; } } return LIBC_FUNC(dirfd, dirp); } DIR* opendir(const char* path){ init_passthrough_if_needed(); if(!CTX->initialized()) { Loading ifs/src/preload/passthrough.cpp +2 −0 Original line number Diff line number Diff line Loading @@ -87,6 +87,7 @@ void* libc_dup; void* libc_dup2; void* libc_dup3; void* libc_dirfd; void* libc_opendir; void* libc_fdopendir; void* libc_readdir; Loading Loading @@ -183,6 +184,7 @@ void init_passthrough_() { libc_dup2 = dlsym(libc, "dup2"); libc_dup3 = dlsym(libc, "dup3"); libc_dirfd = dlsym(libc, "dirfd"); libc_opendir = dlsym(libc, "opendir"); libc_fdopendir = dlsym(libc, "fdopendir"); libc_readdir = dlsym(libc, "readdir"); Loading Loading
ifs/include/preload/passthrough.hpp +1 −0 Original line number Diff line number Diff line Loading @@ -86,6 +86,7 @@ extern void* libc_dup; extern void* libc_dup2; extern void* libc_dup3; extern void* libc_dirfd; extern void* libc_opendir; extern void* libc_fdopendir; extern void* libc_readdir; Loading
ifs/src/preload/intcp_functions.cpp +15 −0 Original line number Diff line number Diff line Loading @@ -1123,6 +1123,21 @@ inline DIR* fd_to_dirp(const int fd){ return reinterpret_cast<DIR*>(fd); } int dirfd(DIR *dirp) { init_passthrough_if_needed(); if(CTX->initialized()) { if(dirp == nullptr){ errno = EINVAL; return -1; } auto fd = dirp_to_fd(dirp); if(CTX->file_map()->exist(fd)) { return fd; } } return LIBC_FUNC(dirfd, dirp); } DIR* opendir(const char* path){ init_passthrough_if_needed(); if(!CTX->initialized()) { Loading
ifs/src/preload/passthrough.cpp +2 −0 Original line number Diff line number Diff line Loading @@ -87,6 +87,7 @@ void* libc_dup; void* libc_dup2; void* libc_dup3; void* libc_dirfd; void* libc_opendir; void* libc_fdopendir; void* libc_readdir; Loading Loading @@ -183,6 +184,7 @@ void init_passthrough_() { libc_dup2 = dlsym(libc, "dup2"); libc_dup3 = dlsym(libc, "dup3"); libc_dirfd = dlsym(libc, "dirfd"); libc_opendir = dlsym(libc, "opendir"); libc_fdopendir = dlsym(libc, "fdopendir"); libc_readdir = dlsym(libc, "readdir"); Loading