OSDN Git Service

(split) LDP: Update the version to 3.53 in PO files
[linuxjm/LDP_man-pages.git] / draft / man2 / syslog.2
index cb2f06a..c9d7f19 100644 (file)
@@ -1,5 +1,6 @@
 .\" Copyright (C) 1995 Andries Brouwer (aeb@cwi.nl)
 .\"
+.\" %%%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.
@@ -19,6 +20,7 @@
 .\"
 .\" Formatted or processed versions of this manual, if unaccompanied by
 .\" the source, must acknowledge the copyright and authors of this work.
+.\" %%%LICENSE_END
 .\"
 .\" Written 11 June 1995 by Andries Brouwer <aeb@cwi.nl>
 .\" 2008-02-15, Jeremy Kerr <jk@ozlabs.org>
 .\" 2008-02-15, Michael Kerrisk <mtk.manpages@gmail.com>
 .\"     Update LOG_BUF_LEN details; update RETURN VALUE section.
 .\"
-.\" Japanese Version Copyright (c) 1997 HANATAKA Shinya
-.\"         all rights reserved.
-.\" Translated Mon Dec 16 11:16:34 JST 2001
-.\"         by HANATAKA Shinya <hanataka@abyss.rim.or.jp>
-.\" Updated Thu Mar 6 2003 by Akihiro MOTOKI <amotoki@dd.iij4u.or.jp>
-.\" Updated 2005-09-06, Akihiro MOTOKI <amotoki@dd.iij4u.or.jp>
-.\" Updated 2008-04-04, Akihiro MOTOKI, LDP v2.79
-.\" Updated 2008-07-31, Akihiro MOTOKI, LDP v3.05
+.\"*******************************************************************
 .\"
-.\"WORD:       kernel                  ¥«¡¼¥Í¥ë
-.\"WORD:       message ring buffer     ¥á¥Ã¥»¡¼¥¸¡¦¥ê¥ó¥°¡¦¥Ð¥Ã¥Õ¥¡
-.\"WORD:       library                 ¥é¥¤¥Ö¥é¥ê
-.\"WORD:       kernel log buffer       ¥«¡¼¥Í¥ë¡¦¥í¥°¡¦¥Ð¥Ã¥Õ¥¡
-.\"WORD:       console                 ¥³¥ó¥½¡¼¥ë
-.\"WORD:       kernel panic            ¥«¡¼¥Í¥ë¡¦¥Ñ¥Ë¥Ã¥¯
-.\"WORD:       loglevel                ¥í¥°¥ì¥Ù¥ë
-.\"WORD:       debug message           ¥Ç¥Ð¥Ã¥°¡¦¥á¥Ã¥»¡¼¥¸
+.\" This file was generated with po4a. Translate the source file.
 .\"
-.TH SYSLOG 2  2008-06-20 "Linux" "Linux Programmer's Manual"
-.\"O .SH NAME
-.SH Ì¾Á°
-.\"O syslog, klogctl \- read and/or clear kernel message ring buffer;
-.\"O set console_loglevel
-syslog, klogctl \- ¥«¡¼¥Í¥ë¤Î¥á¥Ã¥»¡¼¥¸¡¦¥ê¥ó¥°¡¦¥Ð¥Ã¥Õ¥¡¤òÆɤó¤À¤ê¾Ãµî¤·¤¿¤ê¤¹¤ë;
-console_loglevel ¤ÎÀßÄê¤ò¹Ô¤¦
-.\"O .SH SYNOPSIS
-.SH ½ñ¼°
+.\"*******************************************************************
+.TH SYSLOG 2 2012\-11\-29 Linux "Linux Programmer's Manual"
+.SH 名前
+syslog, klogctl \- カーネルのメッセージ・リング・バッファを読んだり消去したりする; console_loglevel の設定を行う
+.SH 書式
 .nf
-.BI "int syslog(int " type ", char *" bufp ", int " len );
-.\"O .B  "                /* No wrapper provided in glibc */"
-.B  "                /* glibc ¤Ç¤Ï¥é¥Ã¥Ñ¡¼´Ø¿ô¤ÏÄ󶡤µ¤ì¤Æ¤¤¤Ê¤¤ */"
+\fBint syslog(int \fP\fItype\fP\fB, char *\fP\fIbufp\fP\fB, int \fP\fIlen\fP\fB);\fP
+\fB/* glibc ではラッパー関数は提供されていない */\fP
 .sp
-.\"O /* The glibc interface */
-/* glibc ¤Î¥¤¥ó¥¿¥Õ¥§¡¼¥¹ */
+/* glibc のインタフェース */
 .br
-.B "#include <sys/klog.h>"
+\fB#include <sys/klog.h>\fP
 .sp
-.BI "int klogctl(int " type ", char *" bufp ", int " len );
+\fBint klogctl(int \fP\fItype\fP\fB, char *\fP\fIbufp\fP\fB, int \fP\fIlen\fP\fB);\fP
 .fi
