diff options
author | Jeff Johnston <jjohnstn@redhat.com> | 2002-07-10 22:15:49 +0000 |
---|---|---|
committer | Jeff Johnston <jjohnstn@redhat.com> | 2002-07-10 22:15:49 +0000 |
commit | 2a8b4ea32b647fefa008264b45cbcc9e34dfe0a9 (patch) | |
tree | befadd689ae66bb2fa443602e8e2b97621d6e091 /newlib/libc | |
parent | ef8c6116b3aa35e35955ea9847fa133e5a8bd02e (diff) | |
download | newlib-2a8b4ea32b647fefa008264b45cbcc9e34dfe0a9.zip newlib-2a8b4ea32b647fefa008264b45cbcc9e34dfe0a9.tar.gz newlib-2a8b4ea32b647fefa008264b45cbcc9e34dfe0a9.tar.bz2 |
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')
-rw-r--r-- | newlib/libc/sys/mmixware/read.c | 10 | ||||
-rw-r--r-- | newlib/libc/sys/mmixware/sys/syscall.h | 1 |
2 files changed, 11 insertions, 0 deletions
diff --git a/newlib/libc/sys/mmixware/read.c b/newlib/libc/sys/mmixware/read.c index 9a7e98f..f0f5e22 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 15a2d1c..e9e1ff4 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 |