*BSD News Article 19041


Return to BSD News archive

Xref: sserve comp.unix.bsd:12336 comp.unix.questions:37174 comp.sys.sun.misc:8906
Newsgroups: comp.unix.bsd,comp.unix.questions,comp.sys.sun.misc
Path: sserve!newshost.anu.edu.au!munnari.oz.au!news.Hawaii.Edu!ames!olivea!pagesat!decwrl!csus.edu!netcom.com!rogerr
From: rogerr@netcom.com (roger reynolds)
Subject: how to pid of process started with popen() ?
Message-ID: <rogerrCAynxB.65A@netcom.com>
Followup-To: poster
Organization: NETCOM On-line Communication Services (408 241-9760 guest)
Date: Fri, 30 Jul 1993 04:46:22 GMT
Lines: 16

	Here is a question that just came up today, and off the
	top of my head, I cant think how to do it...
	
	I open a pipe to a process using popen, as in:
		fp = popen ("some job", "r");
	and now, for some reason lets say I want to kill that
	job, by sending kill(pid) to it.  But, how do I get the
	pid of the process?

	It would be a shame if I have to do my own fork,exec thing
	just to handle this, the popen thing is so cute and easy!

	Please respond by email if thats ok..
	Thanks a bunch,

	rogerr@netcom.com