Commits on Source (2)
...@@ -22,3 +22,6 @@ ...@@ -22,3 +22,6 @@
[submodule "external/CLI11"] [submodule "external/CLI11"]
path = external/CLI11 path = external/CLI11
url = https://github.com/CLIUtils/CLI11.git url = https://github.com/CLIUtils/CLI11.git
[submodule "external/GSL"]
path = external/GSL
url = https://github.com/microsoft/GSL
...@@ -247,6 +247,13 @@ include_from_source(cli11 ...@@ -247,6 +247,13 @@ include_from_source(cli11
GIT_TAG v2.2.0 GIT_TAG v2.2.0
) )
### GSL: Guidelines Support Library
include_from_source(gsl
MESSAGE "[${PROJECT_NAME}] Searching for GSL"
SOURCE_DIR ${GKFS_DEPENDENCIES_PATH}/GSL
GIT_REPOSITORY https://github.com/microsoft/GSL
GIT_TAG v4.0.0
)
################################################################################ ################################################################################
## Check configured variables/options and act accordingly ## Check configured variables/options and act accordingly
......
Subproject commit a3534567187d2edc428efd3f13466ff75fe5805c
...@@ -62,6 +62,7 @@ target_link_libraries( ...@@ -62,6 +62,7 @@ target_link_libraries(
fmt::fmt fmt::fmt
Threads::Threads Threads::Threads
Date::TZ Date::TZ
Microsoft.GSL::GSL
) )
install( install(
...@@ -113,6 +114,7 @@ if(GKFS_ENABLE_FORWARDING) ...@@ -113,6 +114,7 @@ if(GKFS_ENABLE_FORWARDING)
fmt::fmt fmt::fmt
Threads::Threads Threads::Threads
Date::TZ Date::TZ
Microsoft.GSL::GSL
) )
install( install(
......
...@@ -36,6 +36,7 @@ ...@@ -36,6 +36,7 @@
#include <client/open_dir.hpp> #include <client/open_dir.hpp>
#include <common/path_util.hpp> #include <common/path_util.hpp>
#include <gsl/gsl>
#include <memory> #include <memory>
...@@ -246,7 +247,7 @@ hook_pread(unsigned int fd, char* buf, size_t count, loff_t pos) { ...@@ -246,7 +247,7 @@ hook_pread(unsigned int fd, char* buf, size_t count, loff_t pos) {
} }
/* Since kernel 2.6: pread() became pread64(), and pwrite() became /* Since kernel 2.6: pread() became pread64(), and pwrite() became
* pwrite64(). */ * pwrite64(). */
return syscall_no_intercept_wrapper(SYS_pread64, fd, buf, count, pos); return gsl::narrow<int>(syscall_no_intercept_wrapper(SYS_pread64, fd, buf, count, pos));
} }
int int
...@@ -300,7 +301,7 @@ hook_pwrite(unsigned int fd, const char* buf, size_t count, loff_t pos) { ...@@ -300,7 +301,7 @@ hook_pwrite(unsigned int fd, const char* buf, size_t count, loff_t pos) {
} }
/* Since kernel 2.6: pread() became pread64(), and pwrite() became /* Since kernel 2.6: pread() became pread64(), and pwrite() became
* pwrite64(). */ * pwrite64(). */
return syscall_no_intercept_wrapper(SYS_pwrite64, fd, buf, count, pos); return gsl::narrow<int>(syscall_no_intercept_wrapper(SYS_pwrite64, fd, buf, count, pos));
} }
int int
...@@ -602,7 +603,7 @@ hook_getdents64(unsigned int fd, struct linux_dirent64* dirp, ...@@ -602,7 +603,7 @@ hook_getdents64(unsigned int fd, struct linux_dirent64* dirp,
if(CTX->file_map()->exist(fd)) { if(CTX->file_map()->exist(fd)) {
return with_errno(gkfs::syscall::gkfs_getdents64(fd, dirp, count)); return with_errno(gkfs::syscall::gkfs_getdents64(fd, dirp, count));
} }
return syscall_no_intercept_wrapper(SYS_getdents64, fd, dirp, count); return gsl::narrow<int>(syscall_no_intercept_wrapper(SYS_getdents64, fd, dirp, count));
} }
......