OSDN Git Service

(split) LDP: Restore and add Copyrights for draft pages
[linuxjm/LDP_man-pages.git] / draft / man2 / nice.2
index 53eb86f..ca86228 100644 (file)
@@ -1,7 +1,6 @@
-.\" Hey Emacs! This file is -*- nroff -*- source.
-.\"
 .\" Copyright (c) 1992 Drew Eckhardt <drew@cs.colorado.edu>, March 28, 1992
 .\"
 .\" Copyright (c) 1992 Drew Eckhardt <drew@cs.colorado.edu>, March 28, 1992
 .\"
+.\" %%%LICENSE_START(VERBATIM)
 .\" Permission is granted to make and distribute verbatim copies of this
 .\" manual provided the copyright notice and this permission notice are
 .\" preserved on all copies.
 .\" Permission is granted to make and distribute verbatim copies of this
 .\" manual provided the copyright notice and this permission notice are
 .\" preserved on all copies.
@@ -21,6 +20,7 @@
 .\"
 .\" Formatted or processed versions of this manual, if unaccompanied by
 .\" the source, must acknowledge the copyright and authors of this work.
 .\"
 .\" Formatted or processed versions of this manual, if unaccompanied by
 .\" the source, must acknowledge the copyright and authors of this work.
+.\" %%%LICENSE_END
 .\"
 .\" Modified by Michael Haardt <michael@moria.de>
 .\" Modified 1993-07-24 by Rik Faith <faith@cs.unc.edu>
 .\"
 .\" Modified by Michael Haardt <michael@moria.de>
 .\" Modified 1993-07-24 by Rik Faith <faith@cs.unc.edu>
 .\" Modified 2001-06-04 by aeb
 .\" Modified 2004-05-27 by Michael Kerrisk <mtk.manpages@gmail.com>
 .\"
 .\" Modified 2001-06-04 by aeb
 .\" Modified 2004-05-27 by Michael Kerrisk <mtk.manpages@gmail.com>
 .\"
+.\"*******************************************************************
+.\"
+.\" This file was generated with po4a. Translate the source file.
+.\"
+.\"*******************************************************************
+.\"
 .\" Japanese Version Copyright (c) 1997 SUTO, Mitsuaki
 .\"         all rights reserved.
 .\" Translated 1997-06-26, SUTO, Mitsuaki <suto@av.crl.sony.co.jp>
 .\" Japanese Version Copyright (c) 1997 SUTO, Mitsuaki
 .\"         all rights reserved.
 .\" Translated 1997-06-26, SUTO, Mitsuaki <suto@av.crl.sony.co.jp>
 .\" Updated 2005-09-03, Akihiro MOTOKI <amotoki@dd.iij4u.or.jp>
 .\" Updated 2005-10-07, Akihiro MOTOKI
 .\"
 .\" Updated 2005-09-03, Akihiro MOTOKI <amotoki@dd.iij4u.or.jp>
 .\" Updated 2005-10-07, Akihiro MOTOKI
 .\"
-.TH NICE 2 2007-07-26 "Linux" "Linux Programmer's Manual"
-.SH Ì¾Á°
-nice \- ¥×¥í¥»¥¹¤ÎÍ¥ÀèÅÙ¤òÊѹ¹¤¹¤ë
-.SH ½ñ¼°
-.B #include <unistd.h>
+.TH NICE 2 2007\-07\-26 Linux "Linux Programmer's Manual"
+.SH 名前
+nice \- プロセスの優先度を変更する
+.SH 書式
+\fB#include <unistd.h>\fP
 .sp
 .sp
-.BI "int nice(int " inc );
+\fBint nice(int \fP\fIinc\fP\fB);\fP
 .sp
 .in -4n
 .sp
 .in -4n
-.\"O Feature Test Macro Requirements for glibc (see
-.\"O .BR feature_test_macros (7)):
-glibc ¸þ¤±¤Îµ¡Ç½¸¡ºº¥Þ¥¯¥í¤ÎÍ×·ï
-.RB ( feature_test_macros (7)
-»²¾È):
+glibc 向けの機能検査マクロの要件 (\fBfeature_test_macros\fP(7)  参照):
 .in
 .sp
 .in
 .sp
