Fix macOS build: adapt getxattr to the Darwin 5-arg signature - #154
Open
moonsoup wants to merge 1 commit into
Open
Fix macOS build: adapt getxattr to the Darwin 5-arg signature#154moonsoup wants to merge 1 commit into
moonsoup wants to merge 1 commit into
Conversation
macOS FUSE implementations (macFUSE, FUSE-T) declare the getxattr operation with an extra trailing `uint32_t position` argument — the Darwin resource-fork xattr convention. Assigning the shared 4-arg op_getxattr to .getxattr then fails to compile with an incompatible-function-pointer-type error (ref upstream issue alperakcan#143). Add an __APPLE__-only shim that accepts and ignores `position` and defers to the existing op_getxattr. No behavior change on Linux/BSD; ext2 has no resource-fork concept, so dropping `position` is correct. The #ifdef keeps the non-Darwin build using the 4-arg op_getxattr unchanged. Tested: builds and mounts read-only on macOS 26.5.1 (Apple Silicon, Darwin 25.5.0), macFUSE 5.2, Apple clang; read-only verification passes on ext2/ext3/ext4 throwaway images. Single-environment test only; broader platform testing not yet done. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
moonsoup
added a commit
to moonsoup/fuse-ext2
that referenced
this pull request
Jul 5, 2026
Replaces the outdated README (osxfuse references, a 100-line copy-paste /opt/gnu build script, obscure caveats) with a focused install + usage guide: - Install via `brew install moonsoup/fuse-ext2/fuse-ext2` (new tap) or from source with the macFUSE/e2fsprogs flags that actually work on current macOS. - Read-only mount usage, incl. the no_default_permissions option for reading drives recovered from another machine. - Points to the upstream PRs (alperakcan#154, alperakcan#155) for the fixes. Also gitignore autoconf backup junk (config.*~) and CLAUDE.md. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
On macOS the build currently fails with:
macOS FUSE implementations (macFUSE and FUSE-T) declare the
getxattroperation with an extra trailing
uint32_t positionargument — the Darwinresource-fork xattr convention — so assigning the shared 4-arg
op_getxattrto
.getxattrno longer type-checks. This is the same breakage described in#143 and blocks compilation on current macOS.
This adds an
#ifdef __APPLE__shim (op_getxattr_darwin) that accepts andignores
position, then defers to the existingop_getxattr. ext2 has noresource-fork concept, so dropping
positionis correct. The non-Darwin buildkeeps using the 4-arg
op_getxattrunchanged via the#elsebranch, so Linuxand BSD are unaffected.
Testing
Builds and mounts read-only on macOS 26.5.1 (Apple Silicon, Darwin 25.5.0)
with macFUSE 5.2 and Apple clang. Read-only verification (mount, checksum,
symlink read, write-rejection, byte-identical-after-unmount) passes on ext2,
ext3, and ext4 throwaway images.
Tested in a single environment; I haven't verified other macOS versions, Intel
Macs, or Linux/BSD (the
#ifdefis specifically to leave those pathsuntouched). Happy to adjust.