revert between 56095 -> 55830 in arch
[AROS.git] / workbench / network / stacks / AROSTCP / netlib / isatty.c
blob01648cf1cda7bca04db18b2ab7ed9232590769cb
1 /* $Id$
3 * isatty.c - check is a file is a terminal (interactive) or not (SAS/C)
5 * Copyright © 1994 AmiTCP/IP Group,
6 * Network Solutions Development Inc.
7 * All rights reserved.
8 */
10 #include <ios1.h>
11 #include <fcntl.h>
12 #include <stdlib.h>
13 #include <dos.h>
14 #include <dos/dos.h>
15 #include <proto/dos.h>
17 int
18 isatty(int fd)
20 struct UFB *ufb;
23 * find the ufb *
25 if ((ufb = __chkufb(fd)) != NULL &&
26 !(ufb->ufbflg & UFB_SOCK)) { /* A socket is not a tty */
28 * Convert DOSBOOL to BOOL
30 return (IsInteractive(ufb->ufbfh) & 0x1);
33 return 0;