Welcome to mirror list, hosted at ThFree Co, Russian Federation.

cygwin.com/git/newlib-cygwin.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeff Johnston <jjohnstn@redhat.com>2002-07-11 02:15:49 +0400
committerJeff Johnston <jjohnstn@redhat.com>2002-07-11 02:15:49 +0400
commit2a8b4ea32b647fefa008264b45cbcc9e34dfe0a9 (patch)
treebefadd689ae66bb2fa443602e8e2b97621d6e091 /newlib/libc/sys
parentef8c6116b3aa35e35955ea9847fa133e5a8bd02e (diff)
2002-07-10 Florian Shrack <florian.schrack@freenet.de>
* libc/sys/mmixware/read.c: Use SYS_Fgets syscall if dealing with a terminal. * libc/sys/mmixware/sys/syscall.h (SYS_Fgets): Definition added.
Diffstat (limited to 'newlib/libc/sys')
-rw-r--r--newlib/libc/sys/mmixware/read.c10
-rw-r--r--newlib/libc/sys/mmixware/sys/syscall.h1
2 files changed, 11 insertions, 0 deletions
diff --git a/newlib/libc/sys/mmixware/read.c b/newlib/libc/sys/mmixware/read.c
index 9a7e98f66..f0f5e22f9 100644
--- a/newlib/libc/sys/mmixware/read.c
+++ b/newlib/libc/sys/mmixware/read.c
@@ -30,6 +30,16 @@ _read (int file,
return -1;
}
+ if (isatty(file))
+ {
+ ret = TRAP3f (SYS_Fgets, file, ptr, len);
+
+ if (ret == -1)
+ return 0;
+
+ return ret;
+ }
+
ret = TRAP3f (SYS_Fread, file, ptr, len);
/* Map the return codes:
diff --git a/newlib/libc/sys/mmixware/sys/syscall.h b/newlib/libc/sys/mmixware/sys/syscall.h
index 15a2d1c09..e9e1ff4db 100644
--- a/newlib/libc/sys/mmixware/sys/syscall.h
+++ b/newlib/libc/sys/mmixware/sys/syscall.h
@@ -17,6 +17,7 @@
#define SYS_Fopen 1
#define SYS_Fclose 2
#define SYS_Fread 3
+#define SYS_Fgets 4
#define SYS_Fwrite 6
#define SYS_Fseek 9
#define SYS_Ftell 10