Skip to content

Commit 2d78cb6

Browse files
committed
musl: time64: update struct sched_param
A bunch of properties were removed upstream and set to reserved. This matches upstream commit bminor/musl@827aa8f and bminor/musl@2d69fcf
1 parent 2a79c60 commit 2d78cb6

File tree

1 file changed

+40
-12
lines changed

1 file changed

+40
-12
lines changed

src/unix/linux_like/mod.rs

Lines changed: 40 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,46 @@ missing! {
1313
pub enum timezone {}
1414
}
1515

16+
// FIXME(musl): these changes are not strictly part of time64 but the fact musl_v1_2_3 is enabled
17+
// on ohos makes it awkward.
18+
cfg_if! {
19+
if #[cfg(not(any(target_env = "musl", target_os = "emscripten", target_env = "ohos")))] {
20+
s! {
21+
pub struct sched_param {
22+
pub sched_priority: c_int,
23+
}
24+
}
25+
} else if #[cfg(musl32_time64)] {
26+
s! {
27+
pub struct sched_param {
28+
pub sched_priority: c_int,
29+
30+
__reserved1: c_int,
31+
//#[cfg(musl32_time64)]
32+
__reserved2: [c_long; 4],
33+
//#[cfg(not(musl32_time64))]
34+
//__reserved2: [crate::timespec; 2],
35+
__reserved3: c_int,
36+
}
37+
}
38+
} else {
39+
s! {
40+
pub struct sched_param {
41+
pub sched_priority: c_int,
42+
43+
#[deprecated(since = "0.2.173", note = "This field has been removed upstream and we'll follow that change in a future release.")]
44+
pub sched_ss_low_priority: c_int,
45+
#[deprecated(since = "0.2.173", note = "This field has been removed upstream and we'll follow that change in a future release.")]
46+
pub sched_ss_repl_period: crate::timespec,
47+
#[deprecated(since = "0.2.173", note = "This field has been removed upstream and we'll follow that change in a future release.")]
48+
pub sched_ss_init_budget: crate::timespec,
49+
#[deprecated(since = "0.2.173", note = "This field has been removed upstream and we'll follow that change in a future release.")]
50+
pub sched_ss_max_repl: c_int,
51+
}
52+
}
53+
}
54+
}
55+
1656
s! {
1757
// FIXME(1.0): This should not implement `PartialEq`
1858
#[allow(unpredictable_function_pointer_comparisons)]
@@ -110,18 +150,6 @@ s! {
110150
pub tm_zone: *const c_char,
111151
}
112152

113-
pub struct sched_param {
114-
pub sched_priority: c_int,
115-
#[cfg(any(target_env = "musl", target_os = "emscripten", target_env = "ohos"))]
116-
pub sched_ss_low_priority: c_int,
117-
#[cfg(any(target_env = "musl", target_os = "emscripten", target_env = "ohos"))]
118-
pub sched_ss_repl_period: crate::timespec,
119-
#[cfg(any(target_env = "musl", target_os = "emscripten", target_env = "ohos"))]
120-
pub sched_ss_init_budget: crate::timespec,
121-
#[cfg(any(target_env = "musl", target_os = "emscripten", target_env = "ohos"))]
122-
pub sched_ss_max_repl: c_int,
123-
}
124-
125153
pub struct Dl_info {
126154
pub dli_fname: *const c_char,
127155
pub dli_fbase: *mut c_void,

0 commit comments

Comments
 (0)