OpenCores
URL https://opencores.org/ocsvn/openrisc_me/openrisc_me/trunk

Subversion Repositories openrisc_me

[/] [openrisc/] [trunk/] [gnu-src/] [newlib-1.17.0/] [newlib/] [libc/] [posix/] [_isatty.c] - Blame information for rev 455

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 148 jeremybenn
/* 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
_DEFUN(_isatty, (fd), 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
}

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.