char **environ;
const char *__progname = "";
+char ***_penviron;
+
__dead void _start1(fptr, int, char *[]);
/* The entry function, C part. */
char **env;
const char *s;
+ _penviron = &environ;
+
env = argv + argc + 1;
environ = env;
if (argc > 0 && argv[0] != NULL) {
#include <stdlib.h>
#include <string.h>
+#if defined(__ELF__)
+extern const char *__progname;
+
+const char *
+getprogname(void)
+{
+
+ return (__progname);
+}
+
+void
+setprogname(const char *progname)
+{
+ const char *p;
+
+ p = strrchr(progname, '/');
+ if (p != NULL)
+ __progname = p + 1;
+ else
+ __progname = progname;
+}
+#else
static const char *theprogname = NULL;
extern const char **__prognamep; /* Copy of argv[]. */
extern int __argc; /* Copy of argc. */
{
theprogname = newprogname;
}
+#endif