Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions fuse-ext2/fuse-ext2.c
Original file line number Diff line number Diff line change
Expand Up @@ -277,6 +277,19 @@ static char * parse_mount_options (const char *orig_opts, struct extfs_data *opt
goto exit;
}

#ifdef __APPLE__
/* macOS FUSE (macFUSE / FUSE-T) declares getxattr with an extra trailing
* `position` argument, for the Darwin resource-fork xattr convention. ext2 has
* no such concept, so this shim drops `position` and defers to the shared
* Linux-style op_getxattr. Without it the build fails with an incompatible
* function-pointer-type error assigning op_getxattr to .getxattr. */
static int op_getxattr_darwin(const char *path, const char *name, char *value,
size_t size, uint32_t position) {
(void) position;
return op_getxattr(path, name, value, size);
}
#endif

static const struct fuse_operations ext2fs_ops = {
.getattr = op_getattr,
.readlink = op_readlink,
Expand All @@ -298,7 +311,11 @@ static const struct fuse_operations ext2fs_ops = {
.release = op_release,
.fsync = op_fsync,
.setxattr = NULL,
#ifdef __APPLE__
.getxattr = op_getxattr_darwin,
#else
.getxattr = op_getxattr,
#endif
.listxattr = NULL,
.removexattr = NULL,
.opendir = op_open,
Expand Down