int ttflsh() { if(obufp) { write(fileno(term),obuf,obufp); if(baud<38400) if(obufp*upc/1000) nap(obufp*upc/1000); obufp=0; } if(!have && !leave) if(rdchk(fileno(term))>0) have=1; return 0; }
static int pollfd (int fd) { int r = 0; #ifdef HAS_RDCHK r = rdchk (fd); #elif defined(TCRDCHK) (void) ioctl (fd, TCRDCHK, &r); #else (void) ioctl (fd, FIONREAD, &r); #endif return (r); }