Serial Port Programming for a SUN 3/80

Robert Perlberg number1!perl%step at uunet.uu.net
Tue Feb 19 05:43:00 AEST 1991


You should look at the manual pages for stty(1), ioctl(2), and termio(4).
Termio(4) will explain all about how to use the ioctl() function to set
baud rate, parity, and a bunch of other parameters on tty ports.  The stty
command can be used to make these same settings from a shell prompt or
within a shell script (or even with a C program using system(3), if you
are so inclined, but ioctl is the preferred method).

If you want to set the tty settings from within the lpr spooler, use the
`ms' capability in the printcap.  You pass it a set of arguments to be
used with stty(1), e.g.:

	:ms=parenb -parodd cs7 -cstopb:

Robert Perlberg
Dean Witter Reynolds Inc., New York
{murphy | philabs | chuo}!step!perl



More information about the Comp.sys.sun mailing list