pfd.fd = f ? f->filedes : s->socketdes;
pfd.events = for_read ? POLLIN : POLLOUT;
if (timeout > 0) {
if (timeout < 0) {
timeout = -1;
}
else if (timeout > 0) {
timeout = (timeout + 999) / 1000;
do {