hpux man page for ctermid

Query: ctermid

OS: hpux

Section: 3s

Format: Original Unix Latex Style Formatted with HTML and a Horizontal Scroll Bar

ctermid(3S)															       ctermid(3S)

NAME
ctermid() - generate file name for terminal
SYNOPSIS
DESCRIPTION
generates a string that, when used as a pathname, refers to the controlling terminal for the current process. If s is a NULL pointer, the string is stored in an internal static area, the contents of which are overwritten at the next call to and the address of which is returned. Otherwise, s is assumed to point to a character array of at least elements; the path name is placed in this array and the value of s is returned. The constant is defined in the header file. If the process has no controlling terminal, the pathname for the controlling terminal cannot be determined, or some other error occurs, returns an empty string. For multi-thread applications, if s is a NULL pointer, the operation is not performed and a NULL pointer is returned. Notes The difference between and is that must be handed a file descriptor and returns the actual name of the terminal associated with that file descriptor, while returns a string that refers to the terminal if used as a file name. (see ttyname(3C)). Thus is useful only if the process already has at least one file open to a terminal.
SEE ALSO
ttyname(3C), thread_safety(5).
STANDARDS CONFORMANCE
ctermid(3S)
Related Man Pages
ctermid_r(3c) - opensolaris
ctermid(3) - debian
ctermid(3) - centos
ctermid_r(3c) - sunos
ctermid(3) - freebsd
Similar Topics in the Unix Linux Community
file pointer
How can I know IP address of terminal?
Difference between <stdin> & terminal
How to put the STDOUT back to terminal
How to use terminal while keeping a program open?