lkml.org 
[lkml]   [2004]   [May]   [10]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: Multithread select() bug
On Mon, 10 May 2004, Andre Ben Hamou wrote:

> void *threadFuntion (void *sockets) {
> int socket = ((int *)sockets)[0];
> struct timeval timeout = {tv_sec: 5, tv_usec: 0};
>
> // Allocate a file descriptor set with the passed socket
> fd_set fds;
> FD_ZERO (&fds);
> FD_SET (socket, &fds);
>
> // Select to read / register exceptions on the FD set
> select (socket + 1, &fds, NULL, &fds, &timeout);

Try:

select (socket + 1, &fds, &fds, &fds, &timeout);
^^^^^

- Davide

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-03-22 14:03    [from the cache]
©2003-2014 Jasper Spaans. Advertise on this site