Skip to content
Snippets Groups Projects
user avatar
Tw authored
Due to go std lib uses poller for os.File introducing in this commit:
https://github.com/golang/go/commit/c05b06a12d005f50e4776095a60d6bd9c2c91fac


There are two changes to watch out:
1. os.File.Fd will always return a blocking fd except on bsd.
2. os.File.Read won't return EAGAIN error for nonblocking fd.

So
For 1, we just get tty's fd in advance and then set its block mode.
For 2, we use read syscall directly to get what we wanted error(EAGAIN).

Fix issue #910.

Signed-off-by: default avatarTw <tw19881113@gmail.com>
ab182e27
History
Name Last commit Last update