Skip to content

Commit

Permalink
Fix no-std builds for MacOS and BSDs
Browse files Browse the repository at this point in the history
  • Loading branch information
niluxv committed Apr 30, 2023
1 parent f78803c commit 44e87cc
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion src/process/procctl.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@

use core::mem::MaybeUninit;
use core::ptr;
use alloc::vec::Vec;

use bitflags::bitflags;

Expand Down Expand Up @@ -329,7 +330,7 @@ pub fn get_reaper_pids(process: ProcSelector) -> io::Result<Vec<PidInfo>> {
// Sadly no better way to guarantee that we get all the results than to
// allocate ~8MB of memory..
const PID_MAX: usize = 99999;
let mut pids: Vec<procctl_reaper_pidinfo> = vec![Default::default(); PID_MAX];
let mut pids: Vec<procctl_reaper_pidinfo> = alloc::vec![Default::default(); PID_MAX];
let mut pinfo = procctl_reaper_pids {
rp_count: PID_MAX as _,
rp_pad0: [0; 15],
Expand Down
2 changes: 1 addition & 1 deletion src/process/wait.rs
Original file line number Diff line number Diff line change
Expand Up @@ -256,7 +256,7 @@ pub enum WaitId<'a> {
/// Eat the lifetime for non-Linux platforms.
#[doc(hidden)]
#[cfg(not(target_os = "linux"))]
__EatLifetime(std::marker::PhantomData<&'a ()>),
__EatLifetime(core::marker::PhantomData<&'a ()>),
// TODO(notgull): Once this crate has the concept of PGIDs, add a WaitId::Pgid
}

Expand Down

0 comments on commit 44e87cc

Please sign in to comment.