diff --git a/src/kernel/ucontext.rs b/src/kernel/ucontext.rs index 6217a1d..16c29f1 100644 --- a/src/kernel/ucontext.rs +++ b/src/kernel/ucontext.rs @@ -11,7 +11,7 @@ use std::mem::MaybeUninit; #[derive(PartialEq)] pub struct UContextT { #[cfg(not(target_os = "windows"))] // struct non disponible sur la libc sur windows - pub buf: lib::ucontext_t, + pub buf: libc::ucontext_t, pub stackBottom: Vec } @@ -19,8 +19,8 @@ pub struct UContextT { impl UContextT { pub fn new() -> Self { - let mut context = MaybeUninit::::uninit(); - unsafe { lib::getcontext(context.as_mut_ptr()) }; + let mut context = MaybeUninit::::uninit(); + unsafe { libc::getcontext(context.as_mut_ptr()) }; Self { buf: unsafe { context.assume_init() }, stackBottom: Vec::default(), @@ -32,7 +32,7 @@ impl UContextT { /// Use `man getcontext` for more informations pub fn get_context(&mut self) -> i32 { unsafe { - lib::getcontext(&mut self.buf) + libc::getcontext(&mut self.buf) } } @@ -41,13 +41,13 @@ impl UContextT { /// Use `man setcontext` for more informations pub fn set_context(&mut self) -> i32 { unsafe { - lib::setcontext(&self.buf) + libc::setcontext(&self.buf) } } pub fn make_context(&mut self, func: extern "C" fn(), args: i32) { unsafe { - lib::makecontext(&mut self.buf, func, args) + libc::makecontext(&mut self.buf, func, args) } }