posix_spawnattr_addpartition()

Specify the name of a resource partition that the spawned process should be associated with

Synopsis:

#include <spawn.h>

int posix_spawnattr_addpartition(
       posix_spawnattr_t *_Restrict attrp,
       const char *partition_path,
       part_dcmd_flags_t part_flags);

Arguments:

attrp
A pointer to the spawn attributes object that you want to modify.
partition_path
A path to the partition. Given a full partition path, determine the path type (memory/sched/ etc.) and return a pointer to the name suffix (i.e., the portion of the name after /partition/mem/ or /partition/sched/), if possible.
part_flags
The flags you want to associate with the partition. No flags are currently defined, so pass 0 for this argument.

Library:

libc

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

Description:

The posix_spawnattr_addpartition() function specifies a resource partition that the spawned process should be associated, and it's the most convenient form of adding partition associations because it accepts a partition name rather than an ID. You must have already initialized the spawn attributes object by calling posix_spawnattr_init().

Partition names can either be group names, pseudo-partitions or real partitions, and are always resolved to a "real" partition; otherwise, an error is returned.

Note: If partition_path doesn't refer to a real partition, then the part_flags argument applies to all resolved real partitions referred to by the group name or pseudo-partition. This may result in an error if the flag doesn't apply to the partition type (as reported by the PART_TYPE() macro defined in <sys/part.h>).

The partition association takes effect only if the POSIX_SPAWN_SETSPART flag is set in the spawn attributes; to set this flag, call posix_spawnattr_setxflags(). Setting this flag without specifying a scheduling partition may produce unintended results.

For information about inheritance rules as they apply to partition association, see the Adaptive Partitioning Users Guide.

Note: This function is a QNX Neutrino extension.

Returns:

EOK
Success.
EINVAL
An argument was invalid.
ENOMEM
The partition ID couldn't be added to the attributes object.
Note: If this function fails and the partition_name provided is a group name, some of the pseudo-partitions within the group name might have been added to the attributes object pointed to by attrp. For this scenario, we recommend that you destroy the attributes object, and initialize a new attributes object.
Note: Some partition association errors may not be reported until the posix_spawn() call is made.

Classification:

QNX Neutrino

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