blob: 8b8b21c0699467245591010f5decdb015eccf73e (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
|
#if 0
#include <sys/types.h>
#include <unistd.h>
#include <termios.h>
/** test for a terminal device **/
int isatty(int fildes)
{
struct termios tios;
if (tcgetattr(fildes, &tios) == 0) {
/* errno set by tcgetattr() */
#if 0
errno = EBADF; /* ARGUMENT(fildes) is not a valid file descriptor */
errno = ENOTTY; /* ARGUMENT(fildes) is not associated with a terminal */
#endif
return 1;
}
return 0;
}
/***
checks whether the file descriptor ARGUMENT(fildes) is associated with a
terminal device.
***/
/*
RETURN(ZERO, ARGUMENT(fildes) is not a terminal)
RETURN(ONE, ARGUMENT(fildes) is a terminal device)
POSIX(1)
*/
#endif
|