source: rtems/c/src/lib/libc/isatty.c @ dfe5faf8

4.104.114.84.95
Last change on this file since dfe5faf8 was 9c49db4, checked in by Joel Sherrill <joel.sherrill@…>, on 01/08/01 at 18:26:44

2001-01-08 Ralf Corsepius <corsepiu@…>

  • configure.in: Add libc/config.h
  • libc/Makefile.am: Add INCLUDES += -I. to pickup config.h
  • libc/.cvsignore: Add config.h and stamp-h
  • libc/*.c: Add config.h support.
  • Property mode set to 100644
File size: 486 bytes
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.OARcorp.com/rtems/license.html.
8 *
9 *  $Id$
10 */
11
12#if HAVE_CONFIG_H
13#include "config.h"
14#endif
15
16#include <sys/stat.h>
17
18int 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.