コード例 #1
0
ファイル: utilities.c プロジェクト: antoine1fr/inetutils
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__ */
	}
    }
}
コード例 #2
0
ファイル: utilities.c プロジェクト: aosm/remote_cmds
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 */
	}
    }
}
コード例 #3
0
ファイル: terminal.cpp プロジェクト: gordonchaffee/expectnt
/*
 * 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
}