-.\"O .SH DESCRIPTION
-.SH ÀâÌÀ
-.\"O If you need the C library function
-.\"O .BR syslog ()
-.\"O (which talks to
-.\"O .BR syslogd (8)),
-.\"O then look at
-.\"O .BR syslog (3).
-.\"O The system call of this name is about controlling the kernel
-.\"O .IR printk ()
-.\"O buffer, and the glibc version is called
-.\"O .BR klogctl ().
-.RB ( syslogd (8)
-¤ÈÏä¹) C ¥é¥¤¥Ö¥é¥ê´Ø¿ô¤Î
-.BR syslog ()
-¤¬É¬Íפʾì¹ç¤Ï¡¢
-.BR syslog (3)
-¤ò¸«¤ë¤³¤È¡£
-¤³¤Î̾Á°¤Î¥·¥¹¥Æ¥à¡¦¥³¡¼¥ë¤Ï¥«¡¼¥Í¥ë¤Î
-.IR printk ()
-¥Ð¥Ã¥Õ¥¡¤òÀ©¸æ¤¹¤ë¤â¤Î¤Ç¤¢¤ê¡¢glibc ¤Ç¤Ï
-.BR klogctl ()
-¤È¸Æ¤Ð¤ì¤Æ¤¤¤ë¡£
-
-.\"O .The \fItype\fP argument determines the action taken by this function.
-\fItype\fP °ú¤­¿ô¤Ï¤³¤Î´Ø¿ô¤ÎÆ°ºî¤ò·èÄꤹ¤ë¡£
-
-.\"O Quoting from
-.\"O .IR kernel/printk.c :
-.I kernel/printk.c
-¤«¤é¤Î°úÍÑ :
-.nf
-.\"O /*
-.\"O  * Commands to sys_syslog:
-.\"O  *
-.\"O  *      0 \-\- Close the log.  Currently a NOP.
-.\"O  *      1 \-\- Open the log. Currently a NOP.
-.\"O  *      2 \-\- Read from the log.
-.\"O  *      3 \-\- Read all messages remaining in the ring buffer.
-.\"O  *      4 \-\- Read and clear all messages remaining in the ring buffer
-.\"O  *      5 \-\- Clear ring buffer.
-.\"O  *      6 \-\- Disable printk to console
-.\"O  *      7 \-\- Enable printk to console
-.\"O  *      8 \-\- Set level of messages printed to console
-.\"O  *      9 \-\- Return number of unread characters in the log buffer
-.\"O  *     10 \-\- Return size of the log buffer
-.\"O  */
-/*
- * Commands to sys_syslog:
- *
- *      0 \-\- ¥í¥°¤òÊĤ¸¤ë¡£¸½ºß¤Î¼ÂÁõ¤Ç¤Ï²¿¤â¤·¤Ê¤¤ (NOP) ¡£
- *      1 \-\- ¥í¥°¤ò³«¤¯¡£¸½ºß¤Î¼ÂÁõ¤Ç¤Ï²¿¤â¤·¤Ê¤¤ (NOP) ¡£
- *      2 \-\- ¥í¥°¤«¤éÆɤ߽Ф¹¡£
- *      3 \-\- ¥ê¥ó¥°¡¦¥Ð¥Ã¥Õ¥¡¤Ë»Ä¤Ã¤Æ¤¤¤ë¥á¥Ã¥»¡¼¥¸¤ò¤¹¤Ù¤ÆÆɤ߽Ф¹¡£
- *      4 \-\- ¥ê¥ó¥°¡¦¥Ð¥Ã¥Õ¥¡¤Ë»Ä¤Ã¤Æ¤¤¤ë¥á¥Ã¥»¡¼¥¸¤ò¤¹¤Ù¤ÆÆɤ߽Ф·¡¢¾Ãµî¤¹¤ë¡£
- *      5 \-\- ¥ê¥ó¥°¥Ð¥Ã¥Õ¥¡¤ò¾Ãµî¤¹¤ë¡£
- *      6 \-\- ¥³¥ó¥½¡¼¥ë¤Ø¤Î printk ¤ò̵¸ú¤Ë¤¹¤ë¡£
- *      7 \-\- ¥³¥ó¥½¡¼¥ë¤Ø¤Î printk ¤òÍ­¸ú¤Ë¤¹¤ë¡£
- *      8 \-\- ¥³¥ó¥½¡¼¥ë¤Ëɽ¼¨¤µ¤ì¤ë¥á¥Ã¥»¡¼¥¸¤Î¥ì¥Ù¥ë¤òÀßÄꤹ¤ë¡£
- *      9 \-\- ¥í¥°¥Ð¥Ã¥Õ¥¡¤Î̤ÆɤÎʸ»ú¿ô¤òÊÖ¤¹¡£
- *      10 \-\- ¥í¥°¥Ð¥Ã¥Õ¥¡¤Î¥µ¥¤¥º¤òÊÖ¤¹¡£
- */
-.fi
-
-.\"O Only command types 3 and 10 are allowed to unprivileged processes.
-.\"O Type 9 was added in 2.4.10; type 10 in 2.6.6.
-ÈóÆø¢¥×¥í¥»¥¹¤Ë¤Ï¥³¥Þ¥ó¥É 3 ¤È 10 ¤Î¤ß¤¬µö²Ä¤µ¤ì¤Æ¤¤¤ë
-(¥³¥Þ¥ó¥É 9 ¤Ï Linux 2.4.10 ¤Ç¡¢¥³¥Þ¥ó¥É 10 ¤Ï Linux 2.6.6 ¤ÇÄɲ䵤줿)¡£
-.\"O .SS The kernel log buffer
-.SS ¥«¡¼¥Í¥ë¡¦¥í¥°¡¦¥Ð¥Ã¥Õ¥¡ (kernel log buffer)
-.\"O The kernel has a cyclic buffer of length
-.\"O .B LOG_BUF_LEN
-.\"O in which messages given as arguments to the kernel function
-.\"O .BR printk ()
-.\"O are stored (regardless of their loglevel).
-.\"O In early kernels,
-.\"O .B LOG_BUF_LEN
-.\"O had the value 4096;
-.\"O from kernel 1.3.54, it was 8192;
-.\"O from kernel 2.1.113 it was 16384;
-.\"O since 2.4.23/2.6 the value is a kernel configuration option.
-.\"O .\" Under "General setup" ==> "Kernel log buffer size"
-.\"O .\" For 2.6, precisely the option seems to have appeared in 2.5.55.
-.\"O In recent kernels the size can be queried with command type 10.
-¥«¡¼¥Í¥ë¤ÏŤµ
-.B LOG_BUF_LEN
-¤Î½ä²ó¼°¤Î¥Ð¥Ã¥Õ¥¡¤ò»ý¤Ã¤Æ¤ª¤ê¡¢
-¤½¤ì¤Ë¤Ï¥«¡¼¥Í¥ë´Ø¿ô¤Î
-.BR printk ()
-¤Î°ú¤­¿ô¤È¤·¤ÆÍ¿¤¨¤é¤ì¤¿
-¥á¥Ã¥»¡¼¥¸¤¬ (¤½¤Î¥í¥°¥ì¥Ù¥ë¤Ë¤«¤«¤ï¤é¤º) ³ÊǼ¤µ¤ì¤ë¡£
-½é´ü¤Î¥«¡¼¥Í¥ë¤Ç¤Ï
-.B LOG_BUF_LEN
-¤ÎÃͤϠ4096 ¤Ç¤¢¤Ã¤¿¡£
-¥«¡¼¥Í¥ë 1.3.54 ¤«¤é¤Ï 8192¡¢
-¥«¡¼¥Í¥ë 2.1.113 ¤«¤é¤Ï 16384 ¤Ë¤Ê¤ê¡¢
-¥«¡¼¥Í¥ë 2.4.23 °Ê¹ß¤ª¤è¤Ó 2.6 °Ê¹ß¤Ç¤Ï¥«¡¼¥Í¥ë¤Î¥³¥ó¥Ñ¥¤¥ë»þ¤Ë
-ÃͤòÀßÄê¤Ç¤­¤ë¤è¤¦¤Ë¤Ê¤Ã¤Æ¤¤¤ë¡£
+.SH 説明
+(\fBsyslogd\fP(8) と話す) C ライブラリ関数の \fBsyslog\fP() が必要な場合は、
+\fBsyslog\fP(3) を見ること。この名前のシステム・コールはカーネルの
+\fIprintk\fP() バッファを制御するものであり、glibc ラッパー関数は
+\fBklogctl\fP() と呼ばれている。
+.SS "カーネル・ログ・バッファ (kernel log buffer)"
 .\" Under "General setup" ==> "Kernel log buffer size"
 .\" For 2.6, precisely the option seems to have appeared in 2.5.55.
