avoid user-level segfault if a process doesn't call exit()
This commit is contained in:
parent
872fa88e8a
commit
76ad8e974f
2 changed files with 12 additions and 1 deletions
11
user/ulib.c
11
user/ulib.c
|
@ -3,6 +3,17 @@
|
|||
#include "kernel/fcntl.h"
|
||||
#include "user/user.h"
|
||||
|
||||
//
|
||||
// wrapper so that it's OK if main() does not call exit().
|
||||
//
|
||||
void
|
||||
_main()
|
||||
{
|
||||
extern int main();
|
||||
main();
|
||||
exit(0);
|
||||
}
|
||||
|
||||
char*
|
||||
strcpy(char *s, const char *t)
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue