bunpen: exec: log more verbosely

This commit is contained in:
2024-12-23 03:16:09 +00:00
parent c12a6ae57e
commit 3774e61ec7

View File

@@ -2,6 +2,7 @@
use errors; use errors;
use errors::ext; use errors::ext;
use fmt;
use log; use log;
use os; use os;
use os::exec; use os::exec;
@@ -13,6 +14,16 @@ use types::c;
export fn execve(path: str, argv: []str, envp: []str = []) rt::errno = { export fn execve(path: str, argv: []str, envp: []str = []) rt::errno = {
let path_buf: [path::MAX]c::char = [0...]; let path_buf: [path::MAX]c::char = [0...];
{
let logv: []fmt::formattable = [];
defer free(logv);
append(logv, "[exec] execve:");
append(logv, path);
for (let arg .. argv)
append(logv, arg);
log::println(logv...);
};
syscall( syscall(
rt::SYS_execve, rt::SYS_execve,
make_cstr(&path_buf, path): uintptr: u64, make_cstr(&path_buf, path): uintptr: u64,