From owner-freebsd-hackers Mon Feb 15 16:17:35 1999 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id QAA00244 for freebsd-hackers-outgoing; Mon, 15 Feb 1999 16:17:35 -0800 (PST) (envelope-from owner-freebsd-hackers@FreeBSD.ORG) Received: from wall.polstra.com (rtrwan160.accessone.com [206.213.115.74]) by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id QAA00239 for ; Mon, 15 Feb 1999 16:17:34 -0800 (PST) (envelope-from jdp@polstra.com) Received: from vashon.polstra.com (vashon.polstra.com [206.213.73.13]) by wall.polstra.com (8.9.1/8.9.1) with ESMTP id QAA03617; Mon, 15 Feb 1999 16:17:33 -0800 (PST) (envelope-from jdp@polstra.com) From: John Polstra Received: (from jdp@localhost) by vashon.polstra.com (8.9.1/8.9.1) id QAA52267; Mon, 15 Feb 1999 16:17:32 -0800 (PST) (envelope-from jdp@polstra.com) Date: Mon, 15 Feb 1999 16:17:32 -0800 (PST) Message-Id: <199902160017.QAA52267@vashon.polstra.com> To: nsmart@kira.team400.ie Subject: Re: select() can set errno to ECHILD? In-Reply-To: <36C85A77.EDBC00F9@kira.team400.ie> References: <19990215015534.A20671@oss.uswest.net> Organization: Polstra & Co., Seattle, WA Cc: hackers@FreeBSD.ORG Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG In article <36C85A77.EDBC00F9@kira.team400.ie>, Niall Smart wrote: > Erik E Rantapaa wrote: > > > > I have code running under 2.2.x which claims that this is happening. > > This behaviour is not documented in the man pages. I have not been able to > > duplicate it in a simple test program I wrote, but the log files for > > a Merit RADIUS server say that it is happening. > > > > Is this at all possible? > > You are getting SIGCHLD while blocked in select, waitpid with WNOHANG in > then handler returns ECHILD, the signal handler fails to restore errno. But when the signal handler returns, it will return to select() again, right? And select will either continue and eventually succeed returning some number >= 0, or it will itself set errno (perhaps to EINTR) and return -1, right? So if the caller of select checks its return value and only looks at errno if the return value is -1, I can't see how anything the signal handler does could confuse it. In other words, if there is a bug in the application then it must be that the application fails to check the return value of select before examining errno. John -- John Polstra jdp@polstra.com John D. Polstra & Co., Inc. Seattle, Washington USA "Nobody ever went broke underestimating the taste of the American public." -- H. L. Mencken To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message