Skip to content
Snippets Groups Projects
Commit 190c0bcb authored by felixmoebius's avatar felixmoebius
Browse files

Add support for target_os = "unikraft"

parent c29dd5f8
Branches master
No related tags found
No related merge requests found
...@@ -175,7 +175,7 @@ cfg_if! { ...@@ -175,7 +175,7 @@ cfg_if! {
target_os = "haiku", target_os = "redox"))] { target_os = "haiku", target_os = "redox"))] {
mod util_libc; mod util_libc;
#[path = "use_file.rs"] mod imp; #[path = "use_file.rs"] mod imp;
} else if #[cfg(any(target_os = "android", target_os = "linux"))] { } else if #[cfg(any(target_os = "android", target_os = "linux", target_os = "unikraft"))] {
mod util_libc; mod util_libc;
mod use_file; mod use_file;
#[path = "linux_android.rs"] mod imp; #[path = "linux_android.rs"] mod imp;
......
...@@ -28,7 +28,7 @@ const FILE_PATH: &str = "rand:\0"; ...@@ -28,7 +28,7 @@ const FILE_PATH: &str = "rand:\0";
target_os = "illumos" target_os = "illumos"
))] ))]
const FILE_PATH: &str = "/dev/random\0"; const FILE_PATH: &str = "/dev/random\0";
#[cfg(any(target_os = "android", target_os = "linux"))] #[cfg(any(target_os = "android", target_os = "linux", target_os = "unikraft"))]
const FILE_PATH: &str = "/dev/urandom\0"; const FILE_PATH: &str = "/dev/urandom\0";
pub fn getrandom_inner(dest: &mut [u8]) -> Result<(), Error> { pub fn getrandom_inner(dest: &mut [u8]) -> Result<(), Error> {
......
...@@ -12,7 +12,7 @@ use core::{num::NonZeroU32, ptr::NonNull}; ...@@ -12,7 +12,7 @@ use core::{num::NonZeroU32, ptr::NonNull};
cfg_if! { cfg_if! {
if #[cfg(any(target_os = "netbsd", target_os = "openbsd", target_os = "android"))] { if #[cfg(any(target_os = "netbsd", target_os = "openbsd", target_os = "android"))] {
use libc::__errno as errno_location; use libc::__errno as errno_location;
} else if #[cfg(any(target_os = "linux", target_os = "emscripten", target_os = "redox"))] { } else if #[cfg(any(target_os = "linux", target_os = "emscripten", target_os = "redox", target_os = "unikraft"))] {
use libc::__errno_location as errno_location; use libc::__errno_location as errno_location;
} else if #[cfg(any(target_os = "solaris", target_os = "illumos"))] { } else if #[cfg(any(target_os = "solaris", target_os = "illumos"))] {
use libc::___errno as errno_location; use libc::___errno as errno_location;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment