fix: must check whether errno is an EAGAIN or EWOULDBLOCK.
fix: must add the null-termination 1 byte to buffer size.