.\" Copyright (c) 1990 The Regents of the University of California.
.\" %sccs.include.redist.man%
.\" @(#)ctermid.3 5.1 (Berkeley) %G%
ctermid \- generate terminal pathname
char *ctermid(char *buf);
function generates a string, that, when used as a pathname, refers to
the current controlling terminal for the current process.
is a NULL pointer, a pointer to a static area is returned.
Otherwise, the pathname is copied into the memory referenced by
is assumed to be at least L_ctermid (as defined in the include
file <stdio.h>) bytes long.
The current implementation simply returns ``/dev/tty''.
Upon successful completion, a non-NULL pointer is returned.
Otherwise, a NULL pointer is returned and
is set to indicate the error.
The current implementation detects no error conditions.
conforms to IEEE Std 1003.1-1988 (``POSIX'').
By default, all information is contained in a static buffer which is
overwritten by each new call.
It must be copied elsewhere to be retained.