repo.or.cz
/
newlib-cygwin.git
/
blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
log
|
graphiclog1
|
graphiclog2
|
commit
|
commitdiff
|
tree
|
refs
|
edit
|
fork
blame
|
history
|
raw
|
HEAD
Cygwin: mmap: allow remapping part of an existing anonymous mapping
[newlib-cygwin.git]
/
newlib
/
libc
/
posix
/
_isatty.c
blob
c4dcc1f9c6cfa62a55f861812cbab17bb5021a92
1
/* isatty.c */
2
3
/* Dumb implementation so programs will at least run. */
4
5
#include <sys/stat.h>
6
#include <errno.h>
7
8
int
9
_isatty
(
int
fd
)
10
{
11
struct
stat buf
;
12
13
if
(
fstat
(
fd
, &
buf
) <
0
) {
14
errno
=
EBADF
;
15
return
0
;
16
}
17
if
(
S_ISCHR
(
buf
.
st_mode
))
18
return
1
;
19
errno
=
ENOTTY
;
20
return
0
;
21
}