From 80945477f063d1c3790e87d5c0b533cfd8f3db64 Mon Sep 17 00:00:00 2001 From: Michael Kerrisk Date: Thu, 8 Sep 2011 03:31:45 +0200 Subject: [PATCH] syslog.2: Minor wording and formatting changes Signed-off-by: Michael Kerrisk --- man2/syslog.2 | 38 +++++++++++++++++--------------------- 1 file changed, 17 insertions(+), 21 deletions(-) diff --git a/man2/syslog.2 b/man2/syslog.2 index fb018a637..d9eef3b03 100644 --- a/man2/syslog.2 +++ b/man2/syslog.2 @@ -26,7 +26,7 @@ .\" 2008-02-15, Michael Kerrisk .\" Update LOG_BUF_LEN details; update RETURN VALUE section. .\" -.TH SYSLOG 2 2008-06-20 "Linux" "Linux Programmer's Manual" +.TH SYSLOG 2 2011-09-07 "Linux" "Linux Programmer's Manual" .SH NAME syslog, klogctl \- read and/or clear kernel message ring buffer; set console_loglevel @@ -50,33 +50,29 @@ then look at .BR syslog (3). The system call of this name is about controlling the kernel .IR printk () -buffer, and the glibc version is called +buffer, and the glibc wrapper function is called .BR klogctl (). -The \fItype\fP argument determines the action taken by this function. +The \fItype\fP argument determines the action taken by this function, +as follows: -Quoting from -.IR kernel/printk.c : .nf -/* - * Commands to sys_syslog: - * - * 0 \-\- Close the log. Currently a NOP. - * 1 \-\- Open the log. Currently a NOP. - * 2 \-\- Read from the log. - * 3 \-\- Read all messages remaining in the ring buffer. - * 4 \-\- Read and clear all messages remaining in the ring buffer - * 5 \-\- Clear ring buffer. - * 6 \-\- Disable printk to console - * 7 \-\- Enable printk to console - * 8 \-\- Set level of messages printed to console - * 9 \-\- Return number of unread characters in the log buffer - * 10 \-\- Return size of the log buffer - */ + 0 \-\- Close the log. Currently a NOP. + 1 \-\- Open the log. Currently a NOP. + 2 \-\- Read from the log. + 3 \-\- Read all messages remaining in the ring buffer. + 4 \-\- Read and clear all messages remaining in the ring buffer + 5 \-\- Clear ring buffer. + 6 \-\- Disable printk to console + 7 \-\- Enable printk to console + 8 \-\- Set level of messages printed to console + 9 \-\- Return number of unread characters in the log buffer + 10 \-\- Return size of the log buffer .fi +Type 9 was added in Linux 2.4.10; type 10 in Linux 2.6.6. + Only command types 3 and 10 are allowed to unprivileged processes. -Type 9 was added in 2.4.10; type 10 in 2.6.6. .SS The kernel log buffer The kernel has a cyclic buffer of length .B LOG_BUF_LEN