spawn()

Hi.

I’m a new QNX 6.2.1 developer, I was developing on QNX 4.25 and I use the
spawnl() to launch proceses setting the qnx_spawn_flags, but these are no
longer supported.

I’m interested in use any spawn*() family functions that let me set the
NOZOMBIE flag in order to let the proceses die and get back all of its
resources.

Thanks in advance

Antonio

Antonio Diaz Couder <antonio.diazcouder@indap.com.mx> wrote:

Hi.

I’m a new QNX 6.2.1 developer, I was developing on QNX 4.25 and I use the
spawnl() to launch proceses setting the qnx_spawn_flags, but these are no
longer supported.

I’m interested in use any spawn*() family functions that let me set the
NOZOMBIE flag in order to let the proceses die and get back all of its
resources.

There is a SPAWN_NOZOMBIE flag that can be set for the flags passed
in a spawn inheritance structure for spawn().

Do you need to do this on a per-child death? That is, for a parent
process, do you need some children spawned with NOZOMBIE, and some
other children where you want to be able to wait() on their death?

If not, a more portable way (works under QNX4, QNX6, and other Unix
like OSes) would be to do a signal( SIGCHLD, SIG_IGNORE) in the
parent process.

-David

Please follow-up to newsgroup, rather than personal email.
David Gibbs
QNX Training Services
dagibbs@qnx.com

Antonio Diaz Couder <antonio.diazcouder@indap.com.mx> wrote:


No, I just need to create new child proceses that will die and I need that
the child proceses free all its resources, I do not need to know when they
die.


If not, a more portable way (works under QNX4, QNX6, and other Unix
like OSes) would be to do a signal( SIGCHLD, SIG_IGNORE) in the
parent process.

It is like a good option for me, however, I’ve never worked with that
signals, could you
tell me where to read about them for QNX 6.2.1?

Well, QNX6’s signal implementation is pretty well driven by POSIX,
so we don’t have a lot of programming with signals information in
our documentation – a standard Unix programming book on that would
work.

The particular behaviour I mentioned is documented in the library
reference entry for SignalAction() (the implementing kernel call –
but I recommend actually using the standard functions signal() or
sigaction() instead) where it says:

SIG_IGN
Ignore the signal. If your process ignores SIGCHLD, its
children won’t enter the zombie state and the process can’t
use wait() or waitpid() to wait on their deaths.

Which is the behaviour you are looking for, implemented in a
portable way.

-David

Please follow-up to newsgroup, rather than personal email.
David Gibbs
QNX Training Services
dagibbs@qnx.com

“David Gibbs” <dagibbs@qnx.com> escribió en el mensaje
news:c8ibf6$ddd$1@inn.qnx.com

Antonio Diaz Couder <> antonio.diazcouder@indap.com.mx> > wrote:
Hi.

I’m a new QNX 6.2.1 developer, I was developing on QNX 4.25 and I use
the
spawnl() to launch proceses setting the qnx_spawn_flags, but these are
no
longer supported.

I’m interested in use any spawn*() family functions that let me set the
NOZOMBIE flag in order to let the proceses die and get back all of its
resources.

There is a SPAWN_NOZOMBIE flag that can be set for the flags passed
in a spawn inheritance structure for spawn().

Do you need to do this on a per-child death? That is, for a parent
process, do you need some children spawned with NOZOMBIE, and some
other children where you want to be able to wait() on their death?

No, I just need to create new child proceses that will die and I need that
the child proceses free all its resources, I do not need to know when they
die.

If not, a more portable way (works under QNX4, QNX6, and other Unix
like OSes) would be to do a signal( SIGCHLD, SIG_IGNORE) in the
parent process.

It is like a good option for me, however, I’ve never worked with that
signals, could you
tell me where to read about them for QNX 6.2.1?

-David

Please follow-up to newsgroup, rather than personal email.
David Gibbs
QNX Training Services
dagibbs@qnx.com