2 * Copyright (C) 2020 Jérémie Galarneau <jeremie.galarneau@efficios.com>
4 * SPDX-License-Identifier: LGPL-2.1-only
8 #include <common/fs-handle-internal.h>
9 #include <common/fs-handle.h>
10 #include <common/readwrite.h>
13 int fs_handle_get_fd(struct fs_handle
*handle
)
15 return handle
->get_fd(handle
);
19 void fs_handle_put_fd(struct fs_handle
*handle
)
21 return handle
->put_fd(handle
);
25 int fs_handle_unlink(struct fs_handle
*handle
)
27 return handle
->unlink(handle
);
31 int fs_handle_close(struct fs_handle
*handle
)
33 return handle
->close(handle
);
37 ssize_t
fs_handle_read(struct fs_handle
*handle
, void *buf
, size_t count
)
40 const int fd
= fs_handle_get_fd(handle
);
47 ret
= lttng_read(fd
, buf
, count
);
48 fs_handle_put_fd(handle
);
54 ssize_t
fs_handle_write(struct fs_handle
*handle
, const void *buf
, size_t count
)
57 const int fd
= fs_handle_get_fd(handle
);
64 ret
= lttng_write(fd
, buf
, count
);
65 fs_handle_put_fd(handle
);
71 int fs_handle_truncate(struct fs_handle
*handle
, off_t offset
)
74 const int fd
= fs_handle_get_fd(handle
);
81 ret
= ftruncate(fd
, offset
);
82 fs_handle_put_fd(handle
);
88 off_t
fs_handle_seek(struct fs_handle
*handle
, off_t offset
, int whence
)
91 const int fd
= fs_handle_get_fd(handle
);
98 ret
= lseek(fd
, offset
, whence
);
99 fs_handle_put_fd(handle
);
This page took 0.031274 seconds and 4 git commands to generate.