home *** CD-ROM | disk | FTP | other *** search
/ Club Amiga de Montreal - CAM / CAM_CD_1.iso / files / 387b.lha / dice_v2.02 / lib / fd / isatty.c < prev    next >
Encoding:
C/C++ Source or Header  |  1990-05-30  |  391 b   |  29 lines

  1.  
  2. /*
  3.  *  ISATTY.C
  4.  *
  5.  *  (c)Copyright 1990, Matthew Dillon, All Rights Reserved
  6.  */
  7.  
  8. #include <stdio.h>
  9. #include <fcntl.h>
  10. #include <ioctl.h>
  11. #include <errno.h>
  12.  
  13. int
  14. isatty(fd)
  15. int fd;
  16. {
  17.     _IOFDS *d;
  18.  
  19.     if (d = __getfh(fd)) {
  20.     if (d->fd_Exec)
  21.         return((*d->fd_Exec)(d->fd_Fh, IOC_ISATTY, NULL, NULL));
  22.     if (IsInteractive(d->fd_Fh))
  23.         return(1);
  24.     return(0);
  25.     }
  26.     return(-1);
  27. }
  28.  
  29.