reading env vars

This commit is contained in:
nora 2023-09-29 22:20:14 +02:00
parent ddba35d06b
commit 0c69d7db10
7 changed files with 121 additions and 16 deletions

View file

@ -6,3 +6,13 @@ pub(crate) unsafe extern "C" fn memset(ptr: *mut u8, constant: u8, len: usize) {
}
}
}
#[no_mangle]
pub(crate) unsafe extern "C" fn strlen(mut s: *const u8) -> usize {
let mut len = 0;
while s.read() != 0 {
len += 1;
s = s.add(1);
}
len
}