projects
/
perl-fuse.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Make the code work without USE_ITHREADS. FreeBSD's default Perl build
[perl-fuse.git]
/
Fuse.xs
diff --git
a/Fuse.xs
b/Fuse.xs
index
4e1ab7d
..
f84aa49
100755
(executable)
--- a/
Fuse.xs
+++ b/
Fuse.xs
@@
-3,9
+3,15
@@
#include "perl.h"
#include "XSUB.h"
#include "perl.h"
#include "XSUB.h"
-#include <sys/xattr.h>
#include <fuse.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
/* Determine if threads support should be included */
#ifdef USE_ITHREADS
# ifdef I_PTHREAD
@@
-33,9
+39,13
@@
typedef struct {
SV *callback[N_CALLBACKS];
HV *handles;
typedef struct {
SV *callback[N_CALLBACKS];
HV *handles;
+#ifdef USE_ITHREADS
tTHX self;
tTHX self;
+#endif
int threaded;
int threaded;
+#ifdef USE_ITHREADS
perl_mutex mutex;
perl_mutex mutex;
+#endif
} my_cxt_t;
START_MY_CXT;
} my_cxt_t;
START_MY_CXT;
@@
-727,7
+737,11
@@
int _PLfuse_fsync (const char *file, int datasync, struct fuse_file_info *fi) {
return rv;
}
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) {
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");
int rv;
FUSE_CONTEXT_PRE;
DEBUGf("setxattr begin\n");
@@
-750,7
+764,11
@@
int _PLfuse_setxattr (const char *file, const char *name, const char *buf, size_
return rv;
}
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) {
int _PLfuse_getxattr (const char *file, const char *name, char *buf, size_t buflen) {
+#endif
int rv;
FUSE_CONTEXT_PRE;
DEBUGf("getxattr begin\n");
int rv;
FUSE_CONTEXT_PRE;
DEBUGf("getxattr begin\n");
@@
-1506,14
+1524,19
@@
PROTOTYPES: DISABLE
BOOT:
MY_CXT_INIT;
BOOT:
MY_CXT_INIT;
+#ifdef USE_ITHREADS
MY_CXT.self = aTHX;
MY_CXT.self = aTHX;
+#endif
void
CLONE(...)
PREINIT:
void
CLONE(...)
PREINIT:
+#ifdef USE_ITHREADS
int i;
dTHX;
int i;
dTHX;
+#endif
CODE:
CODE:
+#ifdef USE_ITHREADS
MY_CXT_CLONE;
tTHX parent = MY_CXT.self;
MY_CXT.self = my_perl;
MY_CXT_CLONE;
tTHX parent = MY_CXT.self;
MY_CXT.self = my_perl;
@@
-1545,6
+1568,7
@@
CLONE(...)
clone_params_del(clone_param);
#endif
}
clone_params_del(clone_param);
#endif
}
+#endif
SV*
fuse_get_context()
SV*
fuse_get_context()
@@
-1576,6
+1600,7
@@
fuse_version()
OUTPUT:
RETVAL
OUTPUT:
RETVAL
+#ifndef __FreeBSD__
SV *
XATTR_CREATE()
CODE:
SV *
XATTR_CREATE()
CODE:
@@
-1590,6
+1615,8
@@
XATTR_REPLACE()
OUTPUT:
RETVAL
OUTPUT:
RETVAL
+#endif
+
void
perl_fuse_main(...)
PREINIT:
void
perl_fuse_main(...)
PREINIT: