Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc-2-2
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Redmine
Redmine
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Metrics
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
videolan
vlc-2-2
Commits
6fa6b93b
Commit
6fa6b93b
authored
Aug 07, 2008
by
Rémi Denis-Courmont
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Verbose comment
parent
d78dcadd
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
20 additions
and
3 deletions
+20
-3
src/network/poll.c
src/network/poll.c
+20
-3
No files found.
src/network/poll.c
View file @
6fa6b93b
...
...
@@ -38,7 +38,6 @@ int poll (struct pollfd *fds, unsigned nfds, int timeout)
struct
timeval
tv
=
{
0
,
0
};
int
val
=
-
1
;
FD_ZERO
(
&
rdset
);
FD_ZERO
(
&
wrset
);
FD_ZERO
(
&
exset
);
...
...
@@ -48,8 +47,26 @@ int poll (struct pollfd *fds, unsigned nfds, int timeout)
if
(
val
<
fd
)
val
=
fd
;
/* I assume the OS has a solution select overflow if it does not have
* poll(). If it did not, we are screwed anyway. */
/* With POSIX, FD_SET & FD_ISSET are not defined if fd is negative or
* bigger or equal than FD_SETSIZE. That is one of the reasons why VLC
* uses poll() rather than select(). Most POSIX systems implement
* fd_set has a bit field with no sanity checks. This is especially bad
* on systems (such as BSD) that have no process open files limit by
* default, such that it is quite feasible to get fd >= FD_SETSIZE.
* The next instructions will result in a buffer overflow if run on
* a POSIX system, and the later FD_ISSET will do undefined memory
* access.
*
* With Winsock, fd_set is a table of integers. This is awfully slow.
* However, FD_SET and FD_ISSET silently and safely discard
* overflows. If it happens we will loose socket events. Note that
* most (if not all) Winsock SOCKET handles are actually bigger than
* FD_SETSIZE in terms of absolute value - they are not POSIX file
* descriptors. From Vista, there is a much nicer WSAPoll(), but Mingw
* is yet to support it.
*
* With BeOS, the situation is unknown (FIXME: document).
*/
if
(
fds
[
i
].
events
&
POLLIN
)
FD_SET
(
fd
,
&
rdset
);
if
(
fds
[
i
].
events
&
POLLOUT
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment