| FUSE_NEW(3) | Library Functions Manual | FUSE_NEW(3) |
fuse_new — FUSE
implementation routine to initialise the FUSE connection
library “libfuse”
#include <fuse.h>
struct fuse *
fuse_new(struct
fuse_chan *fc, struct
fuse_args *args, const
struct fuse_operations *ops,
unused size_t size,
void *userdata);
Initialises the FUSE library on the channel returned by fuse_mount(3).
FUSE operations work in the same way as their UNIX file system counterparts. A major exception is that these routines return a negated errno value (-errno) on failure.
All operations are optional but a functional file system will want
to implement at least statfs, readdir, open, read and getattr. FUSE returns
ENOSYS if any operation other than flush, fsync or
fsyncdir is not implemented.
The first parameter to each of these operations (except for init and destroy) is a NUL-terminated string representing the full path to the file or directory, relative to the root of the file system, that is being operated on.
struct fuse_operations {
int (*getattr)(const char *, struct stat *);
int (*readlink)(const char *, char *, size_t);
int (*getdir)(const char *, fuse_dirh_t, fuse_dirfil_t);
int (*mknod)(const char *, mode_t, dev_t);
int (*mkdir)(const char *, mode_t);
int (*unlink)(const char *);
int (*rmdir)(const char *);
int (*symlink)(const char *, const char *);
int (*rename)(const char *, const char *);
int (*link)(const char *, const char *);
int (*chmod)(const char *, mode_t);
int (*chown)(const char *, uid_t, gid_t);
int (*truncate)(const char *, off_t);
int (*utime)(const char *, struct utimbuf *);
int (*open)(const char *, struct fuse_file_info *);
int (*read)(const char *, char *, size_t, off_t,
struct fuse_file_info *);
int (*write)(const char *, const char *, size_t, off_t,
struct fuse_file_info *);
int (*statfs)(const char *, struct statvfs *);
int (*flush)(const char *, struct fuse_file_info *);
int (*release)(const char *, struct fuse_file_info *);
int (*fsync)(const char *, int, struct fuse_file_info *);
int (*setxattr)(const char *, const char *, const char *,
size_t int);
int (*getxattr)(const char *, const char *, char *, size_t);
int (*listxattr)(const char *, char *, size_t);
int (*removexattr)(const char *, const char *);
int (*opendir)(const char *, struct fuse_file_info *);
int (*readdir)(const char *, void *, fuse_fill_dir_t, off_t,
struct fuse_file_info *);
int (*releasedir)(const char *, struct fuse_file_info *);
int (*fsyncdir)(const char *, int, struct fuse_file_info *);
void *(*init)(struct fuse_conn_info *);
void (*destroy)(void *);
int (*access)(const char *, int);
int (*create)(const char *, mode_t, struct fuse_file_info *);
int (*ftruncate)(const char *, off_t, struct fuse_file_info *);
int (*fgetattr)(const char *, struct stat *, struct
fuse_file_info *);
int (*lock)(const char *, struct fuse_file_info *, int,
struct flock *);
int (*utimens)(const char *, const struct timespec *);
int (*bmap)(const char *, size_t , uint64_t *);
};
The order of calls is:
init ... opendir readdir releasedir open read write ... flush release ... destroy
Options supported by args are:
The fuse_new() function conforms to FUSE
2.6.
The fuse_new() function first appeared in
OpenBSD 5.4.
Sylvestre Gallon
<ccna.syl@gmail.com>
Helg Bredow
<helg@openbsd.org>
| September 23, 2025 | Debian |