#include <stdlib.h>
#include <unistd.h>
+#include <errno.h>
/*
* Prototypes.
__init_stdio();
/*
+ * Note: It is possible that any initialization done above could
+ * have resulted in errno being set nonzero, so set it to 0 before
+ * we call main.
+ */
+ errno = 0;
+
+ /*
* Finally, invoke application's main and then exit.
*/
exit(main(argc, argv, envp));
/*
* Declare the __environ global variable and create a weak alias environ.
+ * Note: Apparently we must initialize __environ for the weak environ
+ * symbol to be included.
*/
char **__environ = 0;