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

nix not compatible with freebsd 13 #1604

Closed
densone opened this issue Dec 10, 2021 · 1 comment
Closed

nix not compatible with freebsd 13 #1604

densone opened this issue Dec 10, 2021 · 1 comment

Comments

@densone
Copy link

densone commented Dec 10, 2021

ext field needs to be added to kevent data structure and functions.

error[E0063]: missing field `ext` in initializer of `kevent`
   --> /root/.cargo/registry/src/github.com-1ecc6299db9ec823/nix-0.22.2/src/sys/event.rs:221:26
    |
221 |         KEvent { kevent: libc::kevent {
    |                          ^^^^^^^^^^^^ missing `ext`

For more information about this error, try `rustc --explain E0063`.
error: could not compile `nix` due to previous error

I was able to fix it for my usecase but unsure how you'd implement it in nix for varying bsd versions.

Our hack to make I compile:

impl KEvent {
    pub fn new(ident: uintptr_t, filter: EventFilter, flags: EventFlag,
               fflags:FilterFlag, data: intptr_t, udata: intptr_t) -> KEvent {
        KEvent { kevent: libc::kevent {
            ident,
            filter: filter as type_of_event_filter,
            flags: flags.bits(),
            fflags: fflags.bits(),
            data: data as type_of_data,
            udata: udata as type_of_udata,
            ext: [0,0,0,0],       //this is likely bad but we are not using this part of nix 
        } }
    }
@asomers
Copy link
Member

asomers commented Dec 10, 2021

It's a libc bug. I'm trying to get it fixed here rust-lang/libc#2585 .

@asomers asomers closed this as completed Dec 10, 2021
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