posix_spawnattr_getschedparam or posix_spawnattr_setschedparam Subroutine
Purpose
Gets and sets the spawn-schedparam attribute of a spawn attributes object.
Syntax
#include <spawn.h>
#include <sched.h>
int posix_spawnattr_getschedparam(const posix_spawnattr_t *
restrict attr, struct sched_param *restrict schedparam);
int posix_spawnattr_setschedparam(posix_spawnattr_t *restrict attr,
const struct sched_param *restrict schedparam);
Description
The posix_spawnattr_getschedparam subroutine gets the value of the spawn-schedparam attribute from the attributes object referenced by attr.
The posix_spawnattr_setschedparam subroutine sets the spawn-schedparam attribute in an initialized attributes object referenced by attr.
The spawn-schedparam attribute represents the scheduling parameters to be assigned to the new process image in a spawn operation (if POSIX_SPAWN_SETSCHEDULER or POSIX_SPAWN_SETSCHEDPARAM is set in the spawn-flags attribute). The default value of this attribute is unspecified.
Return Values
Upon
successful completion, the posix_spawnattr_getschedparam subroutine
returns 0
and stores the value of the spawn-schedparam attribute
of attr into the object referenced by the schedparam parameter;
otherwise, an error number is returned to indicate the error.
Upon
successful completion, the posix_spawnattr_setschedparam subroutine
returns 0
; otherwise, an error number is returned
to indicate the error.
Error Codes
Item | Description |
---|---|
EINVAL | The value specified by attr is invalid. |
Item | Description |
---|---|
EINVAL | The value of the attribute being set is not valid. |