From c7fab4d88130beb67d9dbfdcbebb132295646656 Mon Sep 17 00:00:00 2001 From: Aurelien Jarno Date: Fri, 13 May 2022 23:03:04 +0800 Subject: [PATCH] GNU/kFreeBSD support Gbp-Pq: Name 0002-kfreebsd.patch --- include/fuse_common.h | 2 +- include/fuse_compat.h | 2 +- include/fuse_lowlevel_compat.h | 2 +- lib/fuse.c | 6 +++--- lib/fuse_lowlevel.c | 2 +- lib/fuse_session.c | 2 +- lib/helper.c | 2 +- 7 files changed, 9 insertions(+), 9 deletions(-) diff --git a/include/fuse_common.h b/include/fuse_common.h index a4d980d..1cc1158 100644 --- a/include/fuse_common.h +++ b/include/fuse_common.h @@ -469,7 +469,7 @@ void fuse_remove_signal_handlers(struct fuse_session *se); * ----------------------------------------------------------- */ #if FUSE_USE_VERSION < 26 -# ifdef __FreeBSD__ +# if defined(__FreeBSD__) || defined(__FreeBSD_kernel__) # if FUSE_USE_VERSION < 25 # error On FreeBSD API version 25 or greater must be used # endif diff --git a/include/fuse_compat.h b/include/fuse_compat.h index e7497a9..3dd5708 100644 --- a/include/fuse_compat.h +++ b/include/fuse_compat.h @@ -65,7 +65,7 @@ struct fuse *fuse_setup_compat25(int argc, char *argv[], void fuse_teardown_compat22(struct fuse *fuse, int fd, char *mountpoint); -#if !defined(__FreeBSD__) && !defined(__NetBSD__) +#if !defined(__FreeBSD__) && !defined(__FreeBSD_kernel__) && !defined(__NetBSD__) #include struct fuse_operations_compat22 { diff --git a/include/fuse_lowlevel_compat.h b/include/fuse_lowlevel_compat.h index 8de220b..b32ccfa 100644 --- a/include/fuse_lowlevel_compat.h +++ b/include/fuse_lowlevel_compat.h @@ -72,7 +72,7 @@ size_t fuse_dirent_size(size_t namelen); char *fuse_add_dirent(char *buf, const char *name, const struct stat *stbuf, off_t off); -#if !defined(__FreeBSD__) && !defined(__NetBSD__) +#if !defined(__FreeBSD__) && !defined(__FreeBSD_kernel__) && !defined(__NetBSD__) #include diff --git a/lib/fuse.c b/lib/fuse.c index d1d873a..885c9ce 100644 --- a/lib/fuse.c +++ b/lib/fuse.c @@ -1522,7 +1522,7 @@ static inline void fuse_prepare_interrupt(struct fuse *f, fuse_req_t req, fuse_do_prepare_interrupt(req, d); } -#if !defined(__FreeBSD__) && !defined(__NetBSD__) +#if !defined(__FreeBSD__) && !defined(__FreeBSD_kernel__) && !defined(__NetBSD__) static int fuse_compat_open(struct fuse_fs *fs, const char *path, struct fuse_file_info *fi) @@ -4729,7 +4729,7 @@ struct fuse *fuse_new_common(struct fuse_chan *ch, struct fuse_args *args, if (!f->conf.ac_attr_timeout_set) f->conf.ac_attr_timeout = f->conf.attr_timeout; -#if defined(__FreeBSD__) || defined(__NetBSD__) +#if defined(__FreeBSD__) || defined(__FreeBSD_kernel__) || defined(__NetBSD__) /* * In FreeBSD, we always use these settings as inode numbers * are needed to make getcwd(3) work. @@ -4898,7 +4898,7 @@ void fuse_register_module(struct fuse_module *mod) fuse_modules = mod; } -#if !defined(__FreeBSD__) && !defined(__NetBSD__) +#if !defined(__FreeBSD__) && !defined(__FreeBSD_kernel__) && !defined(__NetBSD__) static struct fuse *fuse_new_common_compat(int fd, const char *opts, const struct fuse_operations *op, diff --git a/lib/fuse_lowlevel.c b/lib/fuse_lowlevel.c index ff03c63..e6ed943 100644 --- a/lib/fuse_lowlevel.c +++ b/lib/fuse_lowlevel.c @@ -2842,7 +2842,7 @@ int fuse_req_getgroups(fuse_req_t req, int size, gid_t list[]) } #endif -#if !defined(__FreeBSD__) && !defined(__NetBSD__) +#if !defined(__FreeBSD__) && !defined(__FreeBSD_kernel__) && !defined(__NetBSD__) static void fill_open_compat(struct fuse_open_out *arg, const struct fuse_file_info_compat *f) diff --git a/lib/fuse_session.c b/lib/fuse_session.c index 6e11068..953923c 100644 --- a/lib/fuse_session.c +++ b/lib/fuse_session.c @@ -235,6 +235,6 @@ void fuse_chan_destroy(struct fuse_chan *ch) free(ch); } -#ifndef __FreeBSD__ +#if !defined(__FreeBSD__) && !defined(__FreeBSD_kernel__) FUSE_SYMVER(".symver fuse_chan_new_compat24,fuse_chan_new@FUSE_2.4"); #endif diff --git a/lib/helper.c b/lib/helper.c index 49d30f9..6743a0b 100644 --- a/lib/helper.c +++ b/lib/helper.c @@ -398,7 +398,7 @@ int fuse_version(void) #include "fuse_compat.h" -#if !defined(__FreeBSD__) && !defined(__NetBSD__) +#if !defined(__FreeBSD__) && !defined(__FreeBSD_kernel__) && !defined(__NetBSD__) struct fuse *fuse_setup_compat22(int argc, char *argv[], const struct fuse_operations_compat22 *op,