mirror of
https://github.com/DragonOS-Community/DragonOS.git
synced 2025-06-21 00:06:32 +00:00
🆕 libc新增_start函数,实现main的返回值的捕获
This commit is contained in:
10
user/libs/libc/sysdeps/x86_64/elf/start.c
Normal file
10
user/libs/libc/sysdeps/x86_64/elf/start.c
Normal file
@ -0,0 +1,10 @@
|
||||
|
||||
extern int main(int, char**);
|
||||
#include<libc/stdio.h>
|
||||
void _start(int argc, char** argv)
|
||||
{
|
||||
printf("before main\n");
|
||||
int retval = main(argc, argv);
|
||||
printf("before exit, code=%d\n", retval);
|
||||
exit(retval);
|
||||
}
|
Reference in New Issue
Block a user