From 64222fbcbd3ed227e4f9c68e1acccd7e68218982 Mon Sep 17 00:00:00 2001 From: Miklos Szeredi Date: Fri, 27 Aug 2010 17:16:54 +0200 Subject: Add NetBSD support The bulk of it is just about adding ifdef __NetBSD__ where there is already an ifdef __FreeBSD__ Add a arch=netbsd to deal with NetBSD specifics. I suggests that arch=bsd could be renamed to arch=freebsd NetBSD specific linking with -lperfuse NetBSD patches to lib/mount.c. It turned to be less itrusive to patch mount;c than mount_bsd.c. I suggest mount_bsd.c could be renamed to mount_freebsd.c Patch from Emmanuel Dreyfus --- lib/mount.c | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'lib/mount.c') diff --git a/lib/mount.c b/lib/mount.c index c3b16a4..b525da5 100644 --- a/lib/mount.c +++ b/lib/mount.c @@ -17,6 +17,7 @@ #include #include #include +#include #include #include #include @@ -25,6 +26,19 @@ #include #include +#ifdef __NetBSD__ +#include + +#define MS_RDONLY MNT_RDONLY +#define MS_NOSUID MNT_NOSUID +#define MS_NODEV MNT_NODEV +#define MS_NOEXEC MNT_NOEXEC +#define MS_SYNCHRONOUS MNT_SYNCHRONOUS +#define MS_NOATIME MNT_NOATIME + +#define umount2(mnt, flags) unmount(mnt, (flags == 2) ? MNT_FORCE : 0) +#endif + #define FUSERMOUNT_PROG "fusermount" #define FUSE_COMMFD_ENV "_FUSE_COMMFD" @@ -155,7 +169,9 @@ static struct mount_flags mount_flags[] = { {"sync", MS_SYNCHRONOUS, 1}, {"atime", MS_NOATIME, 0}, {"noatime", MS_NOATIME, 1}, +#ifndef __NetBSD__ {"dirsync", MS_DIRSYNC, 1}, +#endif {NULL, 0, 0} }; @@ -484,6 +500,7 @@ static int fuse_mount_sys(const char *mnt, struct mount_opts *mo, goto out_close; } +#ifndef __NetBSD__ if (geteuid() == 0) { char *newmnt = fuse_mnt_resolve_path("fuse", mnt); res = -1; @@ -496,6 +513,7 @@ static int fuse_mount_sys(const char *mnt, struct mount_opts *mo, if (res == -1) goto out_umount; } +#endif /* __NetBSD__ */ free(type); free(source); -- cgit v1.2.3