Use unsigned return values in read()-like Pal fns.
Returning a negative number of bytes makes absolutely no sense, besides the "-1 and errno" pattern, which is now converted to Result<_, Errno>.
This commit is contained in:
@@ -14,5 +14,6 @@ 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,
|
||||
)
|
||||
.map(|read| read as ssize_t)
|
||||
.or_minus_one_errno()
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user