mpartel / bindfs

Mount a directory elsewhere with changed permissions.
https://bindfs.org/
GNU General Public License v2.0
449 stars 64 forks source link

Support for 64bit statfs on macOS #130

Closed ohayetechnology closed 1 year ago

ohayetechnology commented 1 year ago

With very big filesystems (~1PB) on macOS, we noticed that bindfs returns zero bytes available. This renders most applications unusable.

Good news is a fix appears to be trivial.

static int bindfs_statfs_x(const char *path, struct statfs *stbuf);
#if __APPLE__
    static int bindfs_statfs_x(const char *path, struct statfs *stbuf)
    {
        int res;
        char *real_path;

        real_path = process_path(path, true);
        if (real_path == NULL)
            return -errno;

        res = statfs(real_path, stbuf);
        free(real_path);
        if (res == -1)
            return -errno;

        return 0;
    }
#endif
#ifdef __APPLE__
    .statfs_x = bindfs_statfs_x,
#endif
mpartel commented 1 year ago

Thanks! Released as 1.17.3.