Mercurial > libavformat.hg
comparison os_support.h @ 1797:20c8dfd3ee84 libavformat
poll() emulation for BeOS, and maybe MinGW.
author | mmu_man |
---|---|
date | Thu, 15 Feb 2007 07:44:10 +0000 |
parents | 92afee454599 |
children | d1e61f4d02cd |
comparison
equal
deleted
inserted
replaced
1796:29962f054bd0 | 1797:20c8dfd3ee84 |
---|---|
30 * - usleep() (Win32, BeOS, OS/2) | 30 * - usleep() (Win32, BeOS, OS/2) |
31 * - lseek() (Win32) | 31 * - lseek() (Win32) |
32 * - floatf() (OS/2) | 32 * - floatf() (OS/2) |
33 * - strcasecmp() (OS/2) | 33 * - strcasecmp() (OS/2) |
34 * - closesocket() | 34 * - closesocket() |
35 * - poll() (BeOS) | |
35 */ | 36 */ |
36 | 37 |
37 #if defined(__BEOS__) || defined(__INNOTEK_LIBC__) | 38 #if defined(__BEOS__) || defined(__INNOTEK_LIBC__) |
38 typedef int socklen_t; | 39 typedef int socklen_t; |
39 #endif | 40 #endif |
76 /* most of the time closing a socket is just closing an fd */ | 77 /* most of the time closing a socket is just closing an fd */ |
77 #if HAVE_CLOSESOCKET != 1 | 78 #if HAVE_CLOSESOCKET != 1 |
78 #define closesocket close | 79 #define closesocket close |
79 #endif | 80 #endif |
80 | 81 |
82 #ifndef HAVE_SYS_POLL_H | |
83 typedef unsigned long nfds_t; | |
84 | |
85 struct pollfd { | |
86 int fd; | |
87 short events; /* events to look for */ | |
88 short revents; /* events that occured */ | |
89 }; | |
90 | |
91 /* events & revents */ | |
92 #define POLLIN 0x0001 /* any readable data available */ | |
93 #define POLLOUT 0x0002 /* file descriptor is writeable */ | |
94 #define POLLRDNORM POLLIN | |
95 #define POLLWRNORM POLLOUT | |
96 #define POLLRDBAND 0x0008 /* priority readable data */ | |
97 #define POLLWRBAND 0x0010 /* priority data can be written */ | |
98 #define POLLPRI 0x0020 /* high priority readable data */ | |
99 | |
100 /* revents only */ | |
101 #define POLLERR 0x0004 /* errors pending */ | |
102 #define POLLHUP 0x0080 /* disconnected */ | |
103 #define POLLNVAL 0x1000 /* invalid file descriptor */ | |
104 | |
105 | |
106 extern int poll(struct pollfd *fds, nfds_t numfds, int timeout); | |
107 #endif /* HAVE_SYS_POLL_H */ | |
108 | |
81 #endif /* _OS_SUPPORT_H */ | 109 #endif /* _OS_SUPPORT_H */ |