| * Copyright (C) 2007 by Denys Vlasenko <vda.linux@googlemail.com> |
| * Licensed under GPLv2, see file LICENSE in this tarball for details. |
| /* Wrapper which restarts poll on EINTR or ENOMEM. |
| * On other errors does perror("poll") and returns. |
| * Warning! May take longer than timeout_ms to return! */ |
| int FAST_FUNC safe_poll(struct pollfd *ufds, nfds_t nfds, int timeout) |
| int n = poll(ufds, nfds, timeout); |
| /* Make sure we inch towards completion */ |
| /* E.g. strace causes poll to return this */ |
| /* Kernel is very low on memory. Retry. */ |
| /* I doubt many callers would handle this correctly! */ |