Skip to content

nix not compatible with freebsd 13 #1604

Closed
@densone

Description

@densone

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 
        } }
    }

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions