This is the mail archive of the mailing list for the newlib project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

libgloss/arm: isatty [PATCH]

In a previous patch I removed a stub definition of isatty from
syscalls.c and replaced it with _isatty, which calls the IsTTY SWI.
libgloss for arm does need a isatty implementation though, since it
doesn't (yet) use the copy from newlib/libc/posix -- although I would
like to fix that one day if it's possible. So, I implemented an isatty
that simply calls _isatty, which in turn calls the IsTTY SWI. However,
the GDB simulator arm-elf-run does not yet support the IsTTY SWI,
meaning even "Hello, world!" fails to run. So, in the mean time I
suggest using an implementation that always returns true, as was the
case previously, until GDB implements IsTTY -- perhaps I'll do that


2005-07-28  Shaun Jackman  <>

	* libgloss/arm/libcfunc.c (isatty): New function.

diff -u -r1.2 libcfunc.c
--- libgloss/arm/libcfunc.c	18 Jul 2005 16:18:17 -0000	1.2
+++ libgloss/arm/libcfunc.c	28 Jul 2005 21:56:02 -0000
@@ -43,6 +43,16 @@
 	return 0;
+int _isatty(int fildes);
+int __attribute__((weak))
+isatty(int fildes)
+	/* GDB does not yet support the IsTTY SWI that _isatty
+	 * calls, so always return true for now. */
+	(void)fildes;
+	return 1;
 int __attribute__((weak))
 pause (void)

Attachment: libgloss-isatty.diff
Description: Binary data

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]