4.104.114.84.95
Line | |
---|
1 | /* |
---|
2 | * COPYRIGHT (c) 1989-1999. |
---|
3 | * On-Line Applications Research Corporation (OAR). |
---|
4 | * |
---|
5 | * The license and distribution terms for this file may be |
---|
6 | * found in the file LICENSE in this distribution or at |
---|
7 | * http://www.rtems.com/license/LICENSE. |
---|
8 | * |
---|
9 | * $Id$ |
---|
10 | */ |
---|
11 | |
---|
12 | #if HAVE_CONFIG_H |
---|
13 | #include "config.h" |
---|
14 | #endif |
---|
15 | |
---|
16 | #include <sys/stat.h> |
---|
17 | |
---|
18 | int isatty( |
---|
19 | int fd |
---|
20 | ) |
---|
21 | { |
---|
22 | struct stat buf; |
---|
23 | |
---|
24 | if (fstat (fd, &buf) < 0) |
---|
25 | return 0; |
---|
26 | |
---|
27 | if (S_ISCHR (buf.st_mode)) |
---|
28 | return 1; |
---|
29 | |
---|
30 | return 0; |
---|
31 | } |
---|
Note: See
TracBrowser
for help on using the repository browser.