SCHED_SETPARAM

Section: Linux Programmer's Manual (2)
Updated: 1996-04-10
Index
Return to Main Contents
 

이름

sched_setparam, sched_getparam - 스케줄링 매개 변수의 설정과 소유  

사용법

#include <sched.h>

int sched_setparam(pid_t pid, const struct sched_param *p);

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


    int sched_priority;
    ...
};

sched_setparam
은 스케줄링 매개 변수를 pid에 의해 인식되는 프로세스를 위해 스케줄링 정책과 관련해서 설정한다. pid 가 0이면 현제 프로세스의 매개 변수들이 설정된다.
매개 변수 p의 해석은 선택된 정책에 달렸다. 현재, 아래 세가지 스케줄링 정책이 리눅스에서 지원된다:
SCHED_FIFO,
SCHED_RR,
와 
SCHED_OTHER.

sched_getparam
는 pid 로 구분되는 프로세스를 위해 스케줄링 매개 변수를 검색한다.
pid 가 0이면, 현재 프로세스의 매개 변수는 검색된다.

sched_setparam
는 프로세스의 스케줄링 정책을 위해 p의 유효성을 확인한다.
매개 변수p->sched_priority는 반드시 sched_get_priority_min와
sched_get_priority_max에 의해 주어진 범위 안에 있어야 한다.

sched_setparam
와
sched_getparam
이 가능한 POSIX 시스템은 <unistd.h>안에
_POSIX_PRIORITY_SCHEDULING
를 규정한다.

 

반환값

성공 시, sched_setparam 와 sched_getparam 은 0을 반환한다.. 에러 시, -1이 반환되고, errno 는 적절히 설정된다.  

에러

ESRCH
ID가 pid인 프로세스를 찾을 수 없다.
EPERM
호출하는 프로세스가 권한을 가질 수 없다. sched_setparam 을 호출하는 프로세스는 pid 로 분류되는 프로세스의 euid나 uid와 같은 효과적인 uid가 필요하다 혹은 슈퍼유저 프로세스 여야만 한다..
EINVAL
매개 변수 p가 현제 스케줄링 정책에 맞지 않는다.
 

호환

POSIX.1b (formerly POSIX.4)  

관련 항목

sched_setscheduler(2), sched_getscheduler(2), sched_get_priority_max(2), sched_get_priority_min(2), nice(2), setpriority(2), getpriority(2),

sched_setscheduler(2) has a description of the Linux scheduling scheme.

Programming for the real world - POSIX.4 by Bill O. Gallmeister, O'Reilly & Associates, Inc., ISBN 1-56592-074-0
IEEE Std 1003.1b-1993 (POSIX.1b standard)
ISO/IEC 9945-1:1996  

역자

ASPLINUX<man@asp-linux.co.kr>, 2000년 7월 28일


 

Index

이름
사용법
반환값
에러
호환
관련 항목
역자

This document was created by man2html, using the manual pages.
Time: 08:06:59 GMT, March 25, 2004