relibc: add DEBUG marker write before relibc_verify_host

Temporary debugging aid to determine whether relibc_start_v1 is reached
before the init process crashes. Writes a marker to /scheme/debug/no-preserve
at the very start of relibc_start_v1, before any setup or verification.
This commit is contained in:
Red Bear OS
2026-07-10 20:43:25 +03:00
parent 54ed272d75
commit b2ba9d160a
+8
View File
@@ -160,6 +160,14 @@ pub unsafe extern "C" fn relibc_start_v1(
static __init_array_end: extern "C" fn();
}
// DEBUG: Earliest possible output before any other init
if let Ok(mut f) = unsafe {
redox_rt::call::open("/scheme/debug/no-preserve", redox_rt::flag::O_WRONLY, 0)
} {
let _ = redox_rt::call::write(f.as_raw_fd(), b"START: relibc_start_v1 entered\n");
let _ = redox_rt::call::close(f.as_raw_fd());
}
// Ensure correct host system before executing more system calls
unsafe { relibc_verify_host() };