Query: ctermid
OS: osf1
Section: 3
Format: Original Unix Latex Style Formatted with HTML and a Horizontal Scroll Bar
ctermid(3) Library Functions Manual ctermid(3)NAMEctermid - Generates the pathname for the controlling terminalLIBRARYStandard C Library (libc.so, libc.a)SYNOPSIS#include <stdio.h> char *ctermid( char *s);STANDARDSInterfaces documented on this reference page conform to industry standards as follows: ctermid(): XPG4, XPG4-UNIX Refer to the standards(5) reference page for more information about industry standards and associated tags.PARAMETERSPoints to the array into which the ctermid() function copies the string representing the pathname.DESCRIPTIONThe ctermid() function generates a string that, when used as a pathname, refers to the current controlling terminal for the current process. If ctermid() returns a pathname, access to the file is not guaranteed. The ctermid() function differs from the ttyname() function in that the ttyname() function is supplied a file descriptor and returns the actual name of the terminal associated with that file descriptor, while the ctermid() function returns a string (/dev/tty) that refers to the terminal if used as a filename. Thus, the ttyname() function is useful only if the process already has at least one file open to a ter- minal.RETURN VALUESIf the s parameter is not a null pointer, it points to a character array of at least L_ctermid bytes. The pathname is placed in this array and the value of the s parameter is returned. The symbolic constant L_ctermid is defined in the stdio.h header file, and has a value greater than 0 (zero). If the s parameter is a null pointer, the string is stored in an internal static area and the address is returned. The next call to the ctermid() function overwrites the contents of the internal static area. If the pathname that would refer to the controlling terminal cannot be determined, or if the function is unsuccessful, the ctermid() func- tion returns an empty string.RELATED INFORMATIONFunctions: ttyname(3) Standards: standards(5) delim off ctermid(3)
Related Man Pages |
---|
ctermid(3posix) - posix |
ctermid(3) - osf1 |
ctermid(3c) - sunos |
ttyname(3) - opendarwin |
ttyname(3) - x11r4 |
Similar Topics in the Unix Linux Community |
---|
Network Connectivity Issues |