Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 3 Jan 2002 17:05:29 -0500
From:      "Michael Scheidell" <scheidell@secnap.net>
To:        "Stefan Esser" <se@FreeBSD.ORG>
Cc:        <hackers@FreeBSD.ORG>, <deraison@cvs.nessus.org>
Subject:   Re: Re: userland program panics freebsd 4.3
Message-ID:  <007501c194a2$c23599b0$2801010a@MIKELT>
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>

next in thread | previous in thread | raw e-mail | index | archive | help
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" <se@FreeBSD.ORG>
To: "John Rochester" <john@jrochester.org>
Cc: <hackers@FreeBSD.ORG>; "Stefan Esser" <se@FreeBSD.ORG>
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 <john@jrochester.org> 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




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?007501c194a2$c23599b0$2801010a>