xref: /csrg-svn/lib/libc/gen/isatty.c (revision 22099)
1 #ifndef lint
2 static char sccsid[] = "@(#)isatty.c	5.1 (Berkeley) 06/05/85";
3 #endif not lint
4 
5 /*
6  * Returns 1 iff file is a tty
7  */
8 
9 #include <sgtty.h>
10 
11 isatty(f)
12 {
13 	struct sgttyb ttyb;
14 
15 	if (ioctl(f, TIOCGETP, &ttyb) < 0)
16 		return(0);
17 	return(1);
18 }
19