Museum

Home

Lab Overview

Retrotechnology Articles

Online Manuals

⇒ ctermid(3s) — AIX PS/2 1.2.1

Media Vault

Software Library

Restoration Projects

Artifacts Sought

Related Articles

ttyname, isatty, fullttyname



CTERMID(3s,L)               AIX Technical Reference               CTERMID(3s,L)



-------------------------------------------------------------------------------
ctermid



PURPOSE

Generates a file name for terminal.

LIBRARY

Standard I/O Library (libc.a)

SYNTAX

#include <stdio.h>

char *ctermid (s)
char *s;

DESCRIPTION

The ctermid subroutine generates the path name of the controlling terminal for
the current process and stores it in a string.

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 ctermid overwrites
the contents of the internal static area.

If the s parameter is not a NULL pointer, it points to a character array of at
least L_ctermid elements as defined in the stdio.h header file.  The path name
is placed in this array and the value of s is returned.

The difference between the ctermid and ttyname subroutines 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 refers 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.

RELATED INFORMATION

In this book:  "ttyname, isatty, fullttyname."













Processed November 7, 1990       CTERMID(3s,L)                                1



Typewritten Software • bear@typewritten.org • Edmonds, WA 98026