pl help on getting pid of certain process..

How Do I find the pid of certain process? the one i’m interetsted is phrelay
and inetd, I need
a function equivalent of shell function ‘sin’, I tried to use
qnx_name_locate passing in qnx/phrelay,
didn’t work, qnx_name_query() didn’t report that phrelay is a registered
process…what processes
are supposed to be registered? how can I find the unregistered ones???

Use qnx_ps_info(). You have to recurse through all processes looking for
the one who’s name matches what you are looking for.

When you give it a pid, if that pid is not found it returns the next hishest
pid. So increment the pid it returns to you each time you call it again.


Bill Caroselli – 1(626) 824-7983
Q-TPS Consulting
QTPS@EarthLink.net


“ran zhang” <rzhang@vamcointernational.com> wrote in message
news:a77h01$min$1@inn.qnx.com

How Do I find the pid of certain process? the one i’m interetsted is
phrelay
and inetd, I need
a function equivalent of shell function ‘sin’, I tried to use
qnx_name_locate passing in qnx/phrelay,
didn’t work, qnx_name_query() didn’t report that phrelay is a registered
process…what processes
are supposed to be registered? how can I find the unregistered ones???

Bill:
your tips works great, what’s the best way of determine the status of a
process? I’m trying
to monitor photon and phrelay, phrelay seems to freeze up photon if
connection is lost
between qnx and window machines using Phindow. I need a way of determine
if photon is frozen, so i kill phrelay immidiately… thank u.


Bill Caroselli <qtps@earthlink.net> wrote in message
news:a77jc3$o02$1@inn.qnx.com

Use qnx_ps_info(). You have to recurse through all processes looking for
the one who’s name matches what you are looking for.

When you give it a pid, if that pid is not found it returns the next
hishest
pid. So increment the pid it returns to you each time you call it again.


Bill Caroselli – 1(626) 824-7983
Q-TPS Consulting
QTPS@EarthLink.net


“ran zhang” <> rzhang@vamcointernational.com> > wrote in message
news:a77h01$min$> 1@inn.qnx.com> …
How Do I find the pid of certain process? the one i’m interetsted is
phrelay
and inetd, I need
a function equivalent of shell function ‘sin’, I tried to use
qnx_name_locate passing in qnx/phrelay,
didn’t work, qnx_name_query() didn’t report that phrelay is a registered
process…what processes
are supposed to be registered? how can I find the unregistered ones???
\

I’m not sitting at a QNX CPU so I can’t give you field names off the top of
my head. But look at /usr/include/sys/psinfo() or qnxpsinfo() with or
without a few underscores.

You should see enums or defines that enumerate the process states. Also
look for the status field in that struct. Again I’m not sure what the field
names are.


Bill Caroselli – 1(626) 824-7983
Q-TPS Consulting
QTPS@EarthLink.net


“ran zhang” <rzhang@vamcointernational.com> wrote in message
news:a77rmo$re$1@inn.qnx.com

Bill:
your tips works great, what’s the best way of determine the status of
a
process? I’m trying
to monitor photon and phrelay, phrelay seems to freeze up photon if
connection is lost
between qnx and window machines using Phindow. I need a way of determine
if photon is frozen, so i kill phrelay immidiately… thank u.


Bill Caroselli <> qtps@earthlink.net> > wrote in message
news:a77jc3$o02$> 1@inn.qnx.com> …
Use qnx_ps_info(). You have to recurse through all processes looking
for
the one who’s name matches what you are looking for.

When you give it a pid, if that pid is not found it returns the next
hishest
pid. So increment the pid it returns to you each time you call it
again.


Bill Caroselli – 1(626) 824-7983
Q-TPS Consulting
QTPS@EarthLink.net


“ran zhang” <> rzhang@vamcointernational.com> > wrote in message
news:a77h01$min$> 1@inn.qnx.com> …
How Do I find the pid of certain process? the one i’m interetsted is
phrelay
and inetd, I need
a function equivalent of shell function ‘sin’, I tried to use
qnx_name_locate passing in qnx/phrelay,
didn’t work, qnx_name_query() didn’t report that phrelay is a
registered
process…what processes
are supposed to be registered? how can I find the unregistered
ones???


\