[comp.lang.perl] ioctl problems under SunOS 4.0

ira@isg.llnl.gov (Ira Morrison) (02/22/91)

I am a new perl user and am having a problem with ioctl.  I'm running
on a Sun with SunOS 4.0.  The description of ioctl in the perl man
pages (i don't have the book yet) seems to imply using the packing for
the older version of ioctl (e.g. ccccs).  The Sun manual says it uses
the older System V ioctl structure for some calls but the structure is
defined as 4Sc8C.  The manual spends most of its space on discussion of
ioctl based on ioctls.h with a structure of 4L18C.  I am trying to do
RAW terminal io.  The work around using stty described in the most
frequently asked questions seem to work but I would like to use the
more elegant ioctl approach.  Anyone have any Sun experience in this
area?

rbj@uunet.UU.NET (Root Boy Jim) (02/22/91)

In article <91696@lll-winken.LLNL.GOV> ira@isg.llnl.gov (Ira Morrison) writes:
>I am a new perl user and am having a problem with ioctl.  I'm running
>on a Sun with SunOS 4.0.  The description of ioctl in the perl man
>pages (i don't have the book yet) seems to imply using the packing for
>the older version of ioctl (e.g. ccccs).

SunOS uses the new SV tty driver, but pushes a compatibility
Streams module that translates the old BSD ioctls to the new format.

Try man 3 stty, which points you towards ttcompat(4).
With Sun, you can choose to use either one. 
Look in perl's h2pl directory at cbreak.pl.

Use the model that you find most palatable.
If you have no preference, use the new one.

The new SV tty driver is superior to the old BSD one, because:
(1) the entire state can be retrieved or altered in one operation
(2) the driver has more bits, so each can work independently
(3) System V has to do something right occasionally :-)
(4) BSD fought for its extended chars and got them adopted by POSIX.
    BSD now uses the new driver, too.
-- 
		[rbj@uunet 1] stty sane
		unknown mode: sane