Path: utzoo!attcan!uunet!lll-winken!lll-tis!ames!mailrus!tut.cis.ohio-state.edu!bloom-beacon!apple!dwb From: dwb@Apple.COM (David W. Berry) Newsgroups: comp.unix.aux Subject: Re: Bug in console emulator Keywords: bugs Message-ID: <15956@apple.Apple.COM> Date: 22 Aug 88 19:48:48 GMT References: <121@fishpond.UUCP> Reply-To: dwb@apple.com.UUCP (David W. Berry) Organization: Apple Computer Inc, Cupertino, CA Lines: 34 In article <121@fishpond.UUCP> fnf@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 > >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@sun.com dwb@apple.com 973-5168@408.MaBell