DOC HOME SITE MAP MAN PAGES GNU INFO SEARCH PRINT BOOK
 

sched_getparam(S)


sched_getparam -- get scheduling parameters

Syntax

cc . . . -lc

#include <sched.h>

int sched_getparam(pid_t pid, struct sched_param *param);

Description

sched_getparam returns the scheduling parameters of the process specified by pid in param. If pid is 0, the parameters for the calling process are returned.

On MPX systems, if pid specifies a process currently running on a different CPU then the process specified by pid will be taken off the CPU. This is the equivalent of the process specified by pid making a call to sched_yield. The process which made the call to sched_getparam will sleep while this occurs.

Return values

Upon successful completion sched_getparam returns zero. If an error has occurred the function returns -1, and errno is set to indicate the error.

Diagnostics

If sched_getparam terminates due to an error, it will set errno to one of the following values:

[ENOSYS]
The function is not supported.

[EPERM]
The requesting process does not have the privilege to get the scheduling parameters for the process specified by pid.

[ESRCH]
The process, specified by pid, does not exist.

Examples

The following example illustrates the use of sched_getparam:
   struct sched_param sp1;
   int child_id;
   ...
   if((child_id = fork()) == -1) {
      fprintf(stderr, ...
      exit(1);
   }
   

if(child_id == 0) { if(sched_getparam(0, &sp1) == 0) { sp1.sched_priority++; sched_setparam(0, &sp1); ... } } ...

Files


/usr/lib/libc.a
linking library

See also

sched_get_priority_max(S), sched_getscheduler(S), sched_rr_get_interval(S), sched_setparam(S), sched_setscheduler(S), sched_yield(S)

Standards conformance

Text reprinted and/or adapted from IEEE Std 1003.1b-1993, IEEE Standard for Information Technology, POSIX Part 1: System Application Program Interface (API) Amendment 1: Realtime Extensions [C Language], copyright © 1993 by the Institute of Electrical and Electronics Engineers, Inc. The IEEE takes no responsibility for and will assume no liability for damages resulting from the reader's misinterpretation of said information resulting from the placement and context in this publication. Information is reproduced with the permission of the IEEE.
© 2003 Caldera International, Inc. All rights reserved.
SCO OpenServer Release 5.0.7 -- 11 February 2003