Article View: comp.unix
Article #265Re: How to find process name in c
From: Tony Rems
Date: Sat, 13 Oct 1990 08:37
Date: Sat, 13 Oct 1990 08:37
14 lines
866 bytes
866 bytes
In article <2190@megadon.UUCP> you write:
>Has anyone got a method for finding out if a process is running short of
>"ps -ef | grep processname" in a pipe. There must be a better way from
>within a c program.
Well, you can perform the above task in C by, doing a
popen("ps -ef", "r");
check the popen man page. Your other alternative is
to go digging into the kernel to check the process
table. Why do the work when ps has already done it
for you?
-Tony
Technical Details
Message-ID:
<2206@megadon.UUCP>Path:
arc1-ca.pugleaf.net!utzoo!attcan!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!usc!elroy.jpl.nasa.gov!ames!vsi1!altos!megadon!clpShow Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!attcan!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!usc!elroy.jpl.nasa.gov!ames!vsi1!altos!megadon!clp From: rembo@unisoft.com (Tony Rems) Newsgroups: comp.unix Subject: Re: How to find process name in c Message-ID: <2206@megadon.UUCP> Date: 13 Oct 90 08:37:42 GMT Sender: clp@megadon.UUCP Lines: 14 Approved: clp@megadon.UUCP In-Reply-To: <2190@megadon.UUCP>