obout process control

1.how to program to wakeup or resume a process in another process which has
no parent-child relation ?
2.how to program to kill a external process in another process?(there is no
relation between process)

“zhz_zhang” <zhz_zhang@263.net> wrote in message
news:a1c7qg$8kk$1@inn.qnx.com

1.how to program to wakeup or resume a process in another process which
has
no parent-child relation ?

Condvars in shared memory (check out pthread_cond_wait() or
pthread_sleepon_wait())

2.how to program to kill a external process in another process?(there is
no
relation between process)

See the help docs on kill()


Cheers,
Adam

QNX Software Systems Ltd.
[ amallory@qnx.com ]

With a PC, I always felt limited by the software available.
On Unix, I am limited only by my knowledge.
–Peter J. Schoenster <pschon@baste.magibox.net>

“Adam Mallory” <amallory@qnx.com> wrote in message
news:a1cdfq$hii$1@nntp.qnx.com

“zhz_zhang” <> zhz_zhang@263.net> > wrote in message
news:a1c7qg$8kk$> 1@inn.qnx.com> …
1.how to program to wakeup or resume a process in another process which
has
no parent-child relation ?

Condvars in shared memory (check out pthread_cond_wait() or
pthread_sleepon_wait())

2.how to program to kill a external process in another process?(there is
no
relation between process)

See the help docs on kill()


Cheers,
Adam

QNX Software Systems Ltd.
[ > amallory@qnx.com > ]

With a PC, I always felt limited by the software available.
On Unix, I am limited only by my knowledge.
–Peter J. Schoenster <> pschon@baste.magibox.net




Thank for your advice.

But to the question 2
I have seen the help docs on kill()-" int kill( pid_t pid,int sig );"
I need the argument ‘pid’,I want to know how to get a detached
process 's pid ,by name or by others method? like ‘slay’ utility?
hwo to do it in program?

“zhz_zhang” <zhz_zhang@263.net> wrote in message
news:a1eqb1$3sc$1@inn.qnx.com

Thank for your advice.
But to the question 2
I have seen the help docs on kill()-" int kill( pid_t pid,int sig );"
I need the argument ‘pid’,I want to know how to get a detached
process 's pid ,by name or by others method? like ‘slay’ utility?
hwo to do it in program?

You can walk the procfs (/proc) tree to find pid’s active in the system.
Then use a devctl(fd, DCMD_PROC_SYSINFO, sysinfo, …) call to extract
information about that pid (like the name).

Check out the /usr/include/sys/procfs.h file for information on
procfs_sysinfo. Also on public CVS is the pidin utility, which does exactly
what you want to. (http://cvs.qnx.com)

Cheers,
Adam

QNX Software Systems Ltd.
[ amallory@qnx.com ]

With a PC, I always felt limited by the software available.
On Unix, I am limited only by my knowledge.
–Peter J. Schoenster <pschon@baste.magibox.net>