Commit 95147a1f authored by Marc Vef's avatar Marc Vef Committed by sevenuz
Browse files

Review

parent 55f37b2e
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -100,7 +100,7 @@ hook_read(unsigned int fd, void* buf, size_t count);
ssize_t
hook_pread(unsigned int fd, char* buf, size_t count, loff_t pos);

int
ssize_t
hook_readv(unsigned long fd, const struct iovec* iov, unsigned long iovcnt);

ssize_t
+7 −7
Original line number Diff line number Diff line
@@ -36,22 +36,24 @@
#include <client/open_dir.hpp>

#include <common/path_util.hpp>
#include <gsl/gsl>

#include <string>

#include <gsl/util>
#include <memory>

extern "C" {
#include <fcntl.h>
#include <sys/stat.h>
#include <sys/statfs.h>
#include <sys/syscall.h>
}

namespace {

// TODO replace all internal gkfs errno variable usage with LEAF
inline int
with_errno(int ret) {
template <typename T>
inline T
with_errno(T ret) {
    return (ret < 0) ? -errno : ret;
}

@@ -149,8 +151,6 @@ hook_statx(int dirfd, const char* path, int flags, unsigned int mask,
            LOG(ERROR, "{}() relativize status unknown: {}", __func__);
            return -EINVAL;
    }

    return syscall_no_intercept(SYS_statx, dirfd, path, flags, mask, buf);
}

#endif
@@ -247,7 +247,7 @@ hook_pread(unsigned int fd, char* buf, size_t count, loff_t pos) {
    return syscall_no_intercept_wrapper(SYS_pread64, fd, buf, count, pos);
}

int
ssize_t
hook_readv(unsigned long fd, const struct iovec* iov, unsigned long iovcnt) {

    LOG(DEBUG, "{}() called with fd: {}, iov: {}, iovcnt: {}", __func__, fd,