void EmptyTerminal (void) { #if defined unix || defined __unix || defined __unix__ fd_set o; FD_ZERO (&o); #endif /* unix || __unix || __unix__ */ if (TTYBYTES () == 0) { #if defined unix || defined __unix || defined __unix__ FD_SET (tout, &o); select (tout + 1, (fd_set *) 0, &o, (fd_set *) 0, (struct timeval *) 0); /* wait for TTLOWAT */ #endif /* unix || __unix || __unix__ */ } else { while (TTYBYTES ()) { ttyflush (0); #if defined unix || defined __unix || defined __unix__ FD_SET (tout, &o); select (tout + 1, (fd_set *) 0, &o, (fd_set *) 0, (struct timeval *) 0); /* wait for TTLOWAT */ #endif /* unix || __unix || __unix__ */ } } }
static void EmptyTerminal(void) { fd_set o; FD_ZERO(&o); if (TTYBYTES() == 0) { FD_SET(tout, &o); (void) select(tout+1, (fd_set *) 0, &o, (fd_set *) 0, (struct timeval *) 0); /* wait for TTLOWAT */ } else { while (TTYBYTES()) { (void) ttyflush(0); FD_SET(tout, &o); (void) select(tout+1, (fd_set *) 0, &o, (fd_set *) 0, (struct timeval *) 0); /* wait for TTLOWAT */ } } }
/* * EmptyTerminal - called to make sure that the terminal buffer is * empty. Note that we consider the buffer to run all the way to the * kernel (thus the select). */ void EmptyTerminal(void) { #ifndef __WIN32__ fd_set o; FD_ZERO(&o); if (TTYBYTES() == 0) { FD_SET(tout, &o); select(tout+1, NULL, &o, NULL, NULL); /* wait for TTLOWAT */ } else { while (TTYBYTES()) { ttyflush(0); FD_SET(tout, &o); select(tout+1, NULL, &o, NULL, NULL); /* wait for TTLOWAT */ } } #else ttyflush(0); #endif }