Use Cell representation for errno

This commit is contained in:
Peter Limkilde Svendsen
2024-02-29 14:07:40 +00:00
committed by Jeremy Soller
parent 9ef3374c30
commit 9093f6bc47
36 changed files with 159 additions and 197 deletions
+1 -1
View File
@@ -214,7 +214,7 @@ pub unsafe extern "C" fn strndup(s1: *const c_char, size: size_t) -> *mut c_char
// the "+ 1" is to account for the NUL byte
let buffer = platform::alloc(len + 1) as *mut c_char;
if buffer.is_null() {
platform::errno = ENOMEM as c_int;
platform::errno.set(ENOMEM as c_int);
} else {
//memcpy(buffer, s1, len)
for i in 0..len {