|
NAMEttyname , ttyname_r ,
isatty —
get name of associated terminal (tty) from file descriptor
LIBRARYStandard C Library (libc, -lc)SYNOPSIS#include <unistd.h>
char *
int
int
DESCRIPTIONThese functions operate on file descriptors for terminal type devices.The The The RETURN VALUESTheisatty () function returns 1 if
fd refers to a terminal type device; otherwise, it
returns 0 and may set errno to indicate the error. The
ttyname () function returns the null terminated name if
the device is found and isatty () is true; otherwise a
NULL pointer is returned. The
ttyname_r () function returns 0 if successful.
Otherwise an error number is returned.
ERRORSThese functions may fail if:
Additionally,
SEE ALSOfdevname(3), ptsname(3), tcgetattr(3), tty(4)HISTORYTheisatty () and ttyname ()
functions appeared in Version 7 AT&T UNIX.
The ttyname_r () function appeared in
FreeBSD 6.0.
Visit the GSP FreeBSD Man Page Interface. |