home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
rtsi.com
/
2014.01.www.rtsi.com.tar
/
www.rtsi.com
/
OS9
/
OSK
/
LIB
/
unix.zoo
/
ttyname.c
< prev
Wrap
Text File
|
2009-11-06
|
2KB
|
50 lines
/***************************************************************************/
/* */
/* ttyname() : Unix library (OS9/68000) */
/* ========= */
/* */
/* Author: K. Schmitt */
/* Compiler: Microware C Vers. 3.0 */
/* OS: OS9/68000 Vers. 2.2 */
/* */
/* Edition History */
/* =============== */
/* */
/* Ed. 0.00 Date 11/14/88 */
/* First version */
/* */
/***************************************************************************/
/* */
/* Description */
/* */
/*
NAME
ttyname - return the device name of a tty
SYNOPSIS
char *ttyname(fildes)
int fildes;
DESCRIPTION
ttyname returns the device name for fildes or NULL
*/
#define ERROR -1
char *ttyname(fildes)
int fildes;
{
extern int _gs_devn();
extern char *malloc();
register char *name;
if ((name=malloc(32)) == (char *) 0) return ((char *) 0);
if (_gs_devn(fildes,name) == ERROR) return ((char *) 0);
return (name);
} /* end of ttyname */