Museum

Home

Lab Overview

Retrotechnology Articles

⇒ Online Manual

Media Vault

Software Library

Restoration Projects

Artifacts Sought

Related Articles

ioctl(2)

ttys(4)

TTYNAME(3)  —  Kubota Pacfic Computer Inc. (C Library Functions−BSD)

NAME

ttyname, isatty, ttyslot − find name of a terminal

SYNOPSIS

char ∗ttyname(filedes)

isatty(filedes)

ttyslot()

DESCRIPTION

ttyname returns a pointer to the null-terminated path name of the terminal device associated with file descriptor filedes (this is a system file descriptor and has nothing to do with the standard I/O FILE typedef). 

isatty returns 1 if filedes is associated with a terminal device, 0 otherwise. 

ttyslot returns the number of the entry in the ttys(4) file for the control terminal of the current process.

FILES

/dev/∗
/etc/ttys

SEE ALSO

ioctl(2), ttys(4)

DIAGNOSTICS

ttyname returns a null pointer (0) if filedes does not describe a terminal device in directory ‘/dev’. 

ttyslot returns 0 if ‘/etc/ttys’ is inaccessible or if it cannot determine the control terminal. 

BUGS

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

March 13, 1992

Typewritten Software • bear@typewritten.org • Edmonds, WA 98026