Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot be built on OpenBSD #262

Open
tyatsumi opened this issue Oct 20, 2023 · 1 comment
Open

Cannot be built on OpenBSD #262

tyatsumi opened this issue Oct 20, 2023 · 1 comment

Comments

@tyatsumi
Copy link

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.

@realchonk
Copy link

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants