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

  man pages->IRIX man pages -> ttyname (3c)              
Title
Content
Arch
Section
 

Contents


ttyname(3C)							   ttyname(3C)


NAME    [Toc]    [Back]

     ttyname, ttyname_r, isatty	- find name of a terminal

SYNOPSIS    [Toc]    [Back]

     #include <stdlib.h>
     #include <unistd.h>

     char *ttyname (int	fildes);

     int ttyname_r (int	fildes,	char *buf, size_t buflen);

     int isatty	(int fildes);

DESCRIPTION    [Toc]    [Back]

     ttyname returns a pointer to a string containing the null-terminated path
     name of the terminal device associated with file descriptor fildes.
     ttyname_r is a reentrant version of ttyname where buf and buflen give the
     location and maximum size of where	the resultant string should be placed.
     The maximum length	of the terminal	name is	{TTY_NAME_MAX}.	 sysconf(3C)
     may be used to determine this value.

     isatty returns 1 if fildes	is associated with a terminal device, 0
     otherwise.

FILES    [Toc]    [Back]

     /dev/*

DIAGNOSTICS    [Toc]    [Back]

     ttyname returns a NULL pointer if fildes does not describe	a terminal
     device in directory /dev.

     ttyname_r returns 0 on success or an error	number on failure.  If fildes
     doesn't refer to a	valid file descriptor, EBADF is	returned.  If fildes
     doesn't refer to a	valid terminal device, ENOTTY is returned.  If the
     value of buflen is	smaller	than the length	of the string to be returned
     including the terminating null character, ERANGE is returned.

NOTES    [Toc]    [Back]

     The return	value of ttyname points	to static data whose content is
     overwritten by each call.


									PPPPaaaaggggeeee 1111
[ Back ]
 Similar pages
Name OS Title
ttynam IRIX find name of a terminal port
termios Linux get and set terminal attributes, line control, get and set baud rate, get and set terminal foregroun...
ct HP-UX spawn getty to a remote terminal (call terminal)
ffs Tru64 Find first set bit
ffs NetBSD find first bit set in a bit string
ffs FreeBSD find first bit set in a bit string
find IRIX find files
strstr Tru64 Find a substring
find HP-UX find files
rfind IRIX remote find
Copyright © 2004-2005 DeniX Solutions SRL
newsletter delivery service