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

  man pages->IRIX man pages -> ctermid (3s)              
Title
Content
Arch
Section
 

Contents


ctermid(3S)							   ctermid(3S)


NAME    [Toc]    [Back]

     ctermid, ctermid_r	- generate file	name for terminal

SYNOPSIS    [Toc]    [Back]

     #include <stdio.h>

     char *ctermid (char *s);

     char *ctermid_r (char *s);

DESCRIPTION    [Toc]    [Back]

     ctermid generates the path	name 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 ctermid,	and
     the address of which is returned.	Otherwise, s is	assumed	to point to a
     character array of	at least L_ctermid elements; the path name is placed
     in	this array and the value of s is returned.  The	constant L_ctermid is
     defined in	the stdio.h header file.

     ctermid_r is a reentrant version of ctermid.  It differs from ctermid
     only in that the parameter	s must be supplied.  The feature test macro
     _SGI_REENTRANT_FUNCTIONS should be	defined	to make	this function visible.

SEE ALSO    [Toc]    [Back]

      
      
     ttyname(3C).

WARNING    [Toc]    [Back]

     ctermid should not	be called with s equal to a NULL pointer in a
     multithreaded application due to the use of an internal static buffer for
     the return	value.

NOTES    [Toc]    [Back]

     The difference between ctermid and	ttyname(3C) is that ttyname must be
     handed a file descriptor and returns the actual name of the terminal
     associated	with that file descriptor, while ctermid returns a string
     (/dev/tty)	that will refer	to the terminal	if used	as a file name.	 Thus
     ttyname is	useful only if the process already has at least	one file open
     to	a terminal.


									PPPPaaaaggggeeee 1111
[ Back ]
 Similar pages
Name OS Title
ctermid NetBSD generate terminal pathname
ctermid FreeBSD generate terminal pathname
ctermid_r FreeBSD generate terminal pathname
ctermid OpenBSD generate terminal pathname
ctermid Tru64 Generate the pathname for the controlling terminal
dh_gencontrol Linux generate and install control file
dh_md5sums Linux generate DEBIAN/md5sums file
gensnmptree FreeBSD generate C and header files from a MIB description file
gencat HP-UX generate a formatted message catalog file
update-xpdfrc Linux program to generate xpdf's configuration file
Copyright © 2004-2005 DeniX Solutions SRL
newsletter delivery service