Commit | Line | Data |
---|---|---|
2ce81398 DS |
1 | #if defined(LIBC_SCCS) && !defined(lint) |
2 | static char sccsid[] = "@(#)isatty.c 5.2 (Berkeley) %G%"; | |
3 | #endif LIBC_SCCS and not lint | |
b8f253e8 | 4 | |
b5799bf2 BJ |
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 | ||
f508597f | 15 | if (ioctl(f, TIOCGETP, &ttyb) < 0) |
b5799bf2 BJ |
16 | return(0); |
17 | return(1); | |
18 | } |