Unix to Windows Porting Dictionary for HPC |
|
|
RSS
LinksFunction List
|
Table of Contents The ttyname() function returns the name of the terminal (aka tty) associated with the running process for the file descriptor provided to the function provided the file descriptor is associated with a terminal. The ctermid() function is an older function that should be replaced with ttyname() on Unix systems. Unix systems identify terminals with a pathname in the file system. Windows systems do not relate terminals with file system pathnames but with special names (e.g. "COM1" for a serial port). Terminals that are displayed on the Windows Desktop are all opened with the generic identifier of "CONIN$" and "CONOUT$". The use of the generic identifier on Windows makes the use of a function similar to the Unix ttyname() function virtually useless. Source code that makes use of ttyname() will have to be examined to determine how the code may continue without the terminal pathname information. It is possible the source code is using the pathname to determine if the process is connected to a terminal. In this case the isatty() function should be used instead in the original code (see isatty() function entry). It is also possible that the pathname information is not vital to the program's operation and can be guarded out by macros. |
|
|
|