[Previous]
[Contents]
[Next]

qnx_spawn_options

a structure of default values to be sent to qnx_spawn

Synopsis:

#include <sys/types.h>
#include <sys/qnx_glob.h>

struct _qnx_spawn_globs {
    struct _proc_spawn *msgbuf;
    nid_t       node;
    char        priority;
    char        sched_algo;
    short int   flags;
    char        iov[10];
    char        ctfd;
    char        reserved1;
    short int   reserved2[5];
    } qnx_spawn_options;

Description:

This global structure sets the default values to be passed to qnx_spawn() when any of the spawn...() and exec...() functions are called. For information on these options, see the qnx_spawn() function. It's initialized to the following values:

struct _qnx_spawn_globs qnx_spawn_options =
   {
   NULL, 0L, -1, -1, 0,
   { 0xff, 0xff, 0xff, 0xff, 0xff,
     0xff, 0xff, 0xff, 0xff, 0xff},
   0xff, 0, { 0 }
   };

These default values, passed as parameters to qnx_spawn(), cause it to behave as follows:

NULL
allocate its own buffer (and release it)
0L
spawn on the current node
-1, -1
use the priority and scheduling algorithm of your process
0
use flags of zero
{ 0xff, ..., 0xff}
inherit your existing file descriptors for stdin, stdout, stderr, ... through 9.
0xff
controlling terminal file descriptor (ignored because the _SPAWN_SETSID flag isn't set)

Examples:

#include <unistd.h>   /* for spawnlp() */
#include <sys/types.h>
#include <sys/qnx_glob.h>

int main( void )
{
  /* Set priority  */
  qnx_spawn_options.priority = 20;

  /* Do the spawn  */
  pid = spawnlp( 1, "my_cmd", "arg", NULL );

  /* Reset default */
  qnx_spawn_options.priority = -1;
  exit (EXIT_SUCCESS);
}

Classification:

QNX

See also:

errno, exec... functions, fork(), qnx_spawn(), spawn... functions, wait(), waitpid()


[Previous]
[Contents]
[Next]