How to get PID from another process

Hello World!

Is there any method to obtain PID of one process (server) from another
process (client) to make a connection to channel created in server?
I know one way, that is to register a server as a file (/dev/server) and
try to open it and get it’s fd, but I’m not sure if it is right way when
I’m not writing a resource manager.

Darek Borkowski

Have a look at name_attach() and name_open()
Markus

“Drek Borkowski” <borkows@uci.agh.edu.pl> wrote in message
news:9khu71$qu0$1@inn.qnx.com

Hello World!

Is there any method to obtain PID of one process (server) from another
process (client) to make a connection to channel created in server?
I know one way, that is to register a server as a file (/dev/server) and
try to open it and get it’s fd, but I’m not sure if it is right way when
I’m not writing a resource manager.

Darek Borkowski

Is there another way to get its pid and coid if an server is on an different
node? I have seen in the doc that name_attach does not support global name.
Regards.
Qingguo K
“Markus Loffler” <loffler@ces.clemson.edu> a écrit dans le message news:
9khv1e$rir$1@inn.qnx.com

Have a look at name_attach() and name_open()
Markus

“Drek Borkowski” <> borkows@uci.agh.edu.pl> > wrote in message
news:9khu71$qu0$> 1@inn.qnx.com> …
Hello World!

Is there any method to obtain PID of one process (server) from another
process (client) to make a connection to channel created in server?
I know one way, that is to register a server as a file (/dev/server) and
try to open it and get it’s fd, but I’m not sure if it is right way when
I’m not writing a resource manager.

Darek Borkowski

Qingguo Kou <qingguo@irg.ca> wrote:

Is there another way to get its pid and coid if an server is on an different
node? I have seen in the doc that name_attach does not support global name.
Regards.

Somebody posted a little bit of code that basically runs through all of
/net/… and tries to open the name on each node until it finds it. That
will work.

It actually was pretty fast as well – and since it should be init time
code, the overhead shouldn’t be too bad.

-David


QNX Training Services
dagibbs@qnx.com