[libc] Change exit status from int to long

Slightly breaking the C standard, but in a way that's unlikely to break
things - allow 64-bit process exit status codes.
This commit is contained in:
2024-04-27 12:58:51 -07:00
parent 3b9efc11d0
commit bab2dd5c69
6 changed files with 14 additions and 14 deletions

View File

@@ -46,7 +46,7 @@ process::create_kernel_process(page_table *pml4)
}
void
process::exit(int32_t code)
process::exit(int64_t code)
{
if (m_state == state::exited)
return;

View File

@@ -42,7 +42,7 @@ public:
/// Terminate this process.
/// \arg code The return code to exit with.
void exit(int32_t code);
void exit(int64_t code);
/// Get the process' virtual memory space
vm_space & space() { return m_space; }
@@ -95,7 +95,7 @@ private:
// This constructor is called by create_kernel_process
process(page_table *kpml4);
int32_t m_return_code;
int64_t m_return_code;
vm_space m_space;

View File

@@ -29,10 +29,10 @@ process_kill(process *self)
}
j6_status_t
process_exit(int32_t status)
process_exit(int64_t status)
{
process &p = process::current();
log::info(logs::task, "Process <%02lx> exiting with code %d", p.obj_id(), status);
log::info(logs::task, "Process <%02lx> exiting with code %#lx", p.obj_id(), status);
p.exit(status);