ciabatta/src/linux/entry.c

25 lines
480 B
C
Raw Normal View History

2023-07-22 14:30:04 +00:00
2023-07-22 16:28:16 +00:00
int __stack_chk_fail() {
// TODO: implement proper stack protector support
return 0;
}
2023-07-22 14:30:04 +00:00
void __libc_start_main(
int (*main)(int, char**, char**),
int argc, char **argv,
int (*init)(int, char**, char**),
void (*fini)(void),
void (*dl_fini)(void),
2023-07-22 14:30:04 +00:00
void *stack_end
) {
// Get the envp
2023-07-22 16:28:16 +00:00
char **envp = argv + (argc + 1);
init(argc, argv, envp);
main(argc, argv, envp);
fini();
// glibc bug
dl_fini();
2023-07-22 14:30:04 +00:00
syscall_exit(0);
}