.title isatty ;+ ; stat = isatty(int) ; ; status returns are YES/NO ;- ap=%5 int=2 .psect $r.roi,con,ro,rel,lcl,i .enabl lsb isatty:: mov @int(ap),r0 ; rat4 unit number call r$gfbk ; get RFDB address mov #no,r0 ; assume not bcs 100$ ; c set => invalid unit bit #rf.clo,(r1) ; is file open on unit? bne 100$ ; NO bit #rf.tty,(r1) ; is it a terminal? beq 100$ ; NO mov #yes,r0 ; return YES 100$: return .end