23 lines
601 B
C
23 lines
601 B
C
// POSIX process startup. This file owns process-local POSIX personality initialization before main runs.
|
|
|
|
#include <stdint.h>
|
|
#include <ntlite/exception.h>
|
|
#include <ntlite/syscall.h>
|
|
|
|
extern int main(void);
|
|
extern void exit(int status);
|
|
extern void PosixFdInit(void);
|
|
|
|
// Initializes POSIX process state and exits with main's return value.
|
|
void PosixStart(void) {
|
|
uint32_t status = NtlInitializeExceptionRuntime();
|
|
if (status != NTLSTATUS_SUCCESS) {
|
|
for (;;) SysExitProcess((int32_t)status);
|
|
}
|
|
|
|
PosixFdInit();
|
|
int exitCode = main();
|
|
exit(exitCode);
|
|
for (;;) {}
|
|
}
|