From owner-freebsd-questions Fri Oct 4 8:11:49 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 22CD537B401 for ; Fri, 4 Oct 2002 08:11:48 -0700 (PDT) Received: from lurza.secnetix.de (lurza.secnetix.de [212.66.1.130]) by mx1.FreeBSD.org (Postfix) with ESMTP id 4491B43E3B for ; Fri, 4 Oct 2002 08:11:47 -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 g94FBjmC059165 for ; Fri, 4 Oct 2002 17:11:46 +0200 (CEST) (envelope-from oliver.fromme@secnetix.de) Received: (from olli@localhost) by lurza.secnetix.de (8.12.5/8.12.5/Submit) id g94FBj4n059164; Fri, 4 Oct 2002 17:11:45 +0200 (CEST) Date: Fri, 4 Oct 2002 17:11:45 +0200 (CEST) Message-Id: <200210041511.g94FBj4n059164@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: <20021004150100.GB1537@raggedclown.net> 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 Cliff Sarginson wrote: > On Fri, Oct 04, 2002 at 04:31:49PM +0200, Oliver Fromme wrote: > > 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. > > 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. Sure, but he was talking about Realplayer. I doubt he has control over that one. :-) Well, okay, he could write a wrapper script that runs the application (Realplayer or whatever) in the background and records the PID somewhere. But that's not always possible. Regards Oliver PS: Please respect the Reply-To header. -- 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