예제 #1
0
// Drain blocks until all data written to the terminal fd are
// transmitted. See also tcdrain(3). If the system call is interrupted
// by a signal, Drain retries it automatically.
func Drain(fd int) error {
	for {
		r, err := C.tcdrain(C.int(fd))
		if r < 0 {
			if err == syscall.EINTR {
				continue
			}
			return err
		}
		return nil
	}
}
예제 #2
0
// Drain waits until all output written to the terminal
// referenced by fd has been transmitted to the terminal.
func Drain(fd uintptr) error {
	//int	tcdrain(int);
	_, rv := C.tcdrain(C.int(fd))
	return rv
}