ask for some functions

hello,everybody

I am trying to do some programming practices with QNX6.1,can anybody
introduce some functions to me?

1,first,I am thinking are there some functions which can let me know the
state and informations of another process running in a remote node? that
is,its pid,whether it is blocked,active or died?(the process’ name is
known).

2,there is a global variable named errno ,and a utility of the same name
which can expain the errno to string,I am thinking is there a function which
can take the number of errno as its input parameter and the output will be
the error string?or how can I redirect the output of the utility errno to a
string varible in my application?

3,in phab I create a application,I try to output a string to a terminal,so,I
fd=open("/dev/ptyp1",…) and write the string to the fd,but nothing
happened,why open can not open a pterm for me?and,if I spawnlp(pterm) myself
before the open operation,the pterm was loaded,but still the string can not
be wreted to it,y?

ChaoLi <QNX_NEW@sohu.com> wrote:

hello,everybody

I am trying to do some programming practices with QNX6.1,can anybody
introduce some functions to me?

1,first,I am thinking are there some functions which can let me know the
state and informations of another process running in a remote node? that
is,its pid,whether it is blocked,active or died?(the process’ name is
known).

No such “function”. But it is doable. The source code of “pidin”
is posted on QNX cvs webpage.

2,there is a global variable named errno ,and a utility of the same name
which can expain the errno to string,I am thinking is there a function which
can take the number of errno as its input parameter and the output will be
the error string?or how can I redirect the output of the utility errno to a
string varible in my application?

strerror()

3,in phab I create a application,I try to output a string to a terminal,so,I
fd=open("/dev/ptyp1",…) and write the string to the fd,but nothing
happened,why open can not open a pterm for me?and,if I spawnlp(pterm) myself
before the open operation,the pterm was loaded,but still the string can not
be wreted to it,y?

You really want to think about what you are trying to do.
You probably need to spawn a pterm, figure out what pty/tty
it is using, and then open/write/close to it.

However, a photon utility print something out on a “terminal”
sounds strange. Photon have planty of function to output
infomation in a “window”.

-xtang

“Xiaodan Tang” <xtang@qnx.com> wrote in message
news:a7veej$1h3$1@nntp.qnx.com

ChaoLi <> QNX_NEW@sohu.com> > wrote:
hello,everybody

I am trying to do some programming practices with QNX6.1,can anybody
introduce some functions to me?

1,first,I am thinking are there some functions which can let me know the
state and informations of another process running in a remote node? that
is,its pid,whether it is blocked,active or died?(the process’ name is
known).

No such “function”. But it is doable. The source code of “pidin”
is posted on QNX cvs webpage.

2,there is a global variable named errno ,and a utility of the same name
which can expain the errno to string,I am thinking is there a function
which
can take the number of errno as its input parameter and the output will
be
the error string?or how can I redirect the output of the utility errno
to a
string varible in my application?

strerror()

3,in phab I create a application,I try to output a string to a
terminal,so,I
fd=open("/dev/ptyp1",…) and write the string to the fd,but nothing
happened,why open can not open a pterm for me?and,if I spawnlp(pterm)
myself
before the open operation,the pterm was loaded,but still the string can
not
be wreted to it,y?

You really want to think about what you are trying to do.
You probably need to spawn a pterm, figure out what pty/tty
it is using, and then open/write/close to it.

another option would be to pass file descriptors into the spawn command so
that you can talk to the pterm.

However, a photon utility print something out on a “terminal”
sounds strange. Photon have planty of function to output
infomation in a “window”.

-xtang