ttyname()

get path name of terminal 

Function


SYNOPSIS

#include <unistd.h>

char *ttyname(int fildes);


DESCRIPTION

The ttyname() function returns a pointer to a string that contains a null-terminated path name of the terminal associated with the file descriptor fildes. The return value of ttyname() may point to static data that is overwritten by each call.


PARAMETERS

fildes 

Is the file descriptor that associates with the string containing the null-terminated path name of the terminal.


RETURN VALUES

On success, ttyname() returns a pointer to a string. On error, a null pointer is returned, and errno is set to one of the following values:

EBADF 

fildes is not a valid file descriptor.

ENOTTY 

fildes does not refer to a terminate device.


CONFORMANCE

UNIX 98.


MULTITHREAD SAFETY LEVEL

Unsafe.


PORTING ISSUES

ttyname() returns /dev/tty/nnn, where nnn is the process group ID.


AVAILABILITY

PTC MKS Toolkit for Professional Developers
PTC MKS Toolkit for Professional Developers 64-Bit Edition
PTC MKS Toolkit for Enterprise Developers
PTC MKS Toolkit for Enterprise Developers 64-Bit Edition


SEE ALSO

Functions:
ctermid(), isatty(), ttyname_r()


PTC MKS Toolkit 10.5 Documentation Build 40.