| Skip Navigation Links | |
| Exit Print View | |
![]() | man pages section 3: Basic Library Functions Oracle Solaris 11 Information Library |
enable_extended_FILE_stdio(3C)
posix_spawnattr_getschedparam(3C)
posix_spawnattr_getschedpolicy(3C)
posix_spawnattr_getsigdefault(3C)
posix_spawnattr_getsigignore_np(3C)
posix_spawnattr_getsigmask(3C)
posix_spawnattr_setschedparam(3C)
posix_spawnattr_setschedpolicy(3C)
posix_spawnattr_setsigdefault(3C)
posix_spawnattr_setsigignore_np(3C)
posix_spawnattr_setsigmask(3C)
posix_spawn_file_actions_addclose(3C)
posix_spawn_file_actions_addclosefrom_np(3C)
posix_spawn_file_actions_adddup2(3C)
posix_spawn_file_actions_addopen(3C)
posix_spawn_file_actions_destroy(3C)
posix_spawn_file_actions_init(3C)
pthread_attr_getdetachstate(3C)
pthread_attr_getinheritsched(3C)
pthread_attr_getschedparam(3C)
pthread_attr_getschedpolicy(3C)
pthread_attr_setdetachstate(3C)
pthread_attr_setinheritsched(3C)
pthread_attr_setschedparam(3C)
pthread_attr_setschedpolicy(3C)
pthread_barrierattr_destroy(3C)
pthread_barrierattr_getpshared(3C)
pthread_barrierattr_setpshared(3C)
pthread_condattr_getpshared(3C)
pthread_condattr_setpshared(3C)
pthread_cond_reltimedwait_np(3C)
pthread_key_create_once_np(3C)
pthread_mutexattr_getprioceiling(3C)
pthread_mutexattr_getprotocol(3C)
pthread_mutexattr_getpshared(3C)
pthread_mutexattr_getrobust(3C)
pthread_mutexattr_setprioceiling(3C)
pthread_mutexattr_setprotocol(3C)
pthread_mutexattr_setpshared(3C)
pthread_mutexattr_setrobust(3C)
pthread_mutex_getprioceiling(3C)
pthread_mutex_reltimedlock_np(3C)
pthread_mutex_setprioceiling(3C)
pthread_rwlockattr_destroy(3C)
pthread_rwlockattr_getpshared(3C)
pthread_rwlockattr_setpshared(3C)
pthread_rwlock_reltimedrdlock_np(3C)
pthread_rwlock_reltimedwrlock_np(3C)
pthread_rwlock_timedrdlock(3C)
pthread_rwlock_timedwrlock(3C)
rctlblk_get_enforced_value(3C)
- set scheduling policy and scheduling parameters
#include <sched.h>intsched_setscheduler(pid_tpid,intpolicy,const struct sched_param *param);
Thesched_setscheduler() function sets the scheduling policy and scheduling parameters of theprocess specified bypid topolicy and the parameters specified in thesched_param structure pointed to byparam, respectively. The value of thesched_priority memberin thesched_param structure is any integer within the inclusive priority rangefor the scheduling policy specified bypolicy. Thesched_setscheduler() function ignores theother members of thesched_param structure. If the value ofpid isnegative, the behavior of thesched_setscheduler() function is unspecified.
The possible values for thepolicy parameter are defined in the header<sched.h> (seesched.h(3HEAD)):
If a process specified bypid exists and if the calling processhas permission, the scheduling policy and scheduling parameters are set for theprocess whose process ID is equal topid. The real oreffective user ID of the calling process must match the realor saved (fromexec(2)) user ID of the target process unlessthe effective user ID of the calling process is 0. SeeIntro(2).
Ifpid is 0, the scheduling policy and scheduling parameters are setfor the calling process.
To change thepolicy of any process to either of the realtime policiesSCHED_FIFO orSCHED_RR, the calling process must either havetheSCHED_FIFO orSCHED_RR policy or have an effective user ID of0.
Thesched_setscheduler() function is considered successful if it succeeds in setting thescheduling policy and scheduling parameters of the process specified bypid tothe values specified bypolicy and the structure pointed to byparam, respectively.
Upon successful completion, the function returns the former scheduling policy of thespecified process. If thesched_setscheduler() function fails to complete successfully, the policyand scheduling paramenters remain unchanged, and the function returns -1 and setserrno to indicate the error.
Thesched_setscheduler() function will fail if:
The value ofpolicy is invalid, or one or more of the parameters contained inparam is outside the valid range for the specified scheduling policy.
The requesting process does not have permission to set either or both of the scheduling parameters or the scheduling policy of the specified process.
No process can be found corresponding to that specified bypid.
Seeattributes(5) for descriptions of the following attributes:
|
priocntl(1),Intro(2),exec(2),priocntl(2),librt(3LIB),sched.h(3HEAD),sched_get_priority_max(3C),sched_getparam(3C),sched_getscheduler(3C),sched_setparam(3C),attributes(5),standards(5)
Copyright © 2011, Oracle and/or its affiliates. All rights reserved.Legal Notices | ![]() ![]() |