*nix Documentation Project
·  Home
 +   man pages
·  Linux HOWTOs
·  FreeBSD Tips
·  *niX Forums

  man pages->Tru64 Unix man pages -> ctermid (3)              



NAME    [Toc]    [Back]

       ctermid - Generate the pathname for the controlling terminal

SYNOPSIS    [Toc]    [Back]

       #include <stdio.h>

       char *ctermid(
               char *s );

LIBRARY    [Toc]    [Back]

       Standard C Library (libc)

STANDARDS    [Toc]    [Back]

       Interfaces 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.

PARAMETERS    [Toc]    [Back]

       Points to the array  into  which  the  ctermid()  function
       copies the string representing the pathname.

DESCRIPTION    [Toc]    [Back]

       The  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 terminal.

RETURN VALUES    [Toc]    [Back]

       If  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

       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() function returns an empty string.

SEE ALSO    [Toc]    [Back]

       Functions: ttyname(3)

       Standards: standards(5)

[ Back ]
 Similar pages
Name OS Title
ctermid_r FreeBSD generate terminal pathname
ctermid FreeBSD generate terminal pathname
ctermid NetBSD generate terminal pathname
ctermid OpenBSD generate terminal pathname
tty Linux controlling terminal
ctermid Linux get controlling terminal name
tty HP-UX controlling terminal interface
tty IRIX controlling terminal interface
daemon FreeBSD run detached from the controlling terminal
tcgetsid NetBSD get session ID associated with a controlling terminal
Copyright © 2004-2005 DeniX Solutions SRL
newsletter delivery service