up | Inhaltsverzeichniss | Kommentar

Manual page for TTYNAME(3P)

ttyname, isatty - find name of a terminal

SYNOPSIS

#include <unistd.h>

char *ttyname(int fd)

int isatty(int fd)

(ALSO AVAILABLE IN BSD)

int ttyslot(void);

DESCRIPTION

Ttyname returns a pointer to the null-terminated path name of the terminal device associated with file descriptor fd.

Isatty returns 1 if fd is associated with a terminal device, 0 otherwise.

Ttyslot returns the number of the entry in the ttys.5 file for the control terminal of the current process. Ttyslot is not a POSIX function.

RETURN VALUE

The ttyname function returns a NULL pointer if fd is not a valid file descriptor associated with a terminal or if the pathname cannot be determined.

Ttyslot returns 0 if `/etc/ttys' is inaccessible or if it cannot determine the control terminal.

FILES

/dev/*
/etc/ttys

SEE ALSO

ioctl(2), ttys(5)

BUGS

The return value points to static data whose content is overwritten by each call.


index | Inhaltsverzeichniss | Kommentar

Created by unroff & hp-tools. © somebody (See intro for details). All Rights Reserved. Last modified 11/5/97