blob: d8b08c34e2ec3fa52d60410e7d7b1c26bbd69399 (
plain)
1
2
3
4
5
6
7
8
9
10
11
|
#include <syscall.h>
#include <unistd.h>
#include <errno.h>
int isatty(int fd) {
int rc = syscall(SYS_ISATTY, fd, 0, 0, 0, 0);
if (1 == rc)
return rc;
errno = -rc;
return 0;
}
|