Skip to content

Build failure on musl due to missing libc::sched_param fields #4

@ptrcnull

Description

@ptrcnull

on musl libc, the sched_param struct has more fields:

    pub struct sched_param {
        pub sched_priority: ::c_int,
        #[cfg(any(target_env = "musl", target_os = "emscripten", target_env = "ohos"))]
        pub sched_ss_low_priority: ::c_int,
        #[cfg(any(target_env = "musl", target_os = "emscripten", target_env = "ohos"))]
        pub sched_ss_repl_period: ::timespec,
        #[cfg(any(target_env = "musl", target_os = "emscripten", target_env = "ohos"))]
        pub sched_ss_init_budget: ::timespec,
        #[cfg(any(target_env = "musl", target_os = "emscripten", target_env = "ohos"))]
        pub sched_ss_max_repl: ::c_int,
    }

without them, compiling bark fails:

   Compiling bark v0.1.0
error[E0063]: missing fields `sched_ss_init_budget`, `sched_ss_low_priority`, `sched_ss_max_repl` and 1 other field in initializer of `sched_param`
  --> src/thread.rs:19:14
   |
19 |             &libc::sched_param {
   |              ^^^^^^^^^^^^^^^^^ missing `sched_ss_init_budget`, `sched_ss_low_priority`, `sched_ss_max_repl` and 1 other field

For more information about this error, try `rustc --explain E0063`.
error: could not compile `bark` (bin "bark") due to previous error

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions