Bug in console emulator

David W. Berry dwb at Apple.COM
Tue Aug 23 05:48:48 AEST 1988


In article <121 at fishpond.UUCP> fnf at fishpond.UUCP (Fred Fish) writes:
>The following demonstrates what looks like a problem with the
>"A/UX Initial Console Emulator".  Can anyone suggest any workarounds?
>Thanks.
>-Fred
	Nope, I'd say it looks like a problem with your test
program.  isatty and ttyname both work on a file descriptor
and your passing it a FILE structure.  Try replacing stdin with
fileno(stdin) and similar for stdout and stderr and you'll get
what you expect.
>
>----------------------------------------------------------------------
>Script started on Fri Aug 19 12:50:04 1988
>fishpond:222> cat bug.c
>#include <stdio.h>
>
>main ()
>{
>        extern char *ttyname ();
>        extern int isatty ();
>
>        printf ("isatty (stdin) = %d\n", isatty (stdin));
>        printf ("isatty (stdout) = %d\n", isatty (stdout));
>        printf ("isatty (stderr) = %d\n", isatty (stderr));
>        printf ("ttyname (stdin) = %s\n", ttyname (stdin));
>        printf ("ttyname (stdout) = %s\n", ttyname (stdout));
>        printf ("ttyname (stderr) = %s\n", ttyname (stderr));
>}


Opinions:  MINE, ALL MINE! (greedy evil chuckle)

David W. Berry
apple!dwb at sun.com	dwb at apple.com	973-5168 at 408.MaBell



More information about the Comp.unix.aux mailing list