fuser icon indicating copy to clipboard operation
fuser copied to clipboard

Cannot be built on OpenBSD

Open tyatsumi opened this issue 2 years ago • 1 comments

I am trying to use fuser on OpenBSD, and found that fuser v0.13.0 cannot be built on the OS. There are two problems.

The first problem is some constants from libc crate are not defined for OpenBSD. They are:

  • libc::ENOLINK
  • libc::EMULTIHOP

They are not defined in C headers on OpenBSD, although defined in C++ headers.

The second problem is fuse_mount_compat25() is not defined on OpenBSD. On OpenBSD, fuse_mount() is defined.

By the way, libfuse on OpenBSD seems to be version 2.6.

tyatsumi avatar Oct 20 '23 07:10 tyatsumi

Even if I define fuse_mount_compat25() as:

extern "C" {
    fn fuse_mount(mp: *const u8, args: *mut c_void) -> *mut c_void;
    fn fuse_chan_fd(f: *mut c_void) -> i32;
}

#[no_mangle]
unsafe extern "C" fn fuse_mount_compat25(mp: *const u8, args: *mut c_void) -> i32 {
    let fuse = fuse_mount(mp, args);
    if fuse.is_null() {
        panic!("fuse is NULL");
    }

    let fd = fuse_chan_fd(fuse);
    if fd < 0 {
        panic!("fd = {fd}");
    }
    fd
}

I get EINVAL.

realchonk avatar May 15 '24 08:05 realchonk