From owner-freebsd-questions Fri Oct 4 7:31:55 2002 Delivered-To: freebsd-questions@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 5C13A37B401 for ; Fri, 4 Oct 2002 07:31:54 -0700 (PDT) Received: from lurza.secnetix.de (lurza.secnetix.de [212.66.1.130]) by mx1.FreeBSD.org (Postfix) with ESMTP id 7FB8343E81 for ; Fri, 4 Oct 2002 07:31:53 -0700 (PDT) (envelope-from olli@lurza.secnetix.de) Received: from lurza.secnetix.de (localhost [IPv6:::1]) by lurza.secnetix.de (8.12.5/8.12.5) with ESMTP id g94EVnmC057460 for ; Fri, 4 Oct 2002 16:31:49 +0200 (CEST) (envelope-from oliver.fromme@secnetix.de) Received: (from olli@localhost) by lurza.secnetix.de (8.12.5/8.12.5/Submit) id g94EVn1R057459; Fri, 4 Oct 2002 16:31:49 +0200 (CEST) Date: Fri, 4 Oct 2002 16:31:49 +0200 (CEST) Message-Id: <200210041431.g94EVn1R057459@lurza.secnetix.de> From: Oliver Fromme To: freebsd-questions@FreeBSD.ORG Reply-To: freebsd-questions@FreeBSD.ORG Subject: Re: killing an application through code In-Reply-To: <200210011702.g91H2gZN051898@axp.csl.sri.com> X-Newsgroups: list.freebsd-questions User-Agent: tin/1.5.4-20000523 ("1959") (UNIX) (FreeBSD/4.6-STABLE (i386)) MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG Mike Hogsett 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 -- Oliver Fromme, secnetix GmbH & Co KG, Oettingenstr. 2, 80538 München Any opinions expressed in this message may be personal to the author and may not necessarily reflect the opinions of secnetix in any way. "All that we see or seem is just a dream within a dream" (E. A. Poe) To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message