diff options
author | CismonX <admin@cismon.net> | 2025-07-09 23:30:17 +0800 |
---|---|---|
committer | Bernd Schubert <bernd@bsbernd.com> | 2025-07-13 15:22:29 +0200 |
commit | 21a27e371fbb44e16eec6ef5e18768b476db2e27 (patch) | |
tree | 359a4efefa9ca12f9034b794bfbfd4728364470d /example/passthrough_helpers.h | |
parent | db5a1b6ae9d39614154590e5b8c62702a5230ca4 (diff) | |
download | libfuse-21a27e371fbb44e16eec6ef5e18768b476db2e27.tar.gz |
example/passthrough: tidy up passthrough_helpers.h
Add header guards, include system headers as needed, and declare
helper functions as inline.
This ensures that the helper header could be properly included.
Signed-off-by: CismonX <admin@cismon.net>
Diffstat (limited to 'example/passthrough_helpers.h')
-rw-r--r-- | example/passthrough_helpers.h | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/example/passthrough_helpers.h b/example/passthrough_helpers.h index aca796a..52958c6 100644 --- a/example/passthrough_helpers.h +++ b/example/passthrough_helpers.h @@ -23,6 +23,20 @@ * SUCH DAMAGE */ +#ifndef FUSE_EXAMPLE_PASSTHROUGH_HELPERS_H_ +#define FUSE_EXAMPLE_PASSTHROUGH_HELPERS_H_ + +#include <errno.h> +#include <fcntl.h> +#include <string.h> +#include <sys/stat.h> +#include <unistd.h> + +#ifdef __FreeBSD__ +#include <sys/socket.h> +#include <sys/un.h> +#endif + static inline int do_fallocate(int fd, int mode, off_t offset, off_t length) { #ifdef HAVE_FALLOCATE @@ -44,7 +58,7 @@ static inline int do_fallocate(int fd, int mode, off_t offset, off_t length) * Creates files on the underlying file system in response to a FUSE_MKNOD * operation */ -static int mknod_wrapper(int dirfd, const char *path, const char *link, +static inline int mknod_wrapper(int dirfd, const char *path, const char *link, int mode, dev_t rdev) { int res; @@ -91,3 +105,5 @@ static int mknod_wrapper(int dirfd, const char *path, const char *link, return res; } + +#endif // FUSE_PASSTHROUGH_HELPERS_H_ |