diff options
Diffstat (limited to 'include')
-rwxr-xr-x | include/asterisk/channel.h | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/include/asterisk/channel.h b/include/asterisk/channel.h index aea8cbc1d..ef1d84756 100755 --- a/include/asterisk/channel.h +++ b/include/asterisk/channel.h @@ -20,6 +20,7 @@ #include <unistd.h> #include <setjmp.h> #include <pthread.h> +#include <sys/poll.h> #if defined(__cplusplus) || defined(c_plusplus) extern "C" { @@ -781,6 +782,21 @@ int ast_do_masquerade(struct ast_channel *chan); /* Misc. functions below */ +/* Helper function for migrating select to poll */ +static inline int ast_fdisset(struct pollfd *pfds, int fd, int max, int *start) +{ + int x; + for (x=start ? *start : 0;x<max;x++) + if (pfds[x].fd == fd) { + if (start) { + if (x==*start) + (*start)++; + } + return pfds[x].revents; + } + return 0; +} + //! Waits for activity on a group of channels /*! * \param nfds the maximum number of file descriptors in the sets |