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:
4lDO2
2024-09-27 10:39:26 +02:00
parent 986754e7b3
commit 8b8b00da01
12 changed files with 86 additions and 51 deletions
+1
View File
@@ -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()
}