Re: select() on sockets considered harmful, use poll() instead?
Dan wrote:
The suspect statements are:
dinput/joystick_linux.c: if (1>select(This->joyfd+1,&readfds,... dinput/joystick_linuxinput.c: if (1>select(This->joyfd+1,&readfds,... icmp/icmp_main.c: while ((res=select(icp->sid+1,&fdr,... netapi32/nbt.c: r = select(fd + 1, &fds, ... wininet/internet.c: if (select(nSocket+1,&infd,... wininet/netconnection.c: if (select(connection->socketFD+1,&infd,...
These, at least, are safe: they poll on a single file descriptor.
ws2_32/socket.c: if( (highfd = select(highfd + 1, p_read, p_write, p_except, timeoutaddr))
This is the only potentially problematic one, but I didn't look at it closely enough to know for sure. --Juan __________________________________________________________________________________________ Check out the New Yahoo! Mail - Fire up a more powerful email and get things done faster. (http://advision.webevents.yahoo.com/mailbeta)
Juan Lang <juan_lang(a)yahoo.com> writes:
Dan wrote:
The suspect statements are:
dinput/joystick_linux.c: if (1>select(This->joyfd+1,&readfds,... dinput/joystick_linuxinput.c: if (1>select(This->joyfd+1,&readfds,... icmp/icmp_main.c: while ((res=select(icp->sid+1,&fdr,... netapi32/nbt.c: r = select(fd + 1, &fds, ... wininet/internet.c: if (select(nSocket+1,&infd,... wininet/netconnection.c: if (select(connection->socketFD+1,&infd,...
These, at least, are safe: they poll on a single file descriptor.
A single file descriptor can still be above 1024. select() should really be avoided. -- Alexandre Julliard julliard(a)winehq.org
On 11/1/06, Alexandre Julliard <julliard(a)winehq.org> wrote:
Juan Lang <juan_lang(a)yahoo.com> writes:
Dan wrote:
The suspect statements are:
dinput/joystick_linux.c: if (1>select(This->joyfd+1,&readfds,... dinput/joystick_linuxinput.c: if (1>select(This->joyfd+1,&readfds,... icmp/icmp_main.c: while ((res=select(icp->sid+1,&fdr,... netapi32/nbt.c: r = select(fd + 1, &fds, ... wininet/internet.c: if (select(nSocket+1,&infd,... wininet/netconnection.c: if (select(connection->socketFD+1,&infd,...
These, at least, are safe: they poll on a single file descriptor.
A single file descriptor can still be above 1024. select() should really be avoided.
Well I'm not a new wine hacker, but I was bored this weekend, so:
dinput/joystick_linux.c: if (1>select(This->joyfd+1,&readfds,... patch sent
dinput/joystick_linuxinput.c: if (1>select(This->joyfd+1,&readfds,... patch sent
icmp/icmp_main.c: while ((res=select(icp->sid+1,&fdr,... patch sent
netapi32/nbt.c: r = select(fd + 1, &fds, ... This is a winsock select, which is okay: the winsock fd_set is just an array, meaning the single fd can be > 1024. Alexandre's WS_select patch makes WS_select use poll internally, so this will always work. Besides, there's no real alternative to select in winsock ;-).
So changing select->poll only needs to be done for the Linux select.
wininet/internet.c: if (select(nSocket+1,&infd,... patch sent
wininet/netconnection.c: if (select(connection->socketFD+1,&infd,... patch sent
ws2_32/socket.c: if( (highfd = select(highfd + 1, p_read, p_write, p_except, timeoutaddr)) Alexandre's WS_select patch fixes this
cscope did not find any more select() calls in wine 0.9.24 dlls, except a few used for timing and yielding execution. Should we change those too for consistency? Damjan
participants (3)
-
Alexandre Julliard -
Damjan Jovanovic -
Juan Lang