From owner-freebsd-hackers Thu Jan 3 14: 6: 8 2002 Delivered-To: freebsd-hackers@freebsd.org Received: from scanner.secnap.net (scanner.secnap.net [216.241.67.74]) by hub.freebsd.org (Postfix) with ESMTP id 798E637B41D; Thu, 3 Jan 2002 14:06:01 -0800 (PST) Received: from MIKELT ([10.1.1.40]) by scanner.secnap.net (8.11.6/8.11.5) with SMTP id g03M60357732; Thu, 3 Jan 2002 17:06:00 -0500 (EST) (envelope-from scheidell@secnap.net) Message-ID: <007501c194a2$c23599b0$2801010a@MIKELT> From: "Michael Scheidell" To: "Stefan Esser" Cc: , References: <20011231165828.D2301@StefanEsser.FreeBSD.org> <200112311631.fBVGVtZ45017@scanner.secnap.net> <20020101203614.A11265@StefanEsser.FreeBSD.org> <3C32150C.7000504@jrochester.org> <20020101232546.A40539@StefanEsser.FreeBSD.org> Subject: Re: Re: userland program panics freebsd 4.3 Date: Thu, 3 Jan 2002 17:05:29 -0500 Organization: Secnap Network Security, LLC. MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 5.50.4807.1700 X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4807.1700 Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG Noop, just verified it again on FBSD 4.4 STABLE, this: int process_alive(pid) pid_t pid; { while (waitpid(pid, NULL, WNOHANG) < 0 && errno == EINTR) /* do nothing */; return kill(pid, 0) == 0; } misses a bunch of closed? deleted? usd up pids? on my client, it stays in 'SMB use SID to enemurate' but i verified these are not still runnning. only one that works is this code: /* * Invalid argument */ if(!pid) return 0; */ for(i=0,ret=1;(i<100) && (ret > 0);i++) ret = waitpid(pid, NULL, WNOHANG); return kill(pid, 0) == 0; Michael Scheidell Secnap Network Security, LLC scheidell@secnap.net 1+(561) 368-9561 See updated IT Security News at http://www.fdma.com/ ----- Original Message ----- From: "Stefan Esser" To: "John Rochester" Cc: ; "Stefan Esser" Sent: Tuesday, January 01, 2002 5:25 PM Subject: Re: Re: userland program panics freebsd 4.3 > On 2002-01-01 19:59 +0000, John Rochester wrote: > > Stefan Esser wrote: > > > > >Instead of the for loop, I'd rather have: > > > > > > while(waitpid(pid, NULL, WNOHANG) == EINTR) > > > > > This should be > > > > while (waitpid(pid, NULL, WNOHANG) < 0 && errno == EINTR) > > Yes, obviously ... ;-) > > STefan > > To Unsubscribe: send mail to majordomo@FreeBSD.org > with "unsubscribe freebsd-hackers" in the body of the message > To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message