C program to get pid of a process

grx0736 at uoft02.utoledo.edu grx0736 at uoft02.utoledo.edu
Fri Apr 26 03:16:46 AEST 1991


unix gurus,

	i would like to get pid of a running process without
using "ps".  I know the name of the running process. I intend 
to this thru' a C program (without giving a "system" call and
running shell script in it) which could use some library functions
to get information about the pid of a running process. 

	the system i am working on is Sun386i with SunOS 4.0.2
I believe kvm_open, kvm_nextproc etc. are the library functions 
to be used to get such information. Don't know how to use these
functions though.

	In short, i am looking for something like

	get_process_id("process_name");

	any info. would be highly appreciated.

sunil kulkarni



More information about the Comp.unix.internals mailing list