aboutsummaryrefslogtreecommitdiff
path: root/documentation/manual-pages/ja/man2/getpriority.2
diff options
context:
space:
mode:
authorSergio Carlavilla Delgado <carlavilla@FreeBSD.org>2021-01-25 23:31:29 +0000
committerSergio Carlavilla Delgado <carlavilla@FreeBSD.org>2021-01-25 23:31:29 +0000
commit989d921f5d4ac8d8b7c831c13b8954ad1901be24 (patch)
treea5d768f9af4b55422fdf5b17064879ae1c7ce032 /documentation/manual-pages/ja/man2/getpriority.2
parent0cff342f42461c5081b98bce7581f43df319e4f4 (diff)
Diffstat (limited to 'documentation/manual-pages/ja/man2/getpriority.2')
-rw-r--r--documentation/manual-pages/ja/man2/getpriority.2142
1 files changed, 142 insertions, 0 deletions
diff --git a/documentation/manual-pages/ja/man2/getpriority.2 b/documentation/manual-pages/ja/man2/getpriority.2
new file mode 100644
index 0000000000..999b0af542
--- /dev/null
+++ b/documentation/manual-pages/ja/man2/getpriority.2
@@ -0,0 +1,142 @@
+.\" Copyright (c) 1980, 1991, 1993
+.\" The Regents of the University of California. All rights reserved.
+.\"
+.\" Redistribution and use in source and binary forms, with or without
+.\" modification, are permitted provided that the following conditions
+.\" are met:
+.\" 1. Redistributions of source code must retain the above copyright
+.\" notice, this list of conditions and the following disclaimer.
+.\" 2. Redistributions in binary form must reproduce the above copyright
+.\" notice, this list of conditions and the following disclaimer in the
+.\" documentation and/or other materials provided with the distribution.
+.\" 3. All advertising materials mentioning features or use of this software
+.\" must display the following acknowledgement:
+.\" This product includes software developed by the University of
+.\" California, Berkeley and its contributors.
+.\" 4. Neither the name of the University nor the names of its contributors
+.\" may be used to endorse or promote products derived from this software
+.\" without specific prior written permission.
+.\"
+.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+.\" SUCH DAMAGE.
+.\"
+.\" @(#)getpriority.2 8.1 (Berkeley) 6/4/93
+.\" %FreeBSD: src/lib/libc/sys/getpriority.2,v 1.12 2004/07/02 23:52:13 ru Exp %
+.\"
+.\" $FreeBSD$
+.Dd June 4, 1993
+.Dt GETPRIORITY 2
+.Os
+.Sh 名称
+.Nm getpriority ,
+.Nm setpriority
+.Nd プログラムスケジュール優先順位を取得 / 設定する
+.Sh ライブラリ
+.Lb libc
+.Sh 書式
+.In sys/time.h
+.In sys/resource.h
+.Ft int
+.Fn getpriority "int which" "int who"
+.Ft int
+.Fn setpriority "int which" "int who" "int prio"
+.Sh 解説
+.Fa which
+および
+.Fa who
+で指示されるプロセス、プロセスグループ、
+またはユーザのスケジュール優先順位は
+.Fn getpriority
+システムコールで取得され、
+.Fn setpriority
+システムコールで設定されます。
+.Fa which
+引数は、
+.Dv PRIO_PROCESS ,
+.Dv PRIO_PGRP
+または
+.Dv PRIO_USER
+のどれかであり、
+.Fa who
+は
+.Fa which
+に関連して解釈されます
+.Dv ( PRIO_PROCESS
+の場合はプロセス識別子、
+.Dv PRIO_PGRP
+の場合はプロセスグループ識別子、および
+.Dv PRIO_USER
+の場合はユーザ ID)。
+.Fa who
+の値が 0 であるのは、
+現在のプロセス、プロセスグループ、またはユーザを表します。
+.Fa prio
+引数は -20 から 20 の範囲の値です。
+デフォルトの優先順位は 0 です。
+優先順位が低いと、スケジュール調整にはより都合がよくなります。
+.Pp
+.Fn getpriority
+システムコールは、指定のプロセスのいずれかが享受する最高の優先順位を
+返してきます (最も小さい数値です)。
+.Fn setpriority
+システムコールは、指定されたすべてのプロセスの優先順位を指定の値に設定します。
+スーパユーザだけが優先順位を低くできます。
+.Sh 戻り値
+.Fn getpriority
+は処理を正しく完了しても値 -1 を返すことがあるので、
+呼び出しの前に外部変数
+.Va errno
+をクリアしてから、後にこれをチェックして -1 がエラーであるか、
+または正当な値であるか判定する必要があります。
+.Pp
+.Rv -std setpriority
+.Sh エラー
+.Fn getpriority
+と
+.Fn setpriority
+システムコールは次の場合に失敗します:
+.Bl -tag -width Er
+.It Bq Er ESRCH
+指定された
+.Fa which
+と
+.Fa who
+の値を使用しているプロセスが見つかりませんでした。
+.It Bq Er EINVAL
+.Fa which
+引数が
+.Dv PRIO_PROCESS ,
+.Dv PRIO_PGRP
+または
+.Dv PRIO_USER
+のどれでもありませんでした。
+.El
+.Pp
+.Bl -tag -width Er
+上記のエラーだけでなく、
+.Fn setpriority
+は次の場合に失敗します:
+.It Bq Er EPERM
+プロセスは検出されたものの、その実効 ID も実ユーザ ID の
+どちらも、呼び出し側の実効ユーザ ID に一致しませんでした。
+.It Bq Er EACCES
+スーパユーザでないものがプロセスの優先順位を下げようとしました。
+.El
+.Sh 関連項目
+.Xr nice 1 ,
+.Xr fork 2 ,
+.Xr renice 8
+.Sh 歴史
+.Fn getpriority
+システムコールは
+.Bx 4.2
+ではじめて登場しました。