posix_spawnattr_settypeid()
Set the type identifier of a spawn attributes object
Synopsis:
#include <spawn.h>
int posix_spawnattr_settypeid(
posix_spawnattr_t *attrp, uint32_t type_id);
Arguments:
- attrp
- A pointer to the spawn attributes object that you want to modify.
- type_id
- The type identifier to associate with the spawned process.
Library:
libc
Use the -l c option to qcc to link against this library. This library is usually included automatically.
Description:
A type identifier associates a process or channel with a set of
rules in order to protect or restrict it. The security policy contains the rules for all type
identifiers. To learn more about security policies, see Security
Policies
in the System Security Guide.
This function is equivalent to calling secpol_posix_spawnattr_settypeid(), but secpol_posix_spawnattr_settypeid() is simpler to use and allows a process to work both with and without security policies.
- You must pass the posix_spawnattr_t attributes object as a parameter to posix_spawn().
- You must have set POSIX_SPAWN_SETTYPEID in the spawn flags by calling posix_spawnattr_setxflags().
The calling process must have the PROCMGR_AID_SETTYPEID ability with a range
that includes this type identifier. Typically, this ability is set by a security policy.
For more information, see Security Policies
in the System Security Guide.
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:
Safety: | |
---|---|
Cancellation point | No |
Signal handler | Yes |
Thread | Yes |