ultrix man page for ctermid

Query: ctermid

OS: ultrix

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

Syntax
       #include <stdio.h>

       char *ctermid(s)
       char *s;

Description
       The subroutine generates the pathname of the controlling terminal for the current process, and stores it in a string.

       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 pathname is placed in  this
       array  and  the	value of s is returned.  The constant is defined in the <stdio.h> header file.	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
       will  refer  to the terminal if used as a file name.  Thus subroutine is useful only if the process already has at least one file open to a
       terminal.

See Also
       ttyname(3)

																       ctermid(3s)
Related Man Pages
ctermid_r(3) - mojave
ctermid(3) - linux
ctermid(3) - netbsd
ctermid(3c) - sunos
ctermid_r(3c) - sunos
Similar Topics in the Unix Linux Community
Who is the current user
Command Not running in script
How to find if a process a daemon ?
scandir() and threads