*** UNIX MANUAL PAGE BROWSER ***

A Nergahak database for man pages research.

Navigation

Directory Browser

1Browse 4.4BSD4.4BSD
1Browse Digital UNIXDigital UNIX 4.0e
1Browse FreeBSDFreeBSD 14.3
1Browse MINIXMINIX 3.4.0rc6-d5e4fc0
1Browse NetBSDNetBSD 10.1
1Browse OpenBSDOpenBSD 7.7
1Browse UNIX v7Version 7 UNIX
1Browse UNIX v10Version 10 UNIX

Manual Page Search

Manual Page Result

0 Command: ctermid | Section: 3 | Source: Digital UNIX | File: ctermid.3.gz
ctermid(3) Library Functions Manual ctermid(3) NAME ctermid - Generates the pathname for the controlling terminal LIBRARY Standard C Library (libc.so, libc.a) SYNOPSIS #include <stdio.h> char *ctermid( char *s); STANDARDS Interfaces documented on this reference page conform to industry stan- dards as follows: ctermid(): XPG4, XPG4-UNIX Refer to the standards(5) reference page for more information about in- dustry standards and associated tags. PARAMETERS Points to the array into which the ctermid() function copies the string representing the pathname. DESCRIPTION The ctermid() function generates a string that, when used as a path- name, 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 ter- minal if used as a filename. Thus, the ttyname() function is useful only if the process already has at least one file open to a terminal. RETURN VALUES If the s parameter is not a null pointer, it points to a character ar- ray 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 inter- nal static area and the address is returned. The next call to the cter- mid() 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() function returns an empty string. RELATED INFORMATION Functions: ttyname(3) Standards: standards(5) delim off ctermid(3)

Navigation Options