summaryrefslogtreecommitdiff
path: root/libfusepp
diff options
context:
space:
mode:
authorrandomdan <randomdan@localhost>2013-08-19 00:06:37 +0000
committerrandomdan <randomdan@localhost>2013-08-19 00:06:37 +0000
commit0860da21d86f69ad8d59289d422451adfb1b3d05 (patch)
treede334a37ab8cc3c6e79d6edc334137223bc496c9 /libfusepp
parentUse CXX from the environment (diff)
downloadnetfs-0860da21d86f69ad8d59289d422451adfb1b3d05.tar.bz2
netfs-0860da21d86f69ad8d59289d422451adfb1b3d05.tar.xz
netfs-0860da21d86f69ad8d59289d422451adfb1b3d05.zip
Add base case support for ioctl, poll, write_buf, read_buf and flock
Diffstat (limited to 'libfusepp')
-rw-r--r--libfusepp/fuseapp.cpp30
-rw-r--r--libfusepp/fuseapp.h5
2 files changed, 30 insertions, 5 deletions
diff --git a/libfusepp/fuseapp.cpp b/libfusepp/fuseapp.cpp
index 60606ea..e1c552e 100644
--- a/libfusepp/fuseapp.cpp
+++ b/libfusepp/fuseapp.cpp
@@ -158,6 +158,26 @@ int FuseAppBase::bmap(const char *, size_t, uint64_t *)
{
return -ENOSYS;
}
+int FuseAppBase::ioctl(const char *, int, void *, struct fuse_file_info *, unsigned int, void *)
+{
+ return -ENOSYS;
+}
+int FuseAppBase::poll(const char *, struct fuse_file_info *, struct fuse_pollhandle *, unsigned *)
+{
+ return -ENOSYS;
+}
+int FuseAppBase::write_buf(const char *, struct fuse_bufvec *, off_t, struct fuse_file_info *)
+{
+ return -ENOSYS;
+}
+int FuseAppBase::read_buf(const char *, struct fuse_bufvec **, size_t, off_t, struct fuse_file_info *)
+{
+ return -ENOSYS;
+}
+int FuseAppBase::flock(const char *, struct fuse_file_info *, int)
+{
+ return -ENOSYS;
+}
int FuseAppBase::onError(const std::exception & e) throw()
{
fprintf(stderr, "Unknown exception calling (what: %s)\n", e.what());
@@ -250,13 +270,13 @@ FuseAppBase::run(int & argc, char** & argv, FuseAppBase * fa)
0, // flag_utime_omit_ok
#endif
0, // flag_reserved
- NULL, // ioctl
- NULL // poll
+ fuseCall<const char *, int, void *, struct fuse_file_info *, unsigned int, void *>::helper<&FuseAppBase::ioctl>,
+ fuseCall<const char *, struct fuse_file_info *, struct fuse_pollhandle *, unsigned *>::helper<&FuseAppBase::poll>
#if (FUSE_MINOR_VERSION >= 9)
,
- NULL, // writebuf
- NULL, // readbuf
- NULL, // flock
+ fuseCall<const char *, struct fuse_bufvec *, off_t, struct fuse_file_info *>::helper<&FuseAppBase::write_buf>,
+ fuseCall<const char *, struct fuse_bufvec **, size_t, off_t, struct fuse_file_info *>::helper<&FuseAppBase::read_buf>,
+ fuseCall<const char *, struct fuse_file_info *, int>::helper<&FuseAppBase::flock>,
NULL // fallocate
#endif
#endif
diff --git a/libfusepp/fuseapp.h b/libfusepp/fuseapp.h
index c823721..1c94f13 100644
--- a/libfusepp/fuseapp.h
+++ b/libfusepp/fuseapp.h
@@ -45,6 +45,11 @@ class FuseAppBase {
virtual int lock(const char *, struct fuse_file_info *, int cmd, struct flock *);
virtual int utimens(const char *, const struct timespec tv[2]);
virtual int bmap(const char *, size_t blocksize, uint64_t *idx);
+ virtual int ioctl(const char *, int cmd, void *arg, struct fuse_file_info *, unsigned int flags, void * data);
+ virtual int poll(const char *, struct fuse_file_info *, struct fuse_pollhandle *, unsigned *);
+ virtual int write_buf (const char *, struct fuse_bufvec *buf, off_t off, struct fuse_file_info *);
+ virtual int read_buf (const char *, struct fuse_bufvec **bufp, size_t size, off_t off, struct fuse_file_info *);
+ virtual int flock (const char *, struct fuse_file_info *, int op);
virtual int onError(const std::exception & err) throw();
static int run(int &, char ** &, FuseAppBase *);