2016-09-21 01:28:37 +00:00
|
|
|
/*
|
|
|
|
* XXX - can't #include <sys/ioctl.h> because libcc.ansi and libsys
|
|
|
|
* both provide it, and we might find the wrong one.
|
2013-05-08 23:56:10 +00:00
|
|
|
*/
|
2016-09-21 01:28:37 +00:00
|
|
|
#define TIOCGETD 0x5424
|
|
|
|
int ioctl(int fd, unsigned long, ...);
|
2013-05-08 23:56:10 +00:00
|
|
|
|
|
|
|
int isatty(int fd)
|
|
|
|
{
|
2016-09-21 01:28:37 +00:00
|
|
|
int line_disc;
|
|
|
|
return 0 <= ioctl(fd, TIOCGETD, &line_disc);
|
2013-05-08 23:56:10 +00:00
|
|
|
}
|