summaryrefslogtreecommitdiff
path: root/libavformat/os_support.h
diff options
context:
space:
mode:
authorFrançois Revol <revol@free.fr>2007-02-15 07:44:10 +0000
committerFrançois Revol <revol@free.fr>2007-02-15 07:44:10 +0000
commitb0c858d83481aa85a33c582651ac6ad7d3c4795a (patch)
treedfbba31c4a03d5fb826ff24695f8216070e7157f /libavformat/os_support.h
parentbefa3397c54a495460fe4f18dd7e83a6221b0677 (diff)
poll() emulation for BeOS, and maybe MinGW.
Originally committed as revision 7987 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavformat/os_support.h')
-rw-r--r--libavformat/os_support.h28
1 files changed, 28 insertions, 0 deletions
diff --git a/libavformat/os_support.h b/libavformat/os_support.h
index 6f915351fe..f65755ad30 100644
--- a/libavformat/os_support.h
+++ b/libavformat/os_support.h
@@ -32,6 +32,7 @@
* - floatf() (OS/2)
* - strcasecmp() (OS/2)
* - closesocket()
+ * - poll() (BeOS)
*/
#if defined(__BEOS__) || defined(__INNOTEK_LIBC__)
@@ -78,4 +79,31 @@ static inline int strcasecmp(const char* s1, const char* s2) { return stricmp(s1
#define closesocket close
#endif
+#ifndef HAVE_SYS_POLL_H
+typedef unsigned long nfds_t;
+
+struct pollfd {
+ int fd;
+ short events; /* events to look for */
+ short revents; /* events that occured */
+};
+
+/* events & revents */
+#define POLLIN 0x0001 /* any readable data available */
+#define POLLOUT 0x0002 /* file descriptor is writeable */
+#define POLLRDNORM POLLIN
+#define POLLWRNORM POLLOUT
+#define POLLRDBAND 0x0008 /* priority readable data */
+#define POLLWRBAND 0x0010 /* priority data can be written */
+#define POLLPRI 0x0020 /* high priority readable data */
+
+/* revents only */
+#define POLLERR 0x0004 /* errors pending */
+#define POLLHUP 0x0080 /* disconnected */
+#define POLLNVAL 0x1000 /* invalid file descriptor */
+
+
+extern int poll(struct pollfd *fds, nfds_t numfds, int timeout);
+#endif /* HAVE_SYS_POLL_H */
+
#endif /* _OS_SUPPORT_H */