-ºÇ¶á¤Î¥«¡¼¥Í¥ë¤Ç¤Ï¡¢¥³¥Þ¥ó¥É 10 ¤Ç¥Ð¥Ã¥Õ¥¡¤Î¥µ¥¤¥º¤òÌ䤤¹ç¤ï¤»¤Ç¤­¤ë¡£
-
-.\"O The call
-.\"O .I "syslog(2,buf,len)"
-.\"O waits until this kernel log buffer is nonempty, and then reads
-.\"O at most \fIlen\fP bytes into the buffer \fIbuf\fP.
-.\"O It returns
-.\"O the number of bytes read.
-.\"O Bytes read from the log disappear from
-.\"O the log buffer: the information can only be read once.
-.\"O This is the function executed by the kernel when a user program
-.\"O reads
-.\"O .IR /proc/kmsg .
-.I "syslog(2,buf,len)"
-¤Î¸Æ¤Ó½Ð¤·¤Ï¥«¡¼¥Í¥ë¡¦¥í¥°¡¦¥Ð¥Ã¥Õ¥¡¤¬¶õ¤Ç¤Ê¤¯¤Ê¤ë¤Þ¤ÇÂԤäơ¢
-ºÇÂç \fIlen\fP ¥Ð¥¤¥È¤Þ¤Ç \fIbuf\fP ¤Ø¤ÈÆɤ߽Ф·¡¢Æɤ߹þ¤ó¤À
-¥Ð¥¤¥È¿ô¤òÊÖ¤¹¡£¥í¥°¤«¤éÆɤޤ줿¥Ð¥¤¥È¤Ï¥í¥°¡¦¥Ð¥Ã¥Õ¥¡¤«¤é¾Ã¤¨¤ë:
-¾ðÊó¤Ï°ìÅÙ¤·¤«Æɤळ¤È¤¬¤Ç¤­¤Ê¤¤¡£
-¤³¤ì¤Ï¥æ¡¼¥¶¡¼¤Î¥×¥í¥°¥é¥à¤¬
-.I /proc/kmsg
-¤òÆɤó¤À»þ¤Ë¥«¡¼¥Í¥ë¤Ë¤è¤Ã¤Æ¼Â¹Ô¤µ¤ì¤ë´Ø¿ô¤Ç¤â¤¢¤ë¡£
-
-.\"O The call
-.\"O .I syslog(3,buf,len)
-.\"O will read the last \fIlen\fP bytes from the log buffer (nondestructively),
-.\"O but will not read more than was written into the buffer since the
-.\"O last "clear ring buffer" command (which does not clear the buffer at all).
-.\"O It returns the number of bytes read.
-.I syslog(3,buf,len)
-¤Î¸Æ¤Ó½Ð¤·¤Ï¥í¥°¡¦¥Ð¥Ã¥Õ¥¡¤ÎºÇ¸å¤Î \fIlen\fP ¥Ð¥¤¥È¤ò
-(ÈóÇ˲õŪ¤Ë)Æɤ߽Ф¹¡¢¤·¤«¤·¡¢Ä¾¶á¤Î¡Ö¥ê¥ó¥°¡¦¥Ð¥Ã¥Õ¥¡¾Ãµî¡×Ì¿Îá
-(¤³¤ÎÌ¿Îá¤Ï¥Ð¥Ã¥Õ¥¡¤ò¾Ãµî¤¹¤ë¤ï¤±¤Ç¤Ï¤Ê¤¤)
-°Ê¹ß¤Ë¥Ð¥Ã¥Õ¥¡¤Ë½ñ¤­¹þ¤Þ¤ì¤¿¾ðÊó¤·¤«Æɤ߽Ф»¤Ê¤¤¡£
-ÊÖ¤êÃͤÏÆɤ߹þ¤ó¤À¥Ð¥¤¥È¿ô¤Ç¤¢¤ë¡£
-
-.\"O The call
-.\"O .I syslog(4,buf,len)
-.\"O does precisely the same, but also executes the "clear ring buffer" command.
-.I syslog(4,buf,len)
-¸Æ¤Ó½Ð¤·¤Ï¡Ö¥ê¥ó¥°¡¦¥Ð¥Ã¥Õ¥¡¾Ãµî¡×Ì¿Îá¤â¼Â¹Ô¤¹¤ë°Ê³°¤Ï
-µ¡Ç½ 3 ¤È´°Á´¤ËƱ¤¸¤Ç¤¢¤ë¡£
-
-.\"O The call
-.\"O .I syslog(5,dummy,dummy)
-.\"O executes just the "clear ring buffer" command.
-.\"O (In each call where
-.\"O .I buf
-.\"O or
-.\"O .I len
-.\"O is shown as "dummy", the value of the argument is ignored by the call.)
-.I syslog(5,dummy,dummy)
-¸Æ¤Ó½Ð¤·¤Ï¡Ö¥ê¥ó¥°¡¦¥Ð¥Ã¥Õ¥¡¾Ãµî¡×Ì¿Îá¤Î¤ß¤ò¼Â¹Ô¤¹¤ë
-(¸Æ¤Ó½Ð¤·¤Î½ñ¼°¤Ç¡¢
-.I buf
-¤ä
-.I len
-¤¬ "dummy" ¤Èµ­ºÜ¤µ¤ì¤Æ¤¤¤ë¾ì¹ç¡¢¤½¤Î°ú¤­¿ô¤ÎÃͤ¬Ìµ»ë¤µ¤ì¤ë¤³¤È¤òɽ¤¹)¡£
-
-.\"O The call
-.\"O .I syslog(6,dummy,dummy)
-.\"O sets the console log level to minimum, so that no messages are printed
-.\"O to the console.
-.I syslog(6,dummy,dummy)
-¸Æ¤Ó½Ð¤·¤Ï¥³¥ó¥½¡¼¥ë¤Î¥í¥°¥ì¥Ù¥ë¤òºÇ¾®¤ËÀßÄꤷ¡¢
-¥³¥ó¥½¡¼¥ë¤Ë¥á¥Ã¥»¡¼¥¸¤¬É½¼¨¤µ¤ì¤Ê¤¤¤è¤¦¤Ë¤¹¤ë¡£
-
-.\"O The call
-.\"O .I syslog(7,dummy,dummy)
-.\"O sets the console log level to default, so that messages are printed
-.\"O to the console.
-.I syslog(7,dummy,dummy)
-¸Æ¤Ó½Ð¤·¤Ï¥³¥ó¥½¡¼¥ë¤Î¥í¥°¥ì¥Ù¥ë¤ò¥Ç¥Õ¥©¥ë¥È¤ËÀßÄꤷ¡¢
-¥³¥ó¥½¡¼¥ë¤Ë¥á¥Ã¥»¡¼¥¸¤¬É½¼¨¤µ¤ì¤ë¤è¤¦¤Ë¤¹¤ë¡£
-
-.\"O The call
-.\"O .I syslog(8,dummy,level)
-.\"O sets the console log level to
-.\"O .IR level ,
-.\"O which must be an integer between 1 and 8 (inclusive).
-.\"O See the
-.\"O .B loglevel
-.\"O section for details.
-.I syslog(8,dummy,level)
-¸Æ¤Ó½Ð¤·¤Ï¥³¥ó¥½¡¼¥ë¤Î¥í¥°¥ì¥Ù¥ë¤ò
-.I level
-¤ËÀßÄꤹ¤ë¡£
-.I level
-¤Ï 1 °Ê¾å 8 °Ê²¼¤ÎÀ°¿ô¤Ç¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£
-¾ÜºÙ¤Ï
-.B ¥í¥°¥ì¥Ù¥ë (loglevel)
-¤ÎÀá¤ò»²¾È¤Î¤³¤È¡£
-
-.\"O The call
-.\"O .I syslog(9,dummy,dummy)
-.\"O returns the number of bytes currently available to be read
-.\"O on the kernel log buffer.
-.I syslog(9,dummy,dummy)
-¸Æ¤Ó½Ð¤·¤Ï¥«¡¼¥Í¥ë¡¦¥í¥°¥Ð¥Ã¥Õ¥¡¤Ë¤¢¤ë¸½ºßÆɤ߽Ф·²Äǽ¤Ê¥Ð¥¤¥È¿ô¤òÊÖ¤¹¡£
-
-.\"O The call
-.\"O .I syslog(10,dummy,dummy)
-.\"O returns the total size of the kernel log buffer.
-.I syslog(10,dummy,dummy)
-¸Æ¤Ó½Ð¤·¤Ï¥«¡¼¥Í¥ë¡¦¥í¥°¥Ð¥Ã¥Õ¥¡¤ÎÁíÎ̤òÊÖ¤¹¡£
-.\"O .SS The loglevel
-.SS ¥í¥°¥ì¥Ù¥ë (loglevel)
-.\"O The kernel routine
-.\"O .BR printk ()
-.\"O will only print a message on the
-.\"O console, if it has a loglevel less than the value of the variable
-.\"O .IR console_loglevel .
-.\"O This variable initially has the value
-.\"O .B DEFAULT_CONSOLE_LOGLEVEL
-.\"O (7), but is set to 10 if the
-.\"O kernel command line contains the word "debug", and to 15 in case
-.\"O  of a kernel fault (the 10 and 15 are just silly, and equivalent to 8).
-¥«¡¼¥Í¥ë¡¦¥ë¡¼¥Á¥ó¤Î
-.BR printk ()
-¤Ï¡¢¥í¥°¥ì¥Ù¥ë¤¬
-.I console_loglevel
-ÊÑ¿ô¤è¤ê¾®¤µ¤¤¤È¤­¤Ë¤Î¤ß¡¢¥³¥ó¥½¡¼¥ë¤Ë¥á¥Ã¥»¡¼¥¸¤òɽ¼¨¤¹¤ë¡£
-.I console_loglevel
-¤ÏºÇ½é
-.B DEFAULT_CONSOLE_LOGLEVEL
-(7) ¤ËÀßÄꤵ¤ì¤ë¤¬¡¢µ¯Æ°»þ¤Ë¥«¡¼¥Í¥ë¤Î
-¥³¥Þ¥ó¥É¡¦¥é¥¤¥ó¡¦¥ª¥×¥·¥ç¥ó¤Ë "debug" ¤È¤¤¤¦Ã±¸ì¤¬´Þ¤Þ¤ì¤Æ¤¤¤ë¾ì¹ç¤Ï
-10 ¤ËÀßÄꤵ¤ì¡¢¥«¡¼¥Í¥ë¡¦¥Õ¥©¡¼¥ë¥È¤¬È¯À¸¤·¤¿¾ì¹ç¤Ë¤Ï 15 ¤ËÀßÄꤵ¤ì¤ë
-(⤷¡¢10 ¤ä 15 ¤È¤¤¤¦¿ô»ú¤Ë°ÕÌ£¤Ï¤Ê¤¯¡¢8 ¤ÈƱÅù¤Ç¤¢¤ë)¡£
-.\"O This variable is set (to a value in the range 1-8) by the call
-.\"O .IR syslog(8,dummy,value) .
-.\"O The calls
-.\"O .I syslog(type,dummy,dummy)
-.\"O with \fItype\fP equal to 6 or 7, set it to 1 (kernel panics only)
-.\"O or 7 (all except debugging messages), respectively.
-¤³¤ÎÊÑ¿ô¤Ï
-.IR syslog(8,dummy,value) .
-¸Æ¤Ó½Ð¤·¤Ë¤è¤Ã¤ÆÀßÄꤵ¤ì¡¢ÃͤÎÈϰϤϠ1-8 ¤Ç¤¢¤ë¡£
-.I syslog(type,dummy,dummy)
-¸Æ¤Ó½Ð¤·¤Ç \fItype\fP ¤¬ 6 ¤â¤·¤¯¤Ï 7 ¤Î¾ì¹ç¡¢
-console_loglevel ¤Ï 1 (¥«¡¼¥Í¥ë¡¦¥Ñ¥Ë¥Ã¥¯¤Î¤ß)¡¢
-7 (¥Ç¥Ð¥Ã¥°¡¦¥á¥Ã¥»¡¼¥¸°Ê³°¤ÎÁ´¤Æ) ¤Ë¤½¤ì¤¾¤ìÀßÄꤵ¤ì¤ë¡£
+カーネルは長さ \fBLOG_BUF_LEN\fP の巡回式のバッファを持っており、 それにはカーネル関数の \fBprintk\fP()
+の引き数として与えられた メッセージが (そのログレベルにかかわらず) 格納される。 初期のカーネルでは \fBLOG_BUF_LEN\fP の値は 4096
+であった。 カーネル 1.3.54 からは 8192、 カーネル 2.1.113 からは 16384 になり、 カーネル 2.4.23 以降および
+2.6 以降ではカーネル設定オプション (\fBCONFIG_LOG_BUF_SHIFT\fP)
+で値を設定できるようになっている。最近のカーネルでは、コマンド 10 (下記参照) でバッファのサイズを問い合わせできる。
+.SS コマンド
+\fItype\fP 引き数はこの関数が行う動作を決定する。 以下のリストに示す値を \fItype\fP に指定できる。
+シンボル名はカーネルソースで定義されているが、ユーザ空間には公開されていない。 したがって、数字を使うか、名前を自分で定義する必要がある。
+.TP 
+\fBSYSLOG_ACTION_CLOSE\fP (0)
+ログをクローズする。現在のところ NOP である。
+.TP 
+\fBSYSLOG_ACTION_OPEN\fP (1)
+ログをオープンする。現在のところ NOP である。
+.TP 
+\fBSYSLOG_ACTION_READ\fP (2)
+ログを読み出す。 この呼び出しは、 カーネル・ログ・バッファが空でなくなるまで待って、 最大 \fIlen\fP バイトまで \fIbufp\fP
+が指すバッファに読み込み、 読み込んだバイト数を返す。 ログから読まれたバイトはログ・バッファから消える。 つまり、情報は一度しか読むことができない。
+これはユーザーのプログラムが \fI/proc/kmsg\fP を読んだ時にカーネルによって実行される関数でもある。
+.TP 
+\fBSYSLOG_ACTION_READ_ALL\fP (3)
+リング・バッファに残っているメッセージをすべて読み出し、 \fIbufp\fP が指すバッファに格納する。 この呼び出しログ・バッファの最後の \fIlen\fP
+バイトを (非破壊的に) 読み出すが、 最後の「リング・バッファ消去」命令 (下記のコマンド 5 参照)
+以降にバッファに書き込まれた情報しか読み出せない。 返り値は読み込んだバイト数である。
+.TP 
+\fBSYSLOG_ACTION_READ_CLEAR\fP (4)
+リング・バッファに残っているメッセージをすべて読み出し、クリアする。 この呼び出しは \fItype\fP 3
+と全く同じことを行い、追加で「リング・バッファ消去」 ("clear ring buffer") コマンドも実行する。
+.TP 
+\fBSYSLOG_ACTION_CLEAR\fP (5)
+「リング・バッファ消去」 (\"clear ring buffer\") コマンドのみを実行する。 引き数 \fIbufp\fP と \fIlen\fP
+は無視される。
+.IP
+このコマンドは実際にリング・バッファをクリアするわけではなく、 コマンド 3 (\fBSYSLOG_ACTION_READ_ALL\fP) と 4
+(\fBSYSLOG_ACTION_READ_CLEAR\fP で返す内容を決定するカーネルの管理変数を設定する。 このコマンドはコマンド 2
+(\fBSYSLOG_ACTION_READ\fP) と 9 (\fBSYSLOG_ACTION_SIZE_UNREAD\fP) には影響を与えない。
+.TP 
+\fBSYSLOG_ACTION_CONSOLE_OFF\fP (6)
+printk のコンソールへの出力を無効にする。 コンソールのログレベルを最小に設定し、 コンソールにメッセージが出力されないようにする。 引き数
+\fIbufp\fP と \fIlen\fP は無視される。
+.TP 
+\fBSYSLOG_ACTION_CONSOLE_ON\fP (7)
+コンソールのログレベルをデフォルトに設定し、 コンソールにメッセージが表示されるようにする。 引き数 \fIbufp\fP と \fIlen\fP は無視される。
+.TP 
+\fBSYSLOG_ACTION_CONSOLE_LEVEL\fP (8)
+コンソールのログレベルを \fIlen\fP で指定された値に設定する。 \fIlen\fP は 1 以上 8 以下の整数でなければならない。 詳細は
+\fBログレベル (loglevel)\fP の節を参照のこと。 引き数 \fIbufp\fP は無視される。
+.TP 
+\fBSYSLOG_ACTION_SIZE_UNREAD\fP (9) (Linux 2.4.10 以降)
+コマンド 2 (\fBSYSLOG_ACTION_READ\fP) でカーネル・ログ・バッファから読み出せるバイト数を返す。 引き数 \fIbufp\fP と
+\fIlen\fP は無視される。
+.TP 
+\fBSYSLOG_ACTION_SIZE_BUFFER\fP (10) (Linux 2.6.6 以降)
+カーネル・ログ・バッファの全体のサイズを返す。 引き数 \fIbufp\fP と \fIlen\fP は無視される。
+.PP
+コマンド種別 3 と 10 以外のコマンドは全て特権が必要である。
+バージョン 2.6.37 より前の Linux カーネルでは、
+コマンド種別 3 と 10 は非特権プロセスも呼び出すことができる。
+Linux 2.6.37 以降では、\fI/proc/sys/kernel/dmesg_restrict\fP が値 0 の場合に限り、
+非特権プロセスはこれらのコマンドを呼び出すことができる。
+Linux 2.6.37 より前では、「特権を持つ (privileged)」とは呼び出し者が
+\fBCAP_SYS_ADMIN\fP ケーパビリティを持つことを意味する。
+Linux 2.6.37 以降では、「特権を持つ」とは呼び出し者が
+\fBCAP_SYS_ADMIN\fP ケーパビリティか
+(新しい) \fBCAP_SYSLOG\fP ケーパビリティのいずれかを持つことを意味する
+(この目的で \fBCAP_SYS_ADMIN\fP ケーパビリティを使うのは今は非推奨である)。
+.SS "ログレベル (loglevel)"
+カーネル・ルーチンの \fBprintk\fP()  は、ログレベルが \fIconsole_loglevel\fP
+変数より小さいときにのみ、コンソールにメッセージを表示する。 \fIconsole_loglevel\fP は最初
+\fBDEFAULT_CONSOLE_LOGLEVEL\fP (7) に設定されるが、起動時にカーネルの コマンド・ライン・オプションに "debug"
+という単語が含まれている場合は 10 に設定され、カーネル・フォールトが発生した場合には 15 に設定される (但し、10 や 15
+という数字に意味はなく、8 と同等である)。 この変数は \fItype\fP が 8 の \fBsyslog\fP() の呼び出しによって設定され、値の範囲は
+1\-8 である。 \fItype\fP が 6 もしくは 7 の \fBsyslog\fP() の呼び出しの場合、 console_loglevel は 1
+(カーネル・パニックのみ)、 7 (デバッグ・メッセージ以外の全て) にそれぞれ設定される。
 
-.\"O Every text line in a message has its own loglevel.
-.\"O This level is
-.\"O .I "DEFAULT_MESSAGE_LOGLEVEL \- 1"
-.\"O (6) unless the line starts with <d>
-.\"O where \fId\fP is a digit in the range 1-7, in which case the level
-.\"O is \fId\fP.
-.\"O The conventional meaning of the loglevel is defined in
-.\"O .I <linux/kernel.h>
-.\"O as follows:
-¥á¥Ã¥»¡¼¥¸¤Î³Æ¹Ô¤Ï¤½¤ì¤¾¤ì¤Ë¥í¥°¥ì¥Ù¥ë¤ò»ý¤Ä¡£¤³¤Î¥í¥°¥ì¥Ù¥ë¤Ï
-.I "DEFAULT_MESSAGE_LOGLEVEL \- 1"
-(6) ¤Ç¤¢¤ë¤¬¡¢ <d> (\fId\fP ¤Ï 1-7 ¤ÎÈϰϤοô»ú) ¤Ç»Ï¤Þ¤ë¹Ô¤Î
-¥í¥°¥ì¥Ù¥ë¤Ï \fId\fP ¤Ç¤¢¤ë¡£
-¥í¥°¥ì¥Ù¥ë¤Î´·½¬Åª¤Ê°ÕÌ£¤Ï
-.I <linux/kernel.h>
-¤Ë°Ê²¼¤Î¤è¤¦¤ËÄêµÁ¤µ¤ì¤Æ¤¤¤ë:
+メッセージの各行はそれぞれにログレベルを持つ。このログレベルは \fIDEFAULT_MESSAGE_LOGLEVEL \- 1\fP (6) であるが、
+<d> (\fId\fP は 1\-7 の範囲の数字) で始まる行の ログレベルは \fId\fP である。 ログレベルの慣習的な意味は
+\fI<linux/kernel.h>\fP に以下のように定義されている:
 
 .nf
-.\"O #define KERN_EMERG    "<0>"  /* system is unusable               */
-.\"O #define KERN_ALERT    "<1>"  /* action must be taken immediately */
-.\"O #define KERN_CRIT     "<2>"  /* critical conditions              */
-.\"O #define KERN_ERR      "<3>"  /* error conditions                 */
-.\"O #define KERN_WARNING  "<4>"  /* warning conditions               */
-.\"O #define KERN_NOTICE   "<5>"  /* normal but significant condition */
-.\"O #define KERN_INFO     "<6>"  /* informational                    */
-.\"O #define KERN_DEBUG    "<7>"  /* debug-level messages             */
-#define KERN_EMERG    "<0>"  /* ¥·¥¹¥Æ¥à¤¬»ÈÍÑÉÔǽ         */
-#define KERN_ALERT    "<1>"  /* Ä¾¤Á¤ËÂн褬ɬÍ×           */
-#define KERN_CRIT     "<2>"  /* Ã×̿Ū¤Ê¾õÂÖ               */
-#define KERN_ERR      "<3>"  /* ¥¨¥é¡¼¾õÂÖ                 */
-#define KERN_WARNING  "<4>"  /* ·Ù¹ð¾õÂÖ                   */
-#define KERN_NOTICE   "<5>"  /* Ä̾ï¾õÂÖ¤À¤¬Âç»ö¤Ê¾ðÊó     */
-#define KERN_INFO     "<6>"  /* ÄÌÃΠ                      */
-#define KERN_DEBUG    "<7>"  /* ¥Ç¥Ð¥Ã¥°¥ì¥Ù¥ë¤Î¾ðÊó        */
+#define KERN_EMERG    "<0>"  /* システムが使用不能                */
+#define KERN_ALERT    "<1>"  /* 直ちに対処が必要           */
+#define KERN_CRIT     "<2>"  /* 致命的な状態                 */
+#define KERN_ERR      "<3>"  /* エラー状態                    */
+#define KERN_WARNING  "<4>"  /* 警告状態                       */
+#define KERN_NOTICE   "<5>"  /* 通常状態だが大事な情報          */
+#define KERN_INFO     "<6>"  /* 通知                             */
+#define KERN_DEBUG    "<7>"  /* デバッグレベルの情報        */
 .fi
-.\"O .SH "RETURN VALUE"
-.SH ÊÖ¤êÃÍ
-.\"O For \fItype\fP equal to 2, 3, or 4, a successful call to
-.\"O .BR syslog ()
-.\"O returns the number
-.\"O of bytes read.
-.\"O For \fItype\fP 9,
-.\"O .BR syslog ()
-.\"O returns the number of bytes currently
-.\"O available to be read on the kernel log buffer.
-.\"O For \fItype\fP 10,
-.\"O .BR syslog ()
-.\"O returns the total size of the kernel log buffer.
-.\"O For other values of \fItype\fP, 0 is returned on success.
-\fItype\fP ¤¬ 2, 3, 4 ¤Î¾ì¹ç¡¢À®¸ù¤¹¤ë¤È
-.BR syslog ()
-¤ÏÆɤ߽Ф·¤¿¥Ð¥¤¥È¿ô¤òÊÖ¤¹¡£
-\fItype\fP ¤¬ 9 ¤Î¾ì¹ç¡¢
-¥«¡¼¥Í¥ë¡¦¥í¥°¥Ð¥Ã¥Õ¥¡¤Ë¤¢¤ë¸½ºßÆɤ߽Ф·²Äǽ¤Ê¥Ð¥¤¥È¿ô¤òÊÖ¤¹¡£
-\fItype\fP ¤¬ 10 ¤Î¾ì¹ç¡¢
-¥«¡¼¥Í¥ë¡¦¥í¥°¥Ð¥Ã¥Õ¥¡¤ÎÁíÎ̤òÊÖ¤¹¡£
-\fItype\fP ¤¬¤½¤ì°Ê³°¤ÎÃͤξì¹ç¡¢À®¸ù¤¹¤ë¤È 0 ¤¬ÊÖ¤µ¤ì¤ë¡£
+.SH 返り値
+\fItype\fP が 2, 3, 4 の場合、成功すると \fBsyslog\fP()  は読み出したバイト数を返す。 \fItype\fP が 9 の場合、
+カーネル・ログ・バッファにある現在読み出し可能なバイト数を返す。 \fItype\fP が 10 の場合、 カーネル・ログ・バッファの総量を返す。
+\fItype\fP がそれ以外の値の場合、成功すると 0 が返される。
 
-.\"O In case of error, \-1 is returned,
-.\"O and \fIerrno\fP is set to indicate the error.
-¥¨¥é¡¼¤Î¾ì¹ç¤Ï¡¢\-1\ ¤¬Ê֤ꡢ
-\fIerrno\fP ¤Ë¥¨¥é¡¼¤ò¼¨¤¹Ãͤ¬ÀßÄꤵ¤ì¤ë¡£
-.\"O .SH ERRORS
-.SH ¥¨¥é¡¼
-.TP
-.B EINVAL
-.\"O Bad arguments (e.g.,
-.\"O bad
-.\"O .IR type ;
-.\"O or for
-.\"O .I type
-.\"O 2, 3, or 4,
-.\"O .I buf
-.\"O is NULL,
-.\"O or
-.\"O .I len
-.\"O is less than zero; or for
-.\"O .I type
-.\"O 8, the
-.\"O .I level
-.\"O is outside the range 1 to 8).
-ÉÔÀµ¤Ê°ú¤­¿ô
-(¶ñÂÎŪ¤Ë¤Ï¡¢
-.I type
-¤¬Àµ¤·¤¯¤Ê¤¤¡¢¤â¤·¤¯¤Ï
-.I type
-¤¬ 2, 3, 4 ¤Î¾ì¹ç¤Ë
-.I buf
-¤¬ NULL ¤«
-.I len
-¤¬ 0 Ì¤Ëþ¤Ç¤¢¤ë¡¢¤â¤·¤¯¤Ï
-.I type
-¤¬ 8 ¤Î¾ì¹ç¤Ë
-.I level
-¤¬ 1 °Ê¾å 8 °Ê²¼¤ÎÈϰϤËÆþ¤Ã¤Æ¤¤¤Ê¤¤)¡£
-.TP
-.B EPERM
-.\"O An attempt was made to change console_loglevel or clear the kernel
-.\"O message ring buffer by a process without sufficient privilege
-.\"O (more precisely: without the
-.\"O .B CAP_SYS_ADMIN
-.\"O capability).
-½½Ê¬¤Ê¸¢¸Â¤ò»ý¤¿¤Ê¤¤¥×¥í¥»¥¹ (Àµ³Î¤Ë¤Ï
-.B CAP_SYS_ADMIN
-¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£¤ò»ý¤¿¤Ê¤¤¥×¥í¥»¥¹) ¤¬ console_loglevel¤òÊѹ¹¤·¤è¤¦¤È¤·¤¿¤«¡¢
-¥«¡¼¥Í¥ë¡¦¥á¥Ã¥»¡¼¥¸¡¦¥ê¥ó¥°¤ò¾Ãµî¤·¤è¤¦¤È¤·¤¿¡£
-.TP
-.B ERESTARTSYS
-.\"O System call was interrupted by a signal - nothing was read.
-.\"O (This can be seen only during a trace.)
-¥·¥¹¥Æ¥à¡¦¥³¡¼¥ë¤¬¥·¥°¥Ê¥ë¤Ë¤è¤Ã¤Æ³ä¤ê¹þ¤Þ¤ì¡¢²¿¤âÆɤ߽Ф»¤Ê¤«¤Ã¤¿¡£
-(¥È¥ì¡¼¥¹Ãæ¤Ë¤·¤«È¯À¸¤¹¤ë¤³¤È¤Ï¤Ê¤¤)
-.TP
-.B ENOSYS
-.\"O This
-.\"O .BR syslog ()
-.\"O system call is not available, because the kernel was compiled with the
-.\"O .BR CONFIG_PRINTK
-.\"O kernel-configuration option disabled.
-¥«¡¼¥Í¥ë¤ÎÀßÄꥪ¥×¥·¥ç¥ó
-.BR CONFIG_PRINTK
-¤ò̵¸ú¤Ë¤·¤Æ¥«¡¼¥Í¥ë¤¬¥³¥ó¥Ñ¥¤¥ë¤µ¤ì¤Æ¤¤¤ë¤¿¤á¡¢
-.BR syslog ()
-¥·¥¹¥Æ¥à¥³¡¼¥ë¤¬ÍøÍѤǤ­¤Ê¤¤¡£
-.\"O .SH "CONFORMING TO"
-.SH ½àµò
-.\"O This system call is Linux-specific and should not be used in programs
-.\"O intended to be portable.
-¤³¤Î¥·¥¹¥Æ¥à¡¦¥³¡¼¥ë¤Ï Linux ÆÃÍ­¤Ç¤¢¤ê¡¢°Ü¿¢¤ò°Õ¿Þ¤·¤¿¥×¥í¥°¥é¥à¤Ç¤Ï
-»ÈÍѤ·¤Æ¤Ï¤¤¤±¤Ê¤¤¡£
-.\"O .SH NOTES
-.SH Ãí°Õ
-.\"O From the very start people noted that it is unfortunate that
-.\"O a system call and a library routine of the same name are entirely
-.\"O different animals.
-.\"O In libc4 and libc5 the number of this call was defined by
-.\"O .BR SYS_klog .
-.\"O In glibc 2.0 the syscall is baptized
-.\"O .BR klogctl ().
-¤«¤Ê¤ê½é´ü¤Îº¢¤«¤é¡¢Æ±¤¸Ì¾Á°¤ò»ý¤Ä¥·¥¹¥Æ¥à¡¦¥³¡¼¥ë¤È
-¥é¥¤¥Ö¥é¥ê¡¦¥ë¡¼¥Á¥ó¤¬Á´¤¯°Û¤Ê¤ëÂåʪ¤Ç¤¢¤ë¤Î¤ÏÉÔ¹¬¤Ê¤³¤È¤À¤È
-µ¤ÉÕ¤«¤ì¤Æ¤¤¤¿¡£
-libc4 ¤È libc5 ¤Ç¤Ï¤³¤Î¥³¡¼¥ë¤ÎÈÖ¹æ¤Ï
-.B SYS_klog
-¤ÈÄêµÁ¤µ¤ì¤Æ¤¤¤¿¡£
-glibc2.0 ¤Ç¤³¤Î¥·¥¹¥Æ¥à¥³¡¼¥ë¤Ï
-.BR klogctl ()
-¤È¤¤¤¦Ì¾Á°¤Ë²þ¤á¤é¤ì¤¿¡£
-.\"O .SH "SEE ALSO"
-.SH ´ØÏ¢¹àÌÜ
-.BR syslog (3)
+エラーの場合は、\-1\ が返り、 \fIerrno\fP にエラーを示す値が設定される。
+.SH エラー
+.TP 
+\fBEINVAL\fP
+不正な引き数 (具体的には、 \fItype\fP が正しくない、もしくは \fItype\fP が 2, 3, 4 の場合に \fIbuf\fP が NULL か
+\fIlen\fP が 0 未満である、もしくは \fItype\fP が 8 の場合に \fIlevel\fP が 1 以上 8 以下の範囲に入っていない)。
+.TP 
+\fBENOSYS\fP
+カーネルの設定オプション \fBCONFIG_PRINTK\fP を無効にしてカーネルがコンパイルされているため、 \fBsyslog\fP()
+システムコールが利用できない。
+.TP 
+\fBEPERM\fP
+十分な権限を持たないプロセス (正確にはケーパビリティ \fBCAP_SYS_ADMIN\fP も
+\fBCAP_SYSLOG\fP も持たないプロセス) が console_loglevel を変更しようとしたか、
+カーネル・メッセージ・リングを消去しようとした。
+.TP 
+\fBERESTARTSYS\fP
+システム・コールがシグナルによって割り込まれ、何も読み出せなかった。 (トレース中にしか発生することはない)
+.SH 準拠
+このシステム・コールは Linux 特有であり、移植を意図したプログラムでは 使用してはいけない。
+.SH 注意
+.\" In libc4 and libc5 the number of this call was defined by
+.\" .BR SYS_klog .
+.\" In glibc 2.0 the syscall is baptized
+.\" .BR klogctl ().
+かなり初期の頃から、同じ名前を持つシステムコールとライブラリルーチンが
+全く異なる別物であるのは不幸なことだと指摘されてきた。
+.SH 関連項目
+\fBsyslog\fP(3), \fBcapabilities\fP(7)
+.SH この文書について
+この man ページは Linux \fIman\-pages\fP プロジェクトのリリース 3.53 の一部
+である。プロジェクトの説明とバグ報告に関する情報は
+http://www.kernel.org/doc/man\-pages/ に書かれている。