2012-05-15 13:41:57 +05:30
/*
FUSE : Filesystem in Userspace
Copyright ( C ) 2001 - 2007 Miklos Szeredi < miklos @ szeredi . hu >
Copyright ( c ) 2010 Gluster , Inc . < http : //www.gluster.com>
This program can be distributed under the terms of the GNU LGPLv2 .
See the file COPYING . LIB .
*/
# ifndef _CONFIG_H
# define _CONFIG_H
# include "config.h"
# endif
# include <stdio.h>
# include <stdlib.h>
# include <unistd.h>
# include <stddef.h>
# include <limits.h>
# include <fcntl.h>
# include <errno.h>
# include <dirent.h>
# include <signal.h>
2014-06-21 02:00:23 -07:00
# if defined(GF_LINUX_HOST_OS)
2012-05-15 13:41:57 +05:30
# include <mntent.h>
2014-06-21 02:00:23 -07:00
# endif /* GF_LINUX_HOST_OS */
2012-05-15 13:41:57 +05:30
# include <sys/stat.h>
# include <sys/poll.h>
# include <sys/un.h>
# include <sys/wait.h>
# include <sys/mount.h>
2014-06-21 02:00:23 -07:00
# if defined(__NetBSD__)
2012-05-15 13:41:57 +05:30
# include <perfuse.h>
# define umount2(dir, flags) unmount(dir, ((flags) != 0) ? MNT_FORCE : 0)
2012-12-12 12:05:32 +01:00
# define MS_RDONLY MNT_RDONLY
2012-05-15 13:41:57 +05:30
# endif
2014-06-21 02:00:23 -07:00
# if defined(GF_DARWIN_HOST_OS) || defined(__FreeBSD__)
2014-04-17 15:54:34 -07:00
# include <sys/param.h>
# include <sys/mount.h>
# define umount2(dir, flags) unmount(dir, ((flags) != 0) ? MNT_FORCE : 0)
# define MS_RDONLY MNT_RDONLY
# endif
# ifdef GF_LINUX_HOST_OS
2012-05-15 13:41:57 +05:30
# define _PATH_MOUNT " / bin / mount"
2014-06-21 02:00:23 -07:00
# else /* FreeBSD, NetBSD, MacOS X */
2012-05-15 13:41:57 +05:30
# define _PATH_MOUNT " / sbin / mount"
# endif
# ifdef FUSE_UTIL
# define MALLOC(size) malloc (size)
# define FREE(ptr) free (ptr)
# define GFFUSE_LOGERR(...) fprintf (stderr, ## __VA_ARGS__)
# else /* FUSE_UTIL */
# include "glusterfs.h"
# include "logging.h"
# include "common-utils.h"
# define GFFUSE_LOGERR(...) \
gf_log ( " glusterfs-fuse " , GF_LOG_ERROR , # # __VA_ARGS__ )
# endif /* !FUSE_UTIL */