[mod.computers.vax] terminal baud rate

BRENT@uwovax.UWO.CDN.UUCP (04/09/87)

   Is there any system service (I think not) or other technique
that I can use to determine the baud rate for a process' controlling
terminal?  I have a need for such code.  It would be preferable to
allow a suitably privileged program to determine it based on PID, but
it would also be feasible to use code that determined this only for
the current job.  (NO, SHO TERMINAL to a file and parsing the result
is NOT suitable.)
   Thanks as always.  Brent.
--
Brent Sterner                                    ***********************
Lord Protector,  d i g i t a l  Systems          *                     *
Computing & Communications Services              *   ...this space     *
Natural Sciences Building                        *   for rent...       *
The University of Western Ontario                *   Apply within.     *
London, Ontario, Canada  N6A 5B7                 *                     *
Telephone (519)661-2151 x6036                    ***********************
Network     <BRENT@uwovax.UWO.CDN>  ! VAX 8600
            <A105@UWOCC1.BITNET>    ! IBM 4341

gwalker@SPCA.BBN.COM.UUCP (04/10/87)

You can do this with $QIOW. Once you've ASSIGNed a channel to the terminal,
you can use one of the function codes, IO$_SENSEMODE I think it's called,
to get various terminal settings and baud rate gets returned in the I/O
Status Block.  Read about it in the Terminals section of the I/O manual.

As for getting the info for another terminal other than the running one, I
would guess that if you have enough privilege to assign a channel to the
other terminal and do the $QIOW, that should do it. (Perhaps LOG_IO is the
privilege needed?)

-- Gail Walker

nagy%43198.hepnet@LBL.ARPA.UUCP (04/10/87)

A $QIO with I/O function SENSEMODE or SENSECHAR to the terminal driver
will return the baud rate.  Look in the I/O User's Guide, part 1 under
the terminal driver.

oberman@LLL-ICDC.ARPA.UUCP (04/10/87)

>A program with SHARE privilege can assign a channel to the terminal even if
>someone else is using it.  That's how SHOW TERM is able to get information
>about terminals that are in use.

>It's interesting that SHOW TERM does NOT display to baud rate for other ter-
>minals, although it displays everything else.  As far as I know - I've never
>tried this - the speed information is returned, it's just that SHOW TERM
>chooses not to display it.

It's not that SHOW TERM doesn't choose to dispaly to display it. It's that
it does not have the priv. needed to get the speed. SHOW TERM does show
the spped of another terminal unless the process has SHARE. If the prcess
has SHARE SHOW TERM returns the same information for another terminal as
it does for your own.

					R. Kevin Oberman
					Lawrence Livermore Nat'l Laboratory
					arpa: oberman@lll-icdc.arpa
					(415) 422-6955
------

LEICHTER-JERRY@YALE.ARPA.UUCP (04/11/87)

    [To determine the baud rate of a terminal...]
    1. Assign a channel to the terminal.
    2. Issue a QIO to the terminal using IO$_SENSECHAR or IO$_SENSEMODE.
    3. Baud rate is in the second word of the IOSB.  Reference VAX/VMS I/O
    User's Reference Manual: Part I, AA-Z600C-TE, April 1986, page 8-49.
    4. If TT2$M_AUTOBAUD is set then the baud rate in 3 is the default baud
    rate unless a user is logged in.

    The above only works if you can assign a channel to the terminal.  If
    you want something that works all the time then you will have to write
    some kernel mode code to access the UCB of the terminal....

A program with SHARE privilege can assign a channel to the terminal even if
someone else is using it.  That's how SHOW TERM is able to get information
about terminals that are in use.

It's interesting that SHOW TERM does NOT display to baud rate for other ter-
minals, although it displays everything else.  As far as I know - I've never
tried this - the speed information is returned, it's just that SHOW TERM
chooses not to display it.
							-- Jerry
-------