aboutsummaryrefslogtreecommitdiffstats
path: root/src/crt
diff options
context:
space:
mode:
authorClyne Sullivan <clyne@bitgloo.com>2020-01-24 09:15:46 -0500
committerClyne Sullivan <clyne@bitgloo.com>2020-01-24 09:15:46 -0500
commita5892b35233748b2fcff1f726314c9a8df749f9c (patch)
treea666f7f73b8926b2518b578b9416209395908a6e /src/crt
parent998b3ac86e3b3f926d81e768f1200815e9e3d148 (diff)
Reviewed stmos, made small format/doc fixes
Diffstat (limited to 'src/crt')
-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));