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>
12 int fs_handle_get_fd(struct fs_handle
*handle
)
14 return handle
->get_fd(handle
);
17 void fs_handle_put_fd(struct fs_handle
*handle
)
19 return handle
->put_fd(handle
);
22 int fs_handle_unlink(struct fs_handle
*handle
)
24 return handle
->unlink(handle
);
27 int fs_handle_close(struct fs_handle
*handle
)
29 return handle
->close(handle
);
32 ssize_t
fs_handle_read(struct fs_handle
*handle
, void *buf
, size_t count
)
35 const int fd
= fs_handle_get_fd(handle
);
42 ret
= lttng_read(fd
, buf
, count
);
43 fs_handle_put_fd(handle
);
48 ssize_t
fs_handle_write(struct fs_handle
*handle
, const void *buf
, size_t count
)
51 const int fd
= fs_handle_get_fd(handle
);
58 ret
= lttng_write(fd
, buf
, count
);
59 fs_handle_put_fd(handle
);
64 int fs_handle_truncate(struct fs_handle
*handle
, off_t offset
)
67 const int fd
= fs_handle_get_fd(handle
);
74 ret
= ftruncate(fd
, offset
);
75 fs_handle_put_fd(handle
);
80 off_t
fs_handle_seek(struct fs_handle
*handle
, off_t offset
, int whence
)
83 const int fd
= fs_handle_get_fd(handle
);
90 ret
= lseek(fd
, offset
, whence
);
91 fs_handle_put_fd(handle
);
This page took 0.031193 seconds and 4 git commands to generate.