Non-Linux portability fixes (FreeBSD): xattr/fiemap/sysinfo guards #664
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.
Summary
This PR makes mpifileutils build on FreeBSD (and generally non-Linux platforms) by guarding Linux-only APIs/headers and providing small compatibility fallbacks.
These changes were developed while preparing the FreeBSD ports package and are intended to be upstreamable, minimal, and low-risk for Linux behavior.
Key changes
__linux__(e.g.<sys/sysinfo.h>,<linux/fiemap.h>,FS_IOC_FIEMAP).syscall(SYS_getdents)on Linux, andgetdents(2)wrapper on non-Linux inmfu_flist_walk.<sys/xattr.h>on LinuxENOTSUP(so core functionality remains available)stat64/lstat64compatibility mapping where neededHOST_NAME_MAXfallbackS_ISLNK,POSIX_FADV_SEQUENTIAL,O_LARGEFILEif absent)errnologging format issuePlatform impact
Testing
References