aboutsummaryrefslogtreecommitdiff
path: root/test/fuse_integration/fallocate_darwin.go
diff options
context:
space:
mode:
authorchrislu <chris.lu@gmail.com>2025-08-31 13:11:57 -0700
committerchrislu <chris.lu@gmail.com>2025-08-31 13:11:57 -0700
commit705c965c5c8e67cf9fa10e34a26e3282227dd6e8 (patch)
tree0930913b2c2ef6eed3b4179325da461e3e93e954 /test/fuse_integration/fallocate_darwin.go
parenta2378a29dcea338e598689344b139515db7814c4 (diff)
downloadseaweedfs-705c965c5c8e67cf9fa10e34a26e3282227dd6e8.tar.xz
seaweedfs-705c965c5c8e67cf9fa10e34a26e3282227dd6e8.zip
fix
Diffstat (limited to 'test/fuse_integration/fallocate_darwin.go')
-rw-r--r--test/fuse_integration/fallocate_darwin.go6
1 files changed, 6 insertions, 0 deletions
diff --git a/test/fuse_integration/fallocate_darwin.go b/test/fuse_integration/fallocate_darwin.go
index 94f5de7b9..fa67f3f7a 100644
--- a/test/fuse_integration/fallocate_darwin.go
+++ b/test/fuse_integration/fallocate_darwin.go
@@ -34,6 +34,12 @@ type fstore struct {
}
func fallocateFile(fd int, mode int, offset int64, length int64) error {
+ // Check for unsupported modes on macOS
+ unsupportedModes := FALLOC_FL_PUNCH_HOLE | FALLOC_FL_NO_HIDE_STALE | FALLOC_FL_COLLAPSE_RANGE | FALLOC_FL_ZERO_RANGE | FALLOC_FL_INSERT_RANGE | FALLOC_FL_UNSHARE_RANGE
+ if mode&unsupportedModes != 0 {
+ return syscall.ENOTSUP // Operation not supported
+ }
+
// On macOS, we use fcntl with F_PREALLOCATE
store := fstore{
flags: F_ALLOCATECONTIG,