From 7fc3d0580bafd4d804eee722769ec7786987910c Mon Sep 17 00:00:00 2001 From: Michael Kerrisk Date: Thu, 29 Nov 2012 14:48:19 +0100 Subject: [PATCH] syslog.2: Clarify semantics of SYSLOG_ACTION_CLEAR The SYSLOG_ACTION_CLEAR command (5) does not really clear the ring buffer; rather it affects the semantics of what is returned by commands 3 (SYSLOG_ACTION_READ_ALL) and 4 (SYSLOG_ACTION_READ_CLEAR). Signed-off-by: Michael Kerrisk --- man2/syslog.2 | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/man2/syslog.2 b/man2/syslog.2 index 24fc8fc86..4dd9c09c9 100644 --- a/man2/syslog.2 +++ b/man2/syslog.2 @@ -102,7 +102,7 @@ placing then in the buffer pointed to by The call reads the last \fIlen\fP bytes from the log buffer (nondestructively), but will not read more than was written into the buffer since the -last "clear ring buffer" command (which does not clear the buffer at all). +last "clear ring buffer" command (see command 5 below)). The call returns the number of bytes read. .TP .BR SYSLOG_ACTION_READ_CLEAR " (4)" @@ -118,6 +118,17 @@ The and .I len arguments are ignored. +.IP +This command does not really clear the ring buffer. +Rather, it sets a kernel bookkeeping variable that +determines the results returned by commands 3 +.RB ( SYSLOG_ACTION_READ_ALL ) +and 4 +.RB ( SYSLOG_ACTION_READ_CLEAR ). +This command has no effect on commands 2 +.RB ( SYSLOG_ACTION_READ ) +and 9 +.RB ( SYSLOG_ACTION_SIZE_UNREAD ). .TP .BR SYSLOG_ACTION_CONSOLE_OFF " (6)" Disable printk to console.