Re: Multithread select() bug

From: Davide Libenzi
Date: Mon May 10 2004 - 16:48:36 EST


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@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/