#include "perl.h"
#include "XSUB.h"
-#include <sys/xattr.h>
#include <fuse.h>
+#if defined(__FreeBSD__) || defined(__NetBSD__)
+# define XATTR_CREATE 1
+# define XATTR_REPLACE 2
+#else
+# include <sys/xattr.h>
+#endif
+
/* Determine if threads support should be included */
#ifdef USE_ITHREADS
# ifdef I_PTHREAD
typedef struct {
SV *callback[N_CALLBACKS];
HV *handles;
+#ifdef USE_ITHREADS
tTHX self;
+#endif
int threaded;
+#ifdef USE_ITHREADS
perl_mutex mutex;
+#endif
} my_cxt_t;
START_MY_CXT;
return rv;
}
+#if __FreeBSD__ >= 10
+int _PLfuse_setxattr (const char *file, const char *name, const char *buf, size_t buflen, int flags, uint32_t position) {
+#else
int _PLfuse_setxattr (const char *file, const char *name, const char *buf, size_t buflen, int flags) {
+#endif
int rv;
FUSE_CONTEXT_PRE;
DEBUGf("setxattr begin\n");
return rv;
}
+#if __FreeBSD__ >= 10
+int _PLfuse_getxattr (const char *file, const char *name, char *buf, size_t buflen, uint32_t position) {
+#else
int _PLfuse_getxattr (const char *file, const char *name, char *buf, size_t buflen) {
+#endif
int rv;
FUSE_CONTEXT_PRE;
DEBUGf("getxattr begin\n");
BOOT:
MY_CXT_INIT;
+#ifdef USE_ITHREADS
MY_CXT.self = aTHX;
+#endif
void
CLONE(...)
PREINIT:
+#ifdef USE_ITHREADS
int i;
dTHX;
+#endif
CODE:
+#ifdef USE_ITHREADS
MY_CXT_CLONE;
tTHX parent = MY_CXT.self;
MY_CXT.self = my_perl;
clone_params_del(clone_param);
#endif
}
+#endif
SV*
fuse_get_context()
OUTPUT:
RETVAL
+#ifndef __FreeBSD__
SV *
XATTR_CREATE()
CODE:
OUTPUT:
RETVAL
+#endif
+
void
perl_fuse_main(...)
PREINIT:
fuse_opt_free_args(&args);
croak("out of memory\n");
}
- if (mountopts &&
+ if (mountopts && strcmp("", mountopts) &&
(fuse_opt_add_arg(&args, "-o") == -1 ||
fuse_opt_add_arg(&args, mountopts) == -1)) {
fuse_opt_free_args(&args);