Switch almost all of Pal to Rusty error handling.

This commit is contained in:
4lDO2
2024-09-27 10:19:44 +02:00
parent 549bdc5c72
commit 313b32c815
20 changed files with 338 additions and 301 deletions
+5 -1
View File
@@ -1,6 +1,9 @@
use core::slice;
use crate::platform::{types::*, Pal, Sys};
use crate::{
error::ResultExt,
platform::{types::*, Pal, Sys},
};
pub const GRND_NONBLOCK: c_uint = 1;
pub const GRND_RANDOM: c_uint = 2;
@@ -11,4 +14,5 @@ pub unsafe extern "C" fn getrandom(buf: *mut c_void, buflen: size_t, flags: c_ui
slice::from_raw_parts_mut(buf as *mut u8, buflen as usize),
flags,
)
.or_minus_one_errno()
}