Pristine Ack-5.5
[Ack-5.5.git] / lang / cem / libcc.ansi / stdio / isatty.c
1 /*
2  * _isatty - check if a file descriptor is associated with a terminal
3  */
4 /* $Id: isatty.c,v 1.3 1994/06/24 11:50:38 ceriel Exp $ */
5
6 int _gtty(int d, char *buf);
7
8 int _isatty(int d)
9 {
10         char buf[128]; 
11         /* not a sgttyb struct; it might not be large enough;
12            I know for a fact that it isn't large enough on PC/IX,
13            where gtty is an ioctl(..., TCGETA, ...)
14         */
15
16         return _gtty(d, buf) >= 0;
17 }