/*
 * ttyname.c
 */


#include<sys/types.h>
#include<sys/stat.h>

#include<callgate.h>
#include<sys/system.h>
#include<errno.h>
#include<string.h>
#include<signal.h>
#include<stdio.h>
#include<stropts.h>
#include<unistd.h>


extern int _ttyname(int,char*);
static char ttynameBuf[TTY_NAME_MAX+5];


char *ttyname(int fd)
{
	strcpy(ttynameBuf,"/dev/");
	if (_ttyname(fd,ttynameBuf+5) == -1)
		return NULL;

	return ttynameBuf;
}