-.BR nice ():
-_BSD_SOURCE || _SVID_SOURCE || _XOPEN_SOURCE
-.\"O .SH DESCRIPTION
-.SH ÀâÌÀ
-.\"O .BR nice ()
-.\"O adds
-.\"O .I inc
-.\"O to the nice value for the calling process.
-.\"O (A higher nice value means a low priority.)
-.\"O Only the super\%user may specify a negative increment,
-.\"O or priority increase.
-.\"O The range for nice values is described in
-.\"O .BR getpriority (2).
-.BR nice ()
-¤Ï
-.I inc
-¤ÎÃͤò
-.B nice
-¤ò¸Æ¤ó¤À¥×¥í¥»¥¹¤Î nice Ãͤ˲䨤ë
-(nice Ãͤ¬Â礭¤¤¿ôÃͤۤÉÄ㤤ͥÀèÅÙ¤òɽ¤¹)¡£
-Éé¤Î¿ô¤ò»ØÄꤹ¤ë¡¢¤Ä¤Þ¤ê¡¢°ÊÁ°¤è¤ê¤âÍ¥ÀèÅÙ¤ò¾å¤²¤ë¤È¤¤¤¦»ØÄ꤬¤Ç¤­¤ë¤Î¤Ï
-¥¹¡¼¥Ñ¡¼¥æ¡¼¥¶¡¼¤À¤±¤Ç¤¢¤ë¡£
-nice ÃͤÎÈϰϤˤĤ¤¤Æ¤Ï
-.BR getpriority (2)
-¤ÇÀâÌÀ¤µ¤ì¤Æ¤¤¤ë¡£
-.\"O .SH "RETURN VALUE"
-.SH ÊÖ¤êÃÍ
-.\"O On success, the new nice value is returned (but see NOTES below).
-.\"O On error, \-1 is returned, and
-.\"O .I errno
-.\"O is set appropriately.
-À®¸ù¤·¤¿¾ì¹ç¡¢¿·¤·¤¤ nice Ãͤ¬ÊÖ¤ë (⤷¡¢²¼µ­¤Î¡ÖÃí°Õ¡×¤ò»²¾È)¡£
-¼ºÇÔ¤·¤¿¾ì¹ç \-1 ¤¬Ê֤ꡢ
-.I errno
-¤¬¥¨¥é¡¼¤ÎÆâÍƤ˽¾¤Ã¤ÆÀßÄꤵ¤ì¤ë¡£
-.\"O .SH ERRORS
-.SH ¥¨¥é¡¼
-.TP
-.B EPERM
-.\"O A non-super user attempts to do a priority increase
-.\"O by supplying a negative
-¥¹¡¼¥Ñ¡¼¥æ¡¼¥¶¡¼°Ê³°¤¬
-.I inc
-¤ËÉé¤Î¿ôÃͤò»ØÄꤷ¤ÆÍ¥ÀèÅÙ¤ò¾å¤²¤è¤¦¤È¤·¤¿¡£
-.\"O The calling process attempted to increase its priority by
-.\"O supplying a negative
-.\"O .I inc
-.\"O but has insufficient privileges.
-.\"O Under Linux the
-.\"O .B CAP_SYS_NICE
-.\"O capability is required.
-.\"O (But see the discussion of the
-.\"O .B RLIMIT_NICE
-.\"O resource limit in
-.\"O .BR setrlimit (2).)
-¸Æ¤Ó½Ð¤·¸µ¤Î¥×¥í¥»¥¹¤¬
-.I inc
-¤ËÉé¤Î¿ôÃͤò»ØÄꤷ¤ÆÍ¥ÀèÅÙ¤ò¾å¤²¤è¤¦¤È¤·¤¿¤¬¡¢
-½½Ê¬¤Ê¸¢¸Â¤ò»ý¤Ã¤Æ¤¤¤Ê¤«¤Ã¤¿¡£
-Linux ¤Ç¤Ï
-.B CAP_SYS_NICE
-¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£¤¬É¬ÍפǤ¢¤ë¡£
-.RB ( setrlimit (2)
-¤Î¥ê¥½¡¼¥¹¾å¸Â
-.B RLIMIT_NICE
-¤Ë´Ø¤¹¤ëµÄÏÀ¤â»²¾È¤Î¤³¤È)¡£
-.\"O .SH "CONFORMING TO"
-.SH ½àµò
-.\"O SVr4, 4.3BSD, POSIX.1-2001.
-.\"O However, the Linux and (g)libc
-.\"O (earlier than glibc 2.2.4) return value is nonstandard, see below.
-.\"O SVr4 documents an additional
-.\"O .B EINVAL
-.\"O error code.
-SVr4, 4.3BSD, POSIX.1-2001.
-¤·¤«¤·¡¢Linux ¤È (2.2.4¤è¤ê¸Å¤¤) (g)libc ¤Ç¤ÏÊÖ¤êÃͤÏɸ½à¤È°Û¤Ê¤ë¡£
-¾ÜºÙ¤Ï°Ê²¼¤ò»²¾È¤Î¤³¤È¡£
-SVr4 ¤Ë¤Ï¾¤Ë
-.B EINVAL
-¥¨¥é¡¼¥³¡¼¥É¤Ë¤Ä¤¤¤Æ¤Îµ­½Ò¤¬¤¢¤ë¡£
-.\"O .SH NOTES
-.SH Ãí°Õ
-.\"O SUSv2 and POSIX.1-2001 specify that
-.\"O .BR nice ()
-.\"O should return the new nice value.
-.\"O However, the Linux syscall and the
-.\"O .BR nice ()
-.\"O library function provided in older versions of (g)libc
-.\"O (earlier than glibc 2.2.4) return 0 on success.
-.\"O The new nice value can be found using
-.\"O .BR getpriority (2).
-SUSv2 ¤È POSIX 1003.1-2003 ¤Ç¤Ï¡¢
-.BR nice ()
-¤Ï¿·¤·¤¤ nice ÃͤòÊÖ¤¹¤Èµ¬Äꤵ¤ì¤Æ¤¤¤ë¡£
-°ìÊý¡¢Linux ¥·¥¹¥Æ¥à¥³¡¼¥ë¤È (2.2.4 ¤è¤ê¸Å¤¤) (g)libc ¥é¥¤¥Ö¥é¥ê´Ø¿ô¤Ï
-À®¸ù»þ¤Ë 0 ¤òÊÖ¤¹¡£¿·¤·¤¤ nice ÃͤÏ
-.BR getpriority (2)
-¤ò»È¤Ã¤Æ¼èÆÀ¤Ç¤­¤ë¡£
+\fBnice\fP(): _BSD_SOURCE || _SVID_SOURCE || _XOPEN_SOURCE
+.SH 説明
+\fBnice\fP()  は \fIinc\fP の値を \fBnice\fP を呼んだプロセスの nice 値に加える (nice
+値が大きい数値ほど低い優先度を表す)。 負の数を指定する、つまり、以前よりも優先度を上げるという指定ができるのは スーパーユーザーだけである。 nice
+値の範囲については \fBgetpriority\fP(2)  で説明されている。
+.SH 返り値
+成功した場合、新しい nice 値が返る (但し、下記の「注意」を参照)。 失敗した場合 \-1 が返り、 \fIerrno\fP
+がエラーの内容に従って設定される。
+.SH エラー
+.TP 
+\fBEPERM\fP
+スーパーユーザー以外が \fIinc\fP に負の数値を指定して優先度を上げようとした。 呼び出し元のプロセスが \fIinc\fP
+に負の数値を指定して優先度を上げようとしたが、 十分な権限を持っていなかった。 Linux では \fBCAP_SYS_NICE\fP
+ケーパビリティが必要である。 (\fBsetrlimit\fP(2)  のリソース上限 \fBRLIMIT_NICE\fP に関する議論も参照のこと)。
+.SH 準拠
+SVr4, 4.3BSD, POSIX.1\-2001.  しかし、Linux と (2.2.4より古い) (g)libc では返り値は標準と異なる。
+詳細は以下を参照のこと。 SVr4 には他に \fBEINVAL\fP エラーコードについての記述がある。
+.SH 注意
+SUSv2 と POSIX 1003.1\-2003 では、 \fBnice\fP()  は新しい nice 値を返すと規定されている。 一方、Linux
+システムコールと (2.2.4 より古い) (g)libc ライブラリ関数は 成功時に 0 を返す。新しい nice 値は
+\fBgetpriority\fP(2)  を使って取得できる。
 
 
-.\"O Since glibc 2.2.4,
-.\"O .BR nice ()
-.\"O is implemented as a library function that calls
-.\"O .BR getpriority (2)
-.\"O to obtain the new nice value to be returned to the caller.
-.\"O With this implementation,
-.\"O a successful call can legitimately return \-1.
-glibc 2.2.4 °Ê¹ß¤Ç¤Ï¡¢
-.BR nice ()
-¤Ï
-.BR getpriority (2)
-¤ò¸Æ¤Ó½Ð¤¹¥é¥¤¥Ö¥é¥ê´Ø¿ô¤È¤·¤Æ¼ÂÁõ¤µ¤ì¤Æ¤ª¤ê¡¢
-¸Æ¤Ó½Ð¤·¸µ¤ËÊÖ¤¹¿·¤·¤¤ nice Ãͤò
-.BR getpriority (2)
-¤ò¸Æ¤Ó½Ð¤·¤Æ¼èÆÀ¤¹¤ë¤è¤¦¤Ë¤Ê¤Ã¤Æ¤¤¤ë¡£
-¤³¤Î¼ÂÁõ¤Ç¤Ï¡¢Àµ¾ï¤ÊÆ°ºî¤Ç¤â \-1 ¤¬ÊÖ¤µ¤ì¤ë²ÄǽÀ­¤¬¤¢¤ë¡£
-.\"O To reliably detect an error, set
-.\"O .I errno
-.\"O to 0 before the call, and check its value when
-.\"O .BR nice ()
-.\"O returns \-1.
-³Î¼Â¤Ë¥¨¥é¡¼¤ò¸¡½Ð¤¹¤ë¤¿¤á¤Ë¤Ï¡¢
-¸Æ¤Ó½Ð¤·¤ÎÁ°¤Ë
-.I errno
-¤Ë 0 ¤òÀßÄꤷ¡¢
-.BR nice ()
-¤¬ \-1 ¤òÊÖ¤·¤¿¤È¤­¤Ë errno ¤ò¥Á¥§¥Ã¥¯¤¹¤ë¤ÈÎɤ¤¡£
-.\"O .SH "SEE ALSO"
-.SH ´ØÏ¢¹àÌÜ
-.BR nice (1),
-.BR fork (2),
-.BR getpriority (2),
-.BR setpriority (2),
-.BR capabilities (7),
-.BR renice (1)
+glibc 2.2.4 以降では、 \fBnice\fP()  は \fBgetpriority\fP(2)  を呼び出すライブラリ関数として実装されており、
+呼び出し元に返す新しい nice 値を \fBgetpriority\fP(2)  を呼び出して取得するようになっている。 この実装では、正常な動作でも \-1
+が返される可能性がある。 確実にエラーを検出するためには、 呼び出しの前に \fIerrno\fP に 0 を設定し、 \fBnice\fP()  が \-1
+を返したときに errno をチェックすると良い。
+.SH 関連項目
+\fBnice\fP(1), \fBrenice\fP(1), \fBfork\fP(2), \fBgetpriority\fP(2), \fBsetpriority\fP(2),
+\fBcapabilities\fP(7)
+.SH この文書について
+この man ページは Linux \fIman\-pages\fP プロジェクトのリリース 3.53 の一部
+である。プロジェクトの説明とバグ報告に関する情報は
+http://www.kernel.org/doc/man\-pages/ に書かれている。