ctermid(3s)
_________________________________________________________________
ctermid Subroutine
generate filename for terminal
_________________________________________________________________
SYNTAX
#include <stdio.h>
char *ctermid (s)
char *s;
DESCRIPTION
Ctermid generates the pathname of the controlling terminal for
the current process, and stores it in a string.
If s is a NULL pointer, the string is stored in an internal
static area. The area's contents are overwritten at the next
call to ctermid, and its address returned. Otherwise, s is
assumed to point to a character array of at least Lctermid
elements; the pathname is placed in this array and the value of s
is returned. The constant Lctermid is defined in the <stdio.h>
header file.
NOTES
Ctermid and ttyname(3C) differ: Ttyname is handed a file
descriptor and returns the actual name of the terminal associated
with that file descriptor. Ctermid returns a string (/dev/tty)
that will refer to the terminal if it is used as a filename.
Thus, ttyname is useful only if the process already has at least
one file open to a terminal.
SEE ALSO
ttyname(3C).
DG/UX 4.00 Page 1
Licensed material--property of copyright holder(s)