source: rtems/c/src/lib/libc/isatty.c @ 662678d1

4.104.114.84.95
Last change on this file since 662678d1 was 662678d1, checked in by Joel Sherrill <joel.sherrill@…>, on Aug 25, 2000 at 1:13:57 PM

2000-08-25 Joel Sherrill <joel.sherrill@…>

  • libc/isatty.c, libc/imfs_handlers_directory.c, libc/creat.c, libc/imfs_directory.c: Fixed style issues.
  • Property mode set to 100644
File size: 440 bytes
RevLine 
[662678d1]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.OARcorp.com/rtems/license.html.
8 *
9 *  $Id$
10 */
[ddaa60f]11
12#include <sys/stat.h>
13
[662678d1]14int isatty(
15  int fd
16)
[ddaa60f]17{
18  struct stat buf;
19
20  if (fstat (fd, &buf) < 0)
21    return 0;
[662678d1]22
[ddaa60f]23  if (S_ISCHR (buf.st_mode))
24    return 1;
[662678d1]25
[ddaa60f]26  return 0;
27}
Note: See TracBrowser for help on using the repository browser.