From 8889d43f9d7f0a81846a74a6ae6497cfb8b8c465 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fran=C3=A7ois=20Autin?= Date: Wed, 8 Mar 2023 14:09:07 +0100 Subject: [PATCH] Fixed ucontext & libc --- src/kernel/ucontext.rs | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) 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) } }