};
ssize_t cnt;
- cnt = syscall(SYS_readv, f->fd, iov, 2);
+ cnt = iov[0].iov_len ? syscall(SYS_readv, f->fd, iov, 2)
+ : syscall(SYS_read, f->fd, iov[1].iov_base, iov[1].iov_len);
if (cnt <= 0) {
f->flags |= cnt ? F_ERR : F_EOF;
- return cnt;
+ return 0;
}
if (cnt <= iov[0].iov_len) return cnt;
cnt -= iov[0].iov_len;