date and time created 81/08/11 23:39:51 by dlw
[unix-history] / usr / src / usr.bin / f77 / libU77 / ttynam_.c
CommitLineData
d4fbfe35
DW
1/*
2char id_ttynam[] = "@(#)ttynam_.c 1.1";
3 *
4 * Return name of tty port associated with lunit
5 *
6 * calling sequence:
7 * character*19 string, ttynam
8 * string = ttynam (lunit)
9 * where:
10 * the character string will be filled with the name of
11 * the port, preceded with '/dev/', and blank padded.
12 * (19 is the max length ever required)
13 */
14
15#include "../libI77/fiodefs.h"
16
17extern unit units[];
18
19ttynam_(name, strlen, lu)
20char *name; long strlen; long *lu;
21{
22 char *t = NULL, *ttyname();
23
24 if (0 <= *lu && *lu < MXUNIT && units[*lu].ufd)
25 t = ttyname(fileno(units[*lu].ufd));
26 if (t == NULL)
27 t = "";
28 b_char(t, name, strlen);
29}