OSDN Git Service

(split) Convert release and draft pages to UTF-8.
[linuxjm/LDP_man-pages.git] / release / man2 / sched_get_priority_max.2
1 .\" Hey Emacs! This file is -*- nroff -*- source.
2 .\"
3 .\" Copyright (C) Tom Bjorkholm & Markus Kuhn, 1996
4 .\"
5 .\" This is free documentation; you can redistribute it and/or
6 .\" modify it under the terms of the GNU General Public License as
7 .\" published by the Free Software Foundation; either version 2 of
8 .\" the License, or (at your option) any later version.
9 .\"
10 .\" The GNU General Public License's references to "object code"
11 .\" and "executables" are to be interpreted as the output of any
12 .\" document formatting or typesetting system, including
13 .\" intermediate and printed output.
14 .\"
15 .\" This manual is distributed in the hope that it will be useful,
16 .\" but WITHOUT ANY WARRANTY; without even the implied warranty of
17 .\" MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18 .\" GNU General Public License for more details.
19 .\"
20 .\" You should have received a copy of the GNU General Public
21 .\" License along with this manual; if not, write to the Free
22 .\" Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111,
23 .\" USA.
24 .\"
25 .\" 1996-04-01 Tom Bjorkholm <tomb@mydata.se>
26 .\"            First version written
27 .\" 1996-04-10 Markus Kuhn <mskuhn@cip.informatik.uni-erlangen.de>
28 .\"            revision
29 .\"
30 .\" Japanese Version Copyright (c) 1997 HANATAKA Shinya
31 .\"         all rights reserved.
32 .\" Translated 1997-02-23, HANATAKA Shinya <hanataka@abyss.rim.or.jp>
33 .\" Updated 2006-04-14, Akihiro MOTOKI <amotoki@dd.iij4u.or.jp>, LDP v2.29
34 .\"
35 .\"WORD:        static                  静的
36 .\"WORD:        priority                プライオリティ
37 .\"WORD:        scheduling              スケジューリング
38 .\"WORD:        algorithm               アルゴリズム
39 .\"WORD:        process                 プロセス
40 .\"WORD:        portable                移植性のある
41 .\"WORD:        policy                  方針
42 .\"
43 .TH SCHED_GET_PRIORITY_MAX 2 2006-03-23 "Linux" "Linux Programmer's Manual"
44 .SH 名前
45 sched_get_priority_max, sched_get_priority_min  \- 静的プライオリティの範囲を取得する
46 .SH 書式
47 .B #include <sched.h>
48 .sp
49 .BI "int sched_get_priority_max(int " policy );
50 .sp
51 .BI "int sched_get_priority_min(int " policy );
52 .SH 説明
53 .BR sched_get_priority_max ()
54 は\fIpolicy\fP によって指定されたスケジューリングのアルゴリズムで
55 使用されるプライオリティの最大値を返す。
56 .BR sched_get_priority_min ()
57 は\fIpolicy\fP によって指定されたスケジューリングのアルゴリズムで
58 使用されるプライオリティの最小値を返す。
59 サポートされる \fIpolicy\fP の値は
60 .BR SCHED_FIFO 、
61 .BR SCHED_RR 、
62 .BR SCHED_OTHER 、
63 .B SCHED_BATCH
64 である。これらのスケジューリング方針に関する詳細は
65 .BR sched_setscheduler (2)
66 に書かれている。
67
68 数値的に大きなプライオリティ値を持つプロセスは小さな
69 プライオリティ値を持つプロセスより前にスケジュールされる。
70 このため
71 .BR sched_get_priority_max ()
72 が返す値は
73 .BR sched_get_priority_min ()
74 が返す値よりも大きい。
75
76 Linux では \fBSCHED_FIFO\fP と \fBSCHED_RR\fP では 1 から 99 の範囲の
77 静的プライオリティーを持ち、\fBSCHED_OTHER\fP と \fBSCHED_BATCH\fP では
78 プライオリティとして 0 を持つ。
79 それぞれの方針のスケジューリング・プライオリティの範囲は
80 変更することができない。
81
82 スケジューリング・プライオリティの範囲は他の POSIX システムと
83 異なっているかもしれない。それで、移植性(portable)のある
84 アプリケーションでは仮想的な範囲を用い
85 .BR sched_get_priority_max ()
86
87 .BR sched_get_priority_min ()
88 で与えられた間隔にマップして使用することはいい考えである。
89 POSIX.1-2001 では \fBSCHED_FIFO\fP と \fBSCHED_RR\fP における
90 最大値と最小値の間隔を少なくとも 32 にすることを要求している。
91
92 POSIX システムでは
93 .BR sched_get_priority_max ()
94
95 .BR sched_get_priority_min ()
96 は \fI<unistd.h>\fP に
97 .B _POSIX_PRIORITY_SCHEDULING
98 が定義されている場合にのみ使用可能である。
99 .SH 返り値
100 成功した場合は
101 .BR sched_get_priority_max ()
102
103 .BR sched_get_priority_min ()
104 は指定されたスケジューリング方針のプライオリティの最大値/最小値を返す。
105 エラーの場合は \-1 が返され、
106 .I errno
107 が適切に設定される。
108 .SH エラー
109 .TP
110 .B EINVAL
111 引き数 \fIpolicy\fP が定義されているスケジューリング方針と一致しない。
112 .SH 準拠
113 POSIX.1-2001.
114 .SH 関連項目
115 .BR sched_getaffinity (2),
116 .BR sched_getparam (2)
117 .BR sched_getscheduler (2),
118 .BR sched_setaffinity (2),
119 .BR sched_setparam (2),
120 .BR sched_setscheduler (2),
121 .PP
122 .I Programming for the real world \- POSIX.4
123 by Bill O. Gallmeister, O'Reilly & Associates, Inc., ISBN 1-56592-074-0