X-Git-Url: https://git.piment-noir.org/?a=blobdiff_plain;f=lib%2Flibnfs.c;h=8a0adba4614ca7df31ca787e9aa254a5b465008e;hb=0ad9a1f134cd85fd69dc9c6939379e3e891d4385;hp=5fd91ea03e6379ea55e246ef2396976bb1f8444a;hpb=dd8fc17555bd59cd2af931e24e9f747f03a76eb2;p=deb_libnfs.git diff --git a/lib/libnfs.c b/lib/libnfs.c index 5fd91ea..8a0adba 100644 --- a/lib/libnfs.c +++ b/lib/libnfs.c @@ -3081,3 +3081,35 @@ const char *nfs_get_server(struct nfs_context *nfs) { const char *nfs_get_export(struct nfs_context *nfs) { return nfs->export; } + + +#if defined(WIN32) +int poll(struct pollfd *fds, int nfsd, int timeout) +{ + fd_set rfds, wfds, efds; + int ret; + + FD_ZERO(&rfds); + FD_ZERO(&wfds); + FD_ZERO(&efds); + if (fds->events & POLLIN) { + FD_SET(fds->fd, &rfds); + } + if (fds->events & POLLOUT) { + FD_SET(fds->fd, &wfds); + } + FD_SET(fds->fd, &efds); + select(fds->fd + 1, &rfds, &wfds, &efds, NULL); + fds->revents = 0; + if (FD_ISSET(fds->fd, &rfds)) { + fds->revents |= POLLIN; + } + if (FD_ISSET(fds->fd, &wfds)) { + fds->revents |= POLLOUT; + } + if (FD_ISSET(fds->fd, &efds)) { + fds->revents |= POLLHUP; + } +} +#endif +