Unix to Windows Porting Dictionary for HPC

Links

Function List

ctermid


Table of Contents

Unix
Windows
Purpose
Discussion

Unix

header file: stdio.h

char * ctermid (char *buf)

Windows

header file: n/a

Purpose

ctermid is used on Unix systems to return the pathname of the controlling terminal for the program.

Discussion

On Unix systems terminals are devices and all devices are accessed through a special file on the file system. Each program is assigned a controlling terminal when it begins. Typically this is the same terminal that the program reads to and from, but this is not always true. This API returns the controlling terminal pathname. This can be important when signals are being sent, terminals are closing and programs are exiting.

blog comments powered by Disqus