lkml.org 
[lkml]   [2003]   [Mar]   [17]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: select() stress
On Mon, 17 Mar 2003, Sparks, Jamie wrote:

>
> Hello,
>
> I'm running some code ported from an sgi running Irix 6.5 on a
> redhat 7.1 box: 2.4.7-10, i686. Control hangs on a select()
> statement forever. The select is never completed, so I can't
> check errno.
>
[SNIPPED...]


> /* ****************************** */
> if (select(getdtablesize(), &socklist, NULL, NULL, NULL) < 0)
> {
> if (errno != EINTR) perror("WeapTerrain");
> continue;
> }

select() takes a file-descriptor as its first argument, not the
return-value of some function that returns the number of file-
descriptors. You cannot assume that this number is the same
as the currently open socket. Just use the socket-value. That's
the file-descriptor.


Cheers,
Dick Johnson
Penguin : Linux version 2.4.20 on an i686 machine (797.90 BogoMips).
Why is the government concerned about the lunatic fringe? Think about it.

-
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 13:34    [W:0.062 / U:0.004 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site