aboutsummaryrefslogtreecommitdiffstats
path: root/include/asterisk/channel.h
diff options
context:
space:
mode:
authormarkster <markster@f38db490-d61c-443f-a65b-d21fe96a405b>2004-04-25 20:42:45 +0000
committermarkster <markster@f38db490-d61c-443f-a65b-d21fe96a405b>2004-04-25 20:42:45 +0000
commit4ab2b33bfff1628f3c21fbbd43e2db5c568862c5 (patch)
tree0520b52676690d8c020be12e27ae76e465d192fc /include/asterisk/channel.h
parent5641552590431c923e5eda43d356379a5aa67d8f (diff)
Properly migrate from select to poll for core asterisk.
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@2760 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'include/asterisk/channel.h')
-rwxr-xr-xinclude/asterisk/channel.h16
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