posix_spawnattr_setasid()

QNX SDP8.0C Library ReferenceAPIDeveloper

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. On aarch64 targets, this value must be 0 or the subsequent process creation via posix_spawn() or posix_spawnp() will fail with ENOTSUP. On x86_64 targets, the value of this setting is ignored because the kernel independently selects an address space ID for the spawn attributes object.

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
The attrp pointer does not refer to a valid attribute structure.

Classification:

QNX OS

Safety:
Cancellation point No
Signal handler Yes
Thread Yes
Page updated: