aboutsummaryrefslogtreecommitdiffstats
path: root/src/crt/crt0.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/crt/crt0.c')
-rw-r--r--src/crt/crt0.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/crt/crt0.c b/src/crt/crt0.c
index ccdb2eb..35c3fa9 100644
--- a/src/crt/crt0.c
+++ b/src/crt/crt0.c
@@ -25,12 +25,20 @@ extern int main(int, char **);
static void stdio_init(void);
+/**
+ * Entry point for userland programs.
+ * Sets up stdio, then enters the program's main() before exiting with main()'s
+ * return code.
+ */
void _start(void)
{
stdio_init();
exit(main(0, 0));
}
+/**
+ * Initializes file handles for stdout, stdin, and stderr.
+ */
void stdio_init(void)
{
stderr = calloc(1, sizeof(FILE));