home *** CD-ROM | disk | FTP | other *** search
/ PC Extra Super CD 1998 January / PCPLUS131.iso / DJGPP / V2 / DJLSR201.ZIP / src / libc / posix / unistd / isatty.c < prev    next >
Encoding:
C/C++ Source or Header  |  1995-05-10  |  298 b   |  17 lines

  1. /* Copyright (C) 1995 DJ Delorie, see COPYING.DJ for details */
  2. #include <libc/stubs.h>
  3. #include <unistd.h>
  4. #include <dpmi.h>
  5.  
  6. int
  7. isatty(int fd)
  8. {
  9.   __dpmi_regs r;
  10.   r.x.ax = 0x4400;
  11.   r.x.bx = fd;
  12.   __dpmi_int(0x21, &r);
  13.   if ((r.x.ax & 0x83) == 0x83)
  14.     return 1;
  15.   return 0;
  16. }
  17.