Whamcloud - gitweb
fuse2fs: fix portability issues when compiling on MacOS
authorTheodore Ts'o <tytso@mit.edu>
Fri, 23 May 2025 03:53:40 +0000 (23:53 -0400)
committerTheodore Ts'o <tytso@mit.edu>
Fri, 23 May 2025 03:53:40 +0000 (23:53 -0400)
commit7dbac9cdbea1455225e0ef4628c61393dedc1a80
tree13801875138ad017d3bc7dd013a79093d3ff0c71
parent6e1e57671c85a48624069a274b66740d279cfcc8
fuse2fs: fix portability issues when compiling on MacOS

Fix a number of portability issues which resulted in fuse2fs failing
to build on MacOS.

*) MacOS doesn't have the timespec fields in struct stat; we have
   a autoconf test to check for this, so use it.

*) The portable way to print off_t values is to use
   printf("%jd", (intmax_t) d);  The cast is necessary to avoid
   type mismatch warnings.

*) Define FUSE_DARWIN_ENABLE_EXTENSIONS=0 to avoid using random
   structs such as struct fuse_darwin_attr and struct fuse_darwin_fill_dir_t
   in the fuse operation function prototypes.

With these fixes, fuse2fs successfully compiles and works with
MacFuse on macOS Sequoia.

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
misc/fuse2fs.c