/* KallistiOS ##version##

   newlib_isatty.c
   Copyright (C) 2004 Dan Potter
   Copyright (C) 2012 Lawrence Sebald

*/

#include <sys/reent.h>

int isatty(int fd) {
    /* Make sure that stdin, stdout, and stderr are shown as ttys, otherwise
       they won't be set as line-buffered. */
    if(fd >= 0 && fd <= 2) {
        return 1;
    }

    return 0;
}

int _isatty_r(struct _reent *reent, int fd) {
    /* Make sure that stdin, stdout, and stderr are shown as ttys, otherwise
       they won't be set as line-buffered.*/
    if(fd >= 0 && fd <= 2) {
        return 1;
    }

    return 0;
}

/* KallistiOS ##version##

   newlib_isatty.c
   Copyright (C)2004 Dan Potter

*/

#include <sys/reent.h>

int isatty(int fd) {
    return 0;
}

int _isatty_r(struct _reent *reent, int fd) {
    return 0;
}

--- 
+++ 
@@ -1,16 +1,29 @@
 /* KallistiOS ##version##
 
    newlib_isatty.c
-   Copyright (C)2004 Dan Potter
+   Copyright (C) 2004 Dan Potter
+   Copyright (C) 2012 Lawrence Sebald
 
 */
 
 #include <sys/reent.h>
 
 int isatty(int fd) {
+    /* Make sure that stdin, stdout, and stderr are shown as ttys, otherwise
+       they won't be set as line-buffered. */
+    if(fd >= 0 && fd <= 2) {
+        return 1;
+    }
+
     return 0;
 }
 
 int _isatty_r(struct _reent *reent, int fd) {
+    /* Make sure that stdin, stdout, and stderr are shown as ttys, otherwise
+       they won't be set as line-buffered.*/
+    if(fd >= 0 && fd <= 2) {
+        return 1;
+    }
+
     return 0;
 }
Make it so that stdin/stdout/stderr will be set as line buffered (newlib has to think they're ttys if we have fcntl, which we do now).


