Skip to content

macOS install fails with with use of undeclared identifier 'DT_LNK' after v1.18.0 #163

@walteh

Description

@walteh

Problem
running make after ./configure on macOS throws this error referencing src/bindfs.c

bindfs.c:888:57: error: use of undeclared identifier 'DT_LNK'

The change to include DT_LNK was introduced in #160

- if (settings.resolve_symlinks && (st.st_mode & S_IFLNK) == S_IFLNK) {
+ if ((settings.resolve_symlinks && de->d_type == DT_LNK) || readdirplus) {

Steps to reproduce
macOS version: 15.4.1 (24E263)

# install fuse-t
brew install macos-fuse-t/homebrew-cask/fuse-t

# clone 
git clone https://github.com/mpartel/bindfs.git
cd bindfs 

# install
export FUSE_CFLAGS="-I/usr/local/include/fuse -D_FILE_OFFSET_BITS=64"
export FUSE_LIBS="-L/usr/local/lib -lfuse-t -pthread"
./autogen.sh
./configure
make # ❌ failure here
sudo make install

Potential fix
Falling back to a S_ISLINK check when DTLNK is missing seems to fix the problem. Seems like it's worthwhile to keep the DT_LNK check if it's supported to avoid the syscall. I will submit a PR with the changes that are working for me.

#ifdef DT_LNK
        bool is_symlink = de->d_type == DT_LNK;
#else
        bool is_symlink = S_ISLNK(st.st_mode);
#endif

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions