Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id ; Mon, 17 Mar 2003 10:48:11 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id ; Mon, 17 Mar 2003 10:48:11 -0500 Received: from chaos.analogic.com ([204.178.40.224]:17796 "EHLO chaos.analogic.com") by vger.kernel.org with ESMTP id ; Mon, 17 Mar 2003 10:48:09 -0500 Date: Mon, 17 Mar 2003 11:15:37 -0500 (EST) From: "Richard B. Johnson" X-X-Sender: root@chaos Reply-To: root@chaos.analogic.com To: "Sparks, Jamie" cc: Linux kernel Subject: Re: select() stress In-Reply-To: Message-ID: References: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1174 Lines: 37 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/