/*==========================================================================
 * ISATTY.C, by Robert L. Pyron
 *
 * Naive implementation of isatty() for Amiga using Lattice C 5.05.
 * See the following message excerpt (from BIX) about why this
 * approach may not be such a good idea...
 *
 *--------------------------------------------------------------------------
 * sas.c/old.amiga.c #4245, from jtoebes, Fri Dec 8 09:42:11 1989
 *--------------------------------------------------------------------------
 * As for isatty(), IsInteractive may not be the best choice for what you
 * want.  It returns True for prt:.  You may wish to consider sending a
 * ACTION_INFO packet or an ACTION_RAWMODE packet to the handler and see
 * if it returns ACTION_NOT_KNOWN or not.  Whawes can verify the best choice
 * of packets to use for the test.
 *
 *==========================================================================
 */

#include <stdio.h>
#include <ios1.h>
#include <proto/dos.h>

int __regargs isatty( int fd )
{
	struct	UFB	*ufb;

	if ( (ufb = chkufb(fd)) == NULL )
		return( 0 );
	else
		return (int) IsInteractive( ufb->ufbfh );
}

