home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
rtsi.com
/
2014.01.www.rtsi.com.tar
/
www.rtsi.com
/
OS9
/
OSK
/
LIB
/
unix.zoo
/
isatty.c
< prev
next >
Wrap
Text File
|
2009-11-06
|
2KB
|
59 lines
/***************************************************************************/
/* */
/* isatty() : Unix library (OS9/68000) */
/* ======== */
/* */
/* Author: K. Schmitt */
/* Compiler: Microware C Vers. 3.0 */
/* OS: OS9/68000 Vers. 2.2 */
/* */
/* Edition History */
/* =============== */
/* */
/* Ed. 0.00 Date 11/11/88 */
/* First version */
/* */
/***************************************************************************/
/* */
/* Description */
/* */
/*
NAME
isatty - check fildes
SYNOPSIS
int isatty (fildes)
int fildes;
struct sgbuf _tty_opt_; (GLOBAL defined - see ioctl() )
DESCRIPTION
Isatty returns 1 if fildes is associated with a terminal
device, 0 otherwise. If the fildes is invalid, -1.
FILES sgstat.h
*/
#define DT_SCF 0 /* device type: SCF */
#define ERROR -1
#include <sgstat.h>
struct sgbuf _tty_opt_; /* buffer for path options */
isatty(fildes)
int fildes;
{
extern int _gs_opt();
register struct sgbuf *tty_options = &_tty_opt_;
if (_gs_opt(fildes,tty_options) == ERROR) return (ERROR);
if (tty_options->sg_class != DT_SCF) return (0);
return (1); /* it's a tty */
} /* end of isatty */