posix_spawnattr_setasid()

Updated: April 19, 2023

Set the address space ID attribute in a spawn attributes object

Synopsis:

#include <spawn.h>

int posix_spawnattr_setasid(
       posix_spawnattr_t* attrp,
       uint32_t asid);

Arguments:

attrp
A pointer to the spawn attributes object that you want to modify.
asid
The address space ID that you want to use for spawned processes.

Library:

libc

Use the -l c option to qcc to link against this library. This library is usually included automatically.

Description:

The posix_spawnattr_setasid() function sets the value of the address space ID in the spawn attributes object pointed to by attrp. You must have already initialized this object by calling posix_spawnattr_init().

The asid value is used as the address space ID of the child process created by a spawn operation if POSIX_SPAWN_SETASID is set in the spawn flags. By default, a process spawned with posix_spawn() or posix_spawnp() inherits the address space ID from the parent process.

In order for the asid setting to take effect:

  1. You must set POSIX_SPAWN_SETASID in the spawn flags by calling posix_spawnattr_setxflags().
  2. You must pass the posix_spawnattr_t attributes object as a parameter to posix_spawn().

For more information about spawn attributes, see the entry for posix_spawn().

Returns:

EOK
Success.
EINVAL
An argument was invalid.

Classification:

QNX Neutrino

Safety:  
Cancellation point No
Interrupt handler Yes
Signal handler Yes
Thread Yes