SCCS-vsn: lib/csu/hp300/crt0.c 5.8
SCCS-vsn: lib/csu/i386/crt0.c 5.9
SCCS-vsn: lib/csu/sparc/crt0.c 5.2
SCCS-vsn: lib/csu/tahoe/crt0.c 5.5
SCCS-vsn: lib/csu/vax/crt0.c 5.12
-static char sccsid[] = "@(#)crt0.c 5.7 (Berkeley) %G%";
+static char sccsid[] = "@(#)crt0.c 5.8 (Berkeley) %G%";
+#include <stddef.h>
+#include <stdlib.h>
+#include <string.h>
+
char **environ = (char **)0;
char **environ = (char **)0;
+static char empty[1];
+char *__progname = empty;
static int fd;
extern unsigned char etext;
static int fd;
extern unsigned char etext;
#ifdef lint
kfp = 0;
initcode = initcode = 0;
#ifdef lint
kfp = 0;
initcode = initcode = 0;
asm("lea a6@(4),%0" : "=r" (kfp)); /* catch it quick */
asm("lea a6@(4),%0" : "=r" (kfp)); /* catch it quick */
for (argv = targv = &kfp->kargv[0]; *targv++; /* void */)
/* void */ ;
if (targv >= (char **)(*argv))
for (argv = targv = &kfp->kargv[0]; *targv++; /* void */)
/* void */ ;
if (targv >= (char **)(*argv))
fd = open("/dev/null", 2);
} while (fd >= 0 && fd < 3);
close(fd);
fd = open("/dev/null", 2);
} while (fd >= 0 && fd < 3);
close(fd);
#ifdef MCRT0
atexit(_mcleanup);
monstartup(&eprol, &etext);
#ifdef MCRT0
atexit(_mcleanup);
monstartup(&eprol, &etext);
+ if (argv[0])
+ if ((__progname = strrchr(argv[0], '/')) == NULL)
+ __progname = argv[0];
+ else
+ ++__progname;
exit(main(kfp->kargc, argv, environ));
}
exit(main(kfp->kargc, argv, environ));
}
-static char sccsid[] = "@(#)crt0.c 5.8 (Berkeley) %G%";
+static char sccsid[] = "@(#)crt0.c 5.9 (Berkeley) %G%";
* which points to the base of the kernel calling frame.
*/
* which points to the base of the kernel calling frame.
*/
+#include <stddef.h>
+#include <stdlib.h>
+#include <string.h>
+
char **environ = (char **)0;
char **environ = (char **)0;
+static char empty[1];
+char *__progname = empty;
static int fd;
asm(".text");
static int fd;
asm(".text");
#ifdef lint
kfp = 0;
initcode = initcode = 0;
#ifdef lint
kfp = 0;
initcode = initcode = 0;
asm("lea 4(%ebp),%ebx"); /* catch it quick */
asm("lea 4(%ebp),%ebx"); /* catch it quick */
for (argv = targv = &kfp->kargv[0]; *targv++; /* void */)
/* void */ ;
if (targv >= (char **)(*argv))
for (argv = targv = &kfp->kargv[0]; *targv++; /* void */)
/* void */ ;
if (targv >= (char **)(*argv))
fd = open("/dev/null", 2);
} while (fd >= 0 && fd < 3);
close(fd);
fd = open("/dev/null", 2);
} while (fd >= 0 && fd < 3);
close(fd);
#ifdef MCRT0
atexit(_mcleanup);
monstartup(&eprol, &etext);
#ifdef MCRT0
atexit(_mcleanup);
monstartup(&eprol, &etext);
+ if (argv[0])
+ if ((__progname = strrchr(argv[0], '/')) == NULL)
+ __progname = argv[0];
+ else
+ ++__progname;
exit(main(kfp->kargc, argv, environ));
}
exit(main(kfp->kargc, argv, environ));
}
-static char sccsid[] = "@(#)crt0.c 5.1 (Berkeley) %G%";
+static char sccsid[] = "@(#)crt0.c 5.2 (Berkeley) %G%";
#endif /* not lint */
/*
* C start up routine.
*/
#endif /* not lint */
/*
* C start up routine.
*/
+#include <stddef.h>
+#include <stdlib.h>
+#include <string.h>
+
char **environ = (char **)0;
char **environ = (char **)0;
+static char empty[1];
+char *__progname = empty;
extern unsigned char etext[];
extern volatile void start() asm("start0");
extern unsigned char eprol[] asm("eprol");
extern void _mcleanup(void);
extern unsigned char etext[];
extern volatile void start() asm("start0");
extern unsigned char eprol[] asm("eprol");
extern void _mcleanup(void);
-volatile void exit(int);
volatile void
start(void)
volatile void
start(void)
atexit(_mcleanup);
errno = 0;
#endif
atexit(_mcleanup);
errno = 0;
#endif
+ if (argv[0])
+ if ((__progname = strrchr(argv[0], '/')) == NULL)
+ __progname = argv[0];
+ else
+ ++__progname;
exit(main(argc, argv, envp));
exit(main(argc, argv, envp));
asm(".globl mcount");
asm(".globl _moncontrol");
asm("mcount: _moncontrol: retl; nop");
asm(".globl mcount");
asm(".globl _moncontrol");
asm("mcount: _moncontrol: retl; nop");
-static char sccsid[] = "@(#)crt0.c 5.4 (Berkeley) %G%";
+static char sccsid[] = "@(#)crt0.c 5.5 (Berkeley) %G%";
* which points to the base of the kernel calling frame.
*/
* which points to the base of the kernel calling frame.
*/
+#include <stddef.h>
+#include <stdlib.h>
+#include <string.h>
+
char **environ = (char **)0;
char **environ = (char **)0;
+static char empty[1];
+char *__progname = empty;
static int fd;
extern unsigned char etext;
static int fd;
extern unsigned char etext;
#ifdef MCRT0
monstartup(&eprol, &etext);
#ifdef MCRT0
monstartup(&eprol, &etext);
+ if (argv[0])
+ if ((__progname = strrchr(argv[0], '/')) == NULL)
+ __progname = argv[0];
+ else
+ ++__progname;
exit(main(kfp->kargc, argv, environ));
}
exit(main(kfp->kargc, argv, environ));
}
_cleanup();
_exit(code);
}
_cleanup();
_exit(code);
}
-static char sccsid[] = "@(#)crt0.c 5.11 (Berkeley) %G%";
+static char sccsid[] = "@(#)crt0.c 5.12 (Berkeley) %G%";
* values of fp and ap.
*/
* values of fp and ap.
*/
+#include <stddef.h>
+#include <stdlib.h>
+#include <string.h>
+
char **environ = (char **)0;
char **environ = (char **)0;
+static char empty[1];
+char *__progname = empty;
static int fd;
extern unsigned char etext;
static int fd;
extern unsigned char etext;
#ifdef lint
kfp = 0;
initcode = initcode = 0;
#ifdef lint
kfp = 0;
initcode = initcode = 0;
kfp = (struct kframe *) environ;
kfp = (struct kframe *) environ;
for (argv = targv = &kfp->kargv[0]; *targv++; /* void */)
/* void */ ;
if (targv >= (char **)(*argv))
for (argv = targv = &kfp->kargv[0]; *targv++; /* void */)
/* void */ ;
if (targv >= (char **)(*argv))
fd = open("/dev/null", 2);
} while (fd >= 0 && fd < 3);
close(fd);
fd = open("/dev/null", 2);
} while (fd >= 0 && fd < 3);
close(fd);
#ifdef MCRT0
atexit(_mcleanup);
monstartup(&eprol, &etext);
#ifdef MCRT0
atexit(_mcleanup);
monstartup(&eprol, &etext);
+ if (argv[0])
+ if ((__progname = strrchr(argv[0], '/')) == NULL)
+ __progname = argv[0];
+ else
+ ++__progname;
exit(main(kfp->kargc, argv, environ));
}
exit(main(kfp->kargc, argv, environ));
}