if ($fuse_version >= 2.6) {
push(@names, qw/lock utimens bmap/);
}
-# if ($fuse_version >= 2.8) {
-# # junk doesn't contain a function pointer, and hopefully
-# # never will; it's a "dead" zone in the struct
-# # fuse_operations where a flag bit is declared. we don't
-# # need to concern ourselves with it, and it appears any
-# # arch with a 64 bit pointer will align everything to
-# # 8 bytes, making the question of pointer alignment for
-# # the last 2 wrapper functions no big thing.
+ if ($fuse_version >= 2.8) {
+ # junk doesn't contain a function pointer, and hopefully
+ # never will; it's a "dead" zone in the struct
+ # fuse_operations where a flag bit is declared. we don't
+ # need to concern ourselves with it, and it appears any
+ # arch with a 64 bit pointer will align everything to
+ # 8 bytes, making the question of pointer alignment for
+ # the last 2 wrapper functions no big thing.
+ push(@names, qw/junk ioctl/);
# push(@names, qw/junk ioctl poll/);
-# }
+ }
my @subs = map {undef} @names;
my $tmp = 0;
my %mapping = map { $_ => $tmp++ } @names;
/* Global Data */
#define MY_CXT_KEY "Fuse::_guts" XS_VERSION
-/* #if FUSE_VERSION >= 28
-# define N_CALLBACKS 41 */
-#if FUSE_VERSION >= 26
+#if FUSE_VERSION >= 28
+# define N_CALLBACKS 40
+/* # define N_CALLBACKS 41 */
+#elif FUSE_VERSION >= 26
# define N_CALLBACKS 38
#elif FUSE_VERSION >= 25
# define N_CALLBACKS 35
}
#endif /* FUSE_VERSION >= 26 */
-#if 0
#if FUSE_VERSION >= 28
int _PLfuse_ioctl(const char *file, int cmd, void *arg,
struct fuse_file_info *fi, unsigned int flags, void *data) {
PUSHMARK(SP);
XPUSHs(sv_2mortal(newSVpv(file,0)));
XPUSHs(sv_2mortal(newSViv(cmd)));
+ XPUSHs(sv_2mortal(newSViv((uintptr_t)arg)));
XPUSHs(sv_2mortal(newSViv(flags)));
if (_IOC_DIR(cmd) & _IOC_READ)
XPUSHs(sv_2mortal(newSVpvn(data, _IOC_SIZE(cmd))));
if (_IOC_DIR(cmd) & _IOC_WRITE) {
if (rv == 2) {
SV *sv = POPs;
- unsigned int len;
+ size_t len;
char *rdata = SvPV(sv, len);
+ rv--;
+
if (len > _IOC_SIZE(cmd)) {
fprintf(stderr, "ioctl(): returned data was too large for data area\n");
rv = -EFBIG;
memset(data, 0, _IOC_SIZE(cmd));
memcpy(data, rdata, len);
}
-
- rv--;
}
else {
fprintf(stderr, "ioctl(): ioctl was a write op, but no data was returned from call?\n");
return rv;
}
+#if 0
int _PLfuse_poll(const char *file, struct fuse_file_info *fi,
struct fuse_pollhandle *ph, unsigned *reventsp) {
}
-#endif /* FUSE_VERSION >= 28 */
#endif
+#endif /* FUSE_VERSION >= 28 */
struct fuse_operations _available_ops = {
getattr: _PLfuse_getattr,
utimens: _PLfuse_utimens,
bmap: _PLfuse_bmap,
#endif /* FUSE_VERSION >= 26 */
-#if 0
#if FUSE_VERSION >= 28
ioctl: _PLfuse_ioctl,
+#if 0
poll: _PLfuse_poll,
-#endif /* FUSE_VERSION >= 28 */
#endif
+#endif /* FUSE_VERSION >= 28 */
};
MODULE = Fuse PACKAGE = Fuse