From 60c3831e53b7afa5dd372601250e7e8739329383 Mon Sep 17 00:00:00 2001 From: Jakob Kaivo Date: Wed, 12 Aug 2020 12:52:58 -0400 Subject: move more stuff out of nonstd/ --- src/nonstd/__libc_start.c | 48 ----------------------------------------------- 1 file changed, 48 deletions(-) delete mode 100644 src/nonstd/__libc_start.c (limited to 'src/nonstd/__libc_start.c') diff --git a/src/nonstd/__libc_start.c b/src/nonstd/__libc_start.c deleted file mode 100644 index d8fd5875..00000000 --- a/src/nonstd/__libc_start.c +++ /dev/null @@ -1,48 +0,0 @@ -#include "stdlib.h" -#include "stdio.h" -#include "locale.h" -#include "../stdio/_stdio.h" - -#ifdef _POSIX_SOURCE -#define DEFAULT_LOCALE "POSIX" -#include "unistd.h" -#else -#define DEFAULT_LOCALE "C" -#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(__syscall_lookup(tcgetattr), fd, &__tios) == 0) -#endif - -void __libc_start(int argc, char **argv) -{ - extern int main(int, char*[]); - - stdin = __stdio.FILES + 0; - stdin->fd = 0; - /* freopen(", "r", stdin); */ - setvbuf(stdin, NULL, isatty(0) ? _IOLBF : _IOFBF, BUFSIZ); - - stdout = __stdio.FILES + 1; - stdout->fd = 1; - /* freopen(NULL, "w", stdout); */ - setvbuf(stdin, NULL, isatty(1) ? _IOLBF : _IOFBF, BUFSIZ); - - stderr = __stdio.FILES + 2; - stderr->fd = 2; - /* freopen(NULL, "w", stderr); */ - setvbuf(stderr, NULL, _IONBF, 0); - - stdin->next = stdout; - stdout->next = stderr; - - stdout->prev = stdin; - stderr->prev = stdout; - - /* setlocale(LC_ALL, DEFAULT_LOCALE); */ - - exit(main(argc, argv)); -} -- cgit v1.2.1