avoid user-level segfault if a process doesn't call exit()

This commit is contained in:
Robert Morris 2022-08-10 06:37:21 -04:00
parent 872fa88e8a
commit 76ad8e974f
2 changed files with 12 additions and 1 deletions

View file

@ -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)
{