X-Git-Url: http://git.rot13.org/?a=blobdiff_plain;f=Fuse.xs;h=fb3686fa752775e40bf1f8e2e7e4b70400f6b4eb;hb=e58e8d93ea76d9eadfcb1e7bce7d5e8bc483f71c;hp=8f448a88e2f96ebaf99ece0ed95d9fbdc08e021c;hpb=4de9557258b861a2107951316063fd383894194d;p=perl-fuse.git diff --git a/Fuse.xs b/Fuse.xs index 8f448a8..fb3686f 100755 --- a/Fuse.xs +++ b/Fuse.xs @@ -3,9 +3,15 @@ #include "perl.h" #include "XSUB.h" -#include #include +#if defined(__FreeBSD__) || defined(__NetBSD__) +# define XATTR_CREATE 1 +# define XATTR_REPLACE 2 +#else +# include +#endif + /* Determine if threads support should be included */ #ifdef USE_ITHREADS # ifdef I_PTHREAD @@ -727,7 +733,11 @@ int _PLfuse_fsync (const char *file, int datasync, struct fuse_file_info *fi) { 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"); @@ -750,7 +760,11 @@ int _PLfuse_setxattr (const char *file, const char *name, const char *buf, size_ 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"); @@ -1576,6 +1590,7 @@ fuse_version() OUTPUT: RETVAL +#ifndef __FreeBSD__ SV * XATTR_CREATE() CODE: @@ -1590,6 +1605,8 @@ XATTR_REPLACE() OUTPUT: RETVAL +#endif + void perl_fuse_main(...) PREINIT: @@ -1643,7 +1660,7 @@ perl_fuse_main(...) } else if(SvOK(var)) { croak("invalid callback (%i) passed to perl_fuse_main " "(%s is not a string, code ref, or undef).\n", - i+4,SvPVbyte_nolen(var)); + i+5,SvPVbyte_nolen(var)); } else { MY_CXT.callback[i] = NULL; } @@ -1653,9 +1670,12 @@ perl_fuse_main(...) * to hack on compatibility with other parts of the new API. First and * foremost, real C argc/argv would be good to get at... */ - if (mountopts && - (fuse_opt_add_arg(&args, "") == -1 || - fuse_opt_add_arg(&args, "-o") == -1 || + if ((mountopts || debug) && fuse_opt_add_arg(&args, "") == -1) { + fuse_opt_free_args(&args); + croak("out of memory\n"); + } + if (mountopts && strcmp("", mountopts) && + (fuse_opt_add_arg(&args, "-o") == -1 || fuse_opt_add_arg(&args, mountopts) == -1)) { fuse_opt_free_args(&args); croak("out of memory\n");