/*
 * Returns 1 iff file is a tty (a character device)
 */

#include "types.h"
#include "stat.h"

isatty(f)
int f;
{
	struct stat statbuf;

	if (fstat(f,&statbuf) == -1)
	    return (0);
	if ((statbuf.st_mode&F_MASK) != F_CDEV)
	    return (0);

	return(1);
}
