Added some support the new err(3) routines need
(Copied directly from NetBSD verbatim)
This commit is contained in:
parent
967cd26f61
commit
25a0fedd25
@ -45,7 +45,13 @@ static char sccsid[] = "@(#)crt0.c 5.7 (Berkeley) 7/3/91";
|
||||
* ebp, which points to the base of the kernel calling frame.
|
||||
*/
|
||||
|
||||
#include <stddef.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
||||
char **environ = (char **)0;
|
||||
static char empty[1];
|
||||
char *__progname = empty;
|
||||
int errno = 0;
|
||||
|
||||
asm(".text");
|
||||
@ -95,6 +101,12 @@ asm("eprol:");
|
||||
atexit(_mcleanup);
|
||||
monstartup(&eprol, &etext);
|
||||
#endif MCRT0
|
||||
errno = 0;
|
||||
if (argv[0])
|
||||
if ((__progname = strrchr(argv[0], '/')) == NULL)
|
||||
__progname = argv[0];
|
||||
else
|
||||
++__progname;
|
||||
exit(main(kfp->kargc, argv, environ));
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user