On Mon, 23 Oct 2000, Alexander Indenbaum wrote:

> Hi!
> 
> I'm writing c++ library which should find pid 
> by process "name" - command line.
> This library should work on Linux Solaris and HP-UX.
> How do I do it?
> 
>   Alexander Indenbaum
>   [EMAIL PROTECTED]
>

A naive solution would be to parse the output of ps. I'm not sure if the
ps output and flags are portable across these three platforms, but it's
probably the most portable solution I can think of.

AFAIK, ps uses the proc filesystem to gather information, at least on
Linux. So you might be able to use that.

I suggest you take a look at the source of the procps utilities. That of
course is assuming they are not Linux specific.

Regards,

        Shlomi Fish
 
> 
> =================================================================
> To unsubscribe, send mail to [EMAIL PROTECTED] with
> the word "unsubscribe" in the message body, e.g., run the command
> echo unsubscribe | mail [EMAIL PROTECTED]
> 
> 



----------------------------------------------------------------------
Shlomi Fish        [EMAIL PROTECTED] 
Home Page:         http://t2.technion.ac.il/~shlomif/
Home E-mail:       [EMAIL PROTECTED]

The prefix "God Said" has the extraordinary logical property of 
converting any statement that follows it into a true one.


=================================================================
To unsubscribe, send mail to [EMAIL PROTECTED] with
the word "unsubscribe" in the message body, e.g., run the command
echo unsubscribe | mail [EMAIL PROTECTED]

Reply via email to