Cygwin: mmap: allow remapping part of an existing anonymous mapping
[newlib-cygwin.git] / newlib / libc / posix / _isatty.c
blobc4dcc1f9c6cfa62a55f861812cbab17bb5021a92
1 /* isatty.c */
3 /* Dumb implementation so programs will at least run. */
5 #include <sys/stat.h>
6 #include <errno.h>
8 int
9 _isatty (int fd)
11 struct stat buf;
13 if (fstat (fd, &buf) < 0) {
14 errno = EBADF;
15 return 0;
17 if (S_ISCHR (buf.st_mode))
18 return 1;
19 errno = ENOTTY;
20 return 0;