summaryrefslogtreecommitdiff
path: root/src/nonstd/__libc_start.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/nonstd/__libc_start.c')
-rw-r--r--src/nonstd/__libc_start.c26
1 files changed, 26 insertions, 0 deletions
diff --git a/src/nonstd/__libc_start.c b/src/nonstd/__libc_start.c
new file mode 100644
index 00000000..8dab57fb
--- /dev/null
+++ b/src/nonstd/__libc_start.c
@@ -0,0 +1,26 @@
+void __libc_start(int argc, char **argv)
+{
+ /*
+ struct __fopen_options fo = {0};
+
+ fo.fd = 0;
+ stdin = __libc.stdio.fopen(&fo);
+
+ fo.fd = 1;
+ stdout = __libc.stdio.fopen(&fo);
+
+ fo.fd = 2;
+ stderr = __libc.stdio.fopen(&fo);
+
+ #if defined _POSIX_SOURCE || defined _POSIX_C_SOURCE || defined _XOPEN_SOURCE
+ setlocale(LC_ALL, "POSIX");
+ #else
+ setlocale(LC_ALL, "C");
+ #endif
+ */
+ extern void exit(int);
+ extern int main(int, char*[]);
+
+ exit(main(argc, argv));
+}
+