Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
42 changes: 42 additions & 0 deletions src/unix/newlib/horizon/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,10 @@ s! {
pub sun_family: ::sa_family_t,
pub sun_path: [::c_char; 104usize],
}

pub struct sched_param {
pub sched_priority: ::c_int,
}
}

pub const SIGEV_NONE: ::c_int = 1;
Expand Down Expand Up @@ -147,6 +151,10 @@ pub const FIONBIO: ::c_ulong = 1;

pub const RTLD_DEFAULT: *mut ::c_void = 0 as *mut ::c_void;

// For pthread get/setschedparam
pub const SCHED_FIFO: ::c_int = 1;
pub const SCHED_RR: ::c_int = 2;

// Horizon OS works doesn't or can't hold any of this information
safe_f! {
pub {const} fn WIFSTOPPED(_status: ::c_int) -> bool {
Expand Down Expand Up @@ -190,5 +198,39 @@ extern "C" {
value: *mut ::c_void,
) -> ::c_int;

pub fn pthread_attr_getschedparam(
attr: *const ::pthread_attr_t,
param: *mut sched_param,
) -> ::c_int;

pub fn pthread_attr_setschedparam(
attr: *mut ::pthread_attr_t,
param: *const sched_param,
) -> ::c_int;

pub fn pthread_attr_getprocessorid_np(
attr: *const ::pthread_attr_t,
processor_id: *mut ::c_int,
) -> ::c_int;

pub fn pthread_attr_setprocessorid_np(
attr: *mut ::pthread_attr_t,
processor_id: ::c_int,
) -> ::c_int;

pub fn pthread_getschedparam(
native: ::pthread_t,
policy: *mut ::c_int,
param: *mut ::sched_param,
) -> ::c_int;

pub fn pthread_setschedparam(
native: ::pthread_t,
policy: ::c_int,
param: *const ::sched_param,
) -> ::c_int;

pub fn pthread_getprocessorid_np() -> ::c_int;

pub fn gethostid() -> ::c_long;
}