ctermid()

generate a string that refers to the current controlling terminal 

Function


SYNOPSIS

#include <stdio.h>

char *ctermid(char *s);


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 path name, access to the file is not guaranteed.

If used in a threaded application, ctermid() must be called with a non-NULL parameter.


PARAMETERS

Points to a buffer of at least L_ctermid bytes where the path name is to be placed. If this parameter is NULL, then a static buffer is used.


RETURN VALUES

If s is a null pointer, ctermid() returns a pointer to a static buffer containing the path name to the controlling terminal. Otherwise, ctermid() returns s.


CONFORMANCE

POSIX.1 (1996), with exceptions.


MULTITHREAD SAFETY LEVEL

MT-Safe, with exceptions.

This function is only MT-Safe if its parameter is non-NULL.


PORTING ISSUES

The returned path name is always "/dev/tty".


AVAILABILITY

PTC MKS Toolkit for Professional Developers
PTC MKS Toolkit for Professional Developers 64-Bit Edition
PTC MKS Toolkit for Enterprise Developers
PTC MKS Toolkit for Enterprise Developers 64-Bit Edition


SEE ALSO

Functions:
ttyname(), ttyname_r()


PTC MKS Toolkit 10.3 Documentation Build 39.