ctermid()

NAME

ctermid() - generate terminal pathname

SYNOPSIS

#include <stdio.h>

char * ctermid (char *buf)

DESCRIPTION

The ctermid(3) function generates a string that, when used as a pathname, refers to the current controlling terminal of the calling process.

RETURN VALUES

If buf is the NULL pointer, the function returns a pointer to a static area. Otherwise, the pathname is copied into the memory referenced by buf. The argument buf is assumed to be at least {L_ctermid} (as defined in the include file <stdio.h>) bytes long.

NOTES

This implementation of the ctermid(3) function always returns /dev/tty.

SEE ALSO

ttyname(2)