Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 4 Oct 2002 17:01:00 +0200
From:      Cliff Sarginson <cls@raggedclown.net>
To:        Oliver Fromme <olli@secnetix.de>
Cc:        freebsd-questions@FreeBSD.ORG
Subject:   Re: killing an application through code
Message-ID:  <20021004150100.GB1537@raggedclown.net>
In-Reply-To: <200210041431.g94EVn1R057459@lurza.secnetix.de>
References:  <200210011702.g91H2gZN051898@axp.csl.sri.com> <200210041431.g94EVn1R057459@lurza.secnetix.de>

next in thread | previous in thread | raw e-mail | index | archive | help
On Fri, Oct 04, 2002 at 04:31:49PM +0200, Oliver Fromme wrote:
> Mike Hogsett <hogsett@csl.sri.com> wrote:
>  > 
>  > > Can anyone tell me how i can kill an application
>  > > process through a piece of C code?
>  > 
>  > man killall
> 
> He was asking for C code.  Well, in C, the easiest way
> is probably to go through the procfs(5) filesystem to
> find the PID and then use the kill(2) system call.  This
> isn't portable, though, but I don't think that there is
> a portable way to do it.
> 
> Regards
>    Oliver
> 
Well if he has control over the application he could make it record it's
pid somewhere as many system programs do, and use that. He should bear
in mind of course he will only be able to kill them stone dead if he
owns them or is root. This is definitely portable !

-- 
Regards
   Cliff Sarginson 
   The Netherlands

       Email: cls@raggedclown.net
       Tel  : +31 (0)10 4764595

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-questions" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20021004150100.GB1537>