[comp.sources.d] atty on Sun 3

simcha@kurz-ai.UUCP (Simcha Lerner) (06/01/89)

Has anyone had any luck getting atty running under Sun OS 4.0
on a Sun 3?

I get an Abort with "set pty modes: Inappropriate ioctl for device"
whenever I try to start atty up.

simcha lerner
talcott!kurz-ai!simcha

schmidt@ics.uci.edu (Doug Schmidt) (06/02/89)

In article <280@kurz-ai.UUCP> simcha@kurz-ai.UUCP (Simcha Lerner) writes:
++ 
++ Has anyone had any luck getting atty running under Sun OS 4.0
++ on a Sun 3?
++ 
++ I get an Abort with "set pty modes: Inappropriate ioctl for device"
++ whenever I try to start atty up.

Did you happen to compile with GCC by any chance?  If so, did you remember
to supply the -traditional option?  If you didn't, this is what you're
probably going to get.  Use -traditional, and the problem should go away...

Doug
--
On a clear day, under blue skies, there is no need to seek.
And asking about Buddha                +------------------------+
Is like proclaiming innocence,         | schmidt@ics.uci.edu    |
With loot in your pocket.              | office: (714) 856-4043 |

simcha@kurz-ai.UUCP (Simcha Lerner) (06/02/89)

In article <16363@paris.ics.uci.edu> Doug Schmidt <schmidt@zola.ics.uci.edu> writes:
>In article <280@kurz-ai.UUCP> simcha@kurz-ai.UUCP (Simcha Lerner) writes:
>++ 
>++ Has anyone had any luck getting atty running under Sun OS 4.0
>++ on a Sun 3?
>++ 
>++ I get an Abort with "set pty modes: Inappropriate ioctl for device"
>++ whenever I try to start atty up.
>
>Did you happen to compile with GCC by any chance?  If so, did you remember
>to supply the -traditional option?  If you didn't, this is what you're
>probably going to get.  Use -traditional, and the problem should go away...
>
>Doug

Alas, I am using the standard Sun provided cc, so this doesn't fix it.
Has anyone out there had success getting atty up on a Sun?

simcha lerner
talcott!kurz-ai!simcha

no return mail via bbn please

worsley@ditmela.oz (Andrew Worsley) (06/05/89)

From article <283@kurz-ai.UUCP>, by simcha@kurz-ai.UUCP (Simcha Lerner):
> In article <16363@paris.ics.uci.edu> Doug Schmidt <schmidt@zola.ics.uci.edu> writes:
>>In article <280@kurz-ai.UUCP> simcha@kurz-ai.UUCP (Simcha Lerner) writes:
>>++ 
>>++ Has anyone had any luck getting atty running under Sun OS 4.0
>>++ on a Sun 3?
>>++ 
>>++ I get an Abort with "set pty modes: Inappropriate ioctl for device"
>>++ whenever I try to start atty up.
>>
Did you happen to compile with GCC by any chance?  If so, did you remember
to supply the -traditional option?  If you didn't, this is what you're
probably going to get.  Use -traditional, and the problem should go away...

Doug
 
%Alas, I am using the standard Sun provided cc, so this doesn't fix it.
%Has anyone out there had success getting atty up on a Sun?

  We have successfully run it on SunOS 3.5 machine but NOT SunOS 4.0. It appears
  to make copious use of now obsoleted ioctl's. 

	Andrew Worsley




-- 
Division of Information Technology (Melbourne), Phone +61 3 347 8644
C.S.I.R.O.                                      Fax  +61 3 347 8987
55 Barry St.                                    Telex AA 152914
Carlton, Vic, 3053, Australia                   E-mail: worsley@ditmela.oz.au

len@array.UUCP (Leonard Vanek) (06/05/89)

I compiled it on a Sun 3/160 running (I think) SunOS v. 3.5 and it
works fine. No changes were required to the make file.

Len

guy@auspex.auspex.com (Guy Harris) (06/07/89)

>I compiled it on a Sun 3/160 running (I think) SunOS v. 3.5 and it
>works fine. No changes were required to the make file.

It's a pre-4.x vs. 4.x difference; the streams-based tty driver in 4.x
makes it harder to make the "tty 'ioctl's on the master side'" grot work
than does the pretty much vanilla 4.xBSD tty driver in pre-4.x releases.

guy@auspex.auspex.com (Guy Harris) (06/07/89)

>  We have successfully run it on SunOS 3.5 machine but NOT SunOS 4.0.
>  It appears to make copious use of now obsoleted ioctl's. 

Excuse me?  To which "ioctl"s are you referring?  The "ioctl"s it uses
are:

	TIOCREMOTE, TIOCPKT - all documented in the 4.0 PTY(4)

	TIOCNOTTY - documented in the 4.0 TTY(4) (documentation for
	   "/dev/tty")

	TIOCGPGRP, TIOCSPGRP, TIOCGWINSZ, TIOCSWINSZ - documented in
	   the 4.0 TERMIO(4) (and, for the latter two, in PTY(4)

	TIOCFLUSH, TIOCGETP, TIOCGETC, TIOCLGET, TIOCGLTC, TIOCSETP,
	    TIOCSETC, TIOCLSET, TIOCSLTC - documented in the 4.0
	    TTCOMPAT(4M)

	TIOCGETD, TIOCSETD - the only ones not documented, although they
	    still do work to a *limited* degree (there are no "line
	    disciplines" *per se* in 4.0, just streams modules; however,
	    for a small set of "line discipline" numbers, it attempts to
	    shuffle streams modules around to make those "ioctl"s work,
	    for binary compatibility)

The "ioctl"s documented in TTCOMPAT(4M) are *not* considered "obsolete"
in the sense of "unsupported".  If you're writing a program to run on
4.xBSD-flavored systems, they're the right ones to use (at least until
Berkeley drops them, if they in fact do so when going to a POSIX-style
tty driver).

The problem is solely that "atty" was depending on an undocumented quirk
of the BSD pseudo-tty driver implementation, namely that all "ioctl"s
that work on the slave side of a pseudo-tty work on the master side as
well.  Fixes have been posted.  Please, no more third-hand speculation
on what the problem is.