Skip to content
GitLab
Projects
Groups
Topics
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
hpc
gekkofs
Compare revisions
0916c55578dc76a119c3125424cb1d176f4943c3 to 6d891dfe016a072e35d354c578e98dcd3afa5f9a
Commits on Source (2)
add submodule GSL v4.0.0.0
· a7aba378
Julius Athenstaedt
authored
Feb 19, 2024
a7aba378
use GSL to narrow down syscalls in hooks.cpp
· 6d891dfe
Julius Athenstaedt
authored
Feb 19, 2024
6d891dfe
Hide whitespace changes
Inline
Side-by-side
.gitmodules
View file @
6d891dfe
...
@@ -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
CMakeLists.txt
View file @
6d891dfe
...
@@ -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
...
...
GSL
@
a3534567
Subproject commit a3534567187d2edc428efd3f13466ff75fe5805c
src/client/CMakeLists.txt
View file @
6d891dfe
...
@@ -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
(
...
...
src/client/hooks.cpp
View file @
6d891dfe
...
@@ -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
)
)
;
}
}
...
...