Skip to content

Commit 0547ddf

Browse files
committed
Fix rusage and sched_param for emscripten
1 parent 772efe9 commit 0547ddf

File tree

2 files changed

+9
-5
lines changed

2 files changed

+9
-5
lines changed

src/unix/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ s! {
6262
pub ru_nvcsw: c_long,
6363
pub ru_nivcsw: c_long,
6464

65-
#[cfg(any(target_env = "musl"))]
65+
#[cfg(any(target_env = "musl", target_os = "emscripten"))]
6666
__reserved: [c_long; 16],
6767
}
6868

src/unix/notbsd/mod.rs

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -103,13 +103,13 @@ s! {
103103

104104
pub struct sched_param {
105105
pub sched_priority: ::c_int,
106-
#[cfg(any(target_env = "musl"))]
106+
#[cfg(any(target_env = "musl", target_os = "emscripten"))]
107107
pub sched_ss_low_priority: ::c_int,
108-
#[cfg(any(target_env = "musl"))]
108+
#[cfg(any(target_env = "musl", target_os = "emscripten"))]
109109
pub sched_ss_repl_period: ::timespec,
110-
#[cfg(any(target_env = "musl"))]
110+
#[cfg(any(target_env = "musl", target_os = "emscripten"))]
111111
pub sched_ss_init_budget: ::timespec,
112-
#[cfg(any(target_env = "musl"))]
112+
#[cfg(any(target_env = "musl", target_os = "emscripten"))]
113113
pub sched_ss_max_repl: ::c_int,
114114
}
115115

@@ -255,6 +255,10 @@ pub const RUSAGE_SELF: ::c_int = 0;
255255
pub const O_RDONLY: ::c_int = 0;
256256
pub const O_WRONLY: ::c_int = 1;
257257
pub const O_RDWR: ::c_int = 2;
258+
259+
#[cfg(target_os = "emscripten")]
260+
pub const O_TMPFILE: ::c_int = 0o20000000;
261+
#[cfg(not(target_os = "emscripten"))]
258262
pub const O_TMPFILE: ::c_int = 0o20000000 | O_DIRECTORY;
259263

260264
pub const SOCK_CLOEXEC: ::c_int = O_CLOEXEC;

0 commit comments

Comments
 (0)