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.c20
1 files changed, 9 insertions, 11 deletions
diff --git a/src/nonstd/__libc_start.c b/src/nonstd/__libc_start.c
index 4b0b773e..d8fd5875 100644
--- a/src/nonstd/__libc_start.c
+++ b/src/nonstd/__libc_start.c
@@ -8,33 +8,32 @@
#include "unistd.h"
#else
#define DEFAULT_LOCALE "C"
-#include "nonstd/syscall.h"
+#include "../_syscall.h"
#include "../termios/NCCS.c"
#include "../termios/cc_t.c"
#include "../termios/tcflag_t.c"
#include "../termios/struct_termios.c"
static struct termios __tios;
-#define isatty(fd) (__syscall(__lookup("tcgetattr"), fd, &__tios) == 0)
+#define isatty(fd) (__syscall(__syscall_lookup(tcgetattr), fd, &__tios) == 0)
#endif
void __libc_start(int argc, char **argv)
{
extern int main(int, char*[]);
- struct __FILE *files = __libc(FILE_STREAMS);
- stdin = files + 0;
+ stdin = __stdio.FILES + 0;
stdin->fd = 0;
- freopen(NULL, "r", stdin);
+ /* freopen(", "r", stdin); */
setvbuf(stdin, NULL, isatty(0) ? _IOLBF : _IOFBF, BUFSIZ);
- stdout = files + 1;
+ stdout = __stdio.FILES + 1;
stdout->fd = 1;
- freopen(NULL, "w", stdout);
+ /* freopen(NULL, "w", stdout); */
setvbuf(stdin, NULL, isatty(1) ? _IOLBF : _IOFBF, BUFSIZ);
- stderr = files + 2;
+ stderr = __stdio.FILES + 2;
stderr->fd = 2;
- freopen(NULL, "w", stderr);
+ /* freopen(NULL, "w", stderr); */
setvbuf(stderr, NULL, _IONBF, 0);
stdin->next = stdout;
@@ -43,8 +42,7 @@ void __libc_start(int argc, char **argv)
stdout->prev = stdin;
stderr->prev = stdout;
- setlocale(LC_ALL, DEFAULT_LOCALE);
-
+ /* setlocale(LC_ALL, DEFAULT_LOCALE); */
exit(main(argc, argv));
}