process ids

James Van Artsdalen james at bigtex.uucp
Sat Sep 3 05:38:28 AEST 1988


Why were there four different newgroups in the original posting?

In article <171 at ispi.UUCP>, jbayer at ispi.UUCP wrote:

> 	I have a need to be able to identify the parent of a process
> which is executing on the system.

> 	Anybody have any ideas?

Parse the output of ps(1).  Something like sscanf("%s %d %d", name,
&pid, &ppid) should suffice.  If you do parsing the proc structure
you'll be lucky if the code survives to the next revision of the
kernel, much less to another system.  Not really portable, but within
SysV it should be.
-- 
James R. Van Artsdalen    ...!uunet!utastro!bigtex!james     "Live Free or Die"
Home: 512-346-2444 Work: 328-0282; 110 Wild Basin Rd. Ste #230, Austin TX 78746



More information about the Comp.unix.questions mailing list