This addresses the following ticket: https://dev.openwrt.org/ticket/14459
/proc/kmsg is a read-once interface for the kernel message, buffer, making
it unsuitable for multiple concurrent readers.
In linux kernel version 3.5, /dev/kmsg was introduced, which allows
multiple readers
of the kernel message buffer:
https://www.kernel.org/doc/Documentation/ABI/testing/dev-kmsg
This patch enhances procd to use /dev/kmsg, if it is available, instead of
/proc/kmsg.

Signed-off-by: Peter Holland <[email protected]>

--- procd-2013-07-23/syslog.c   2013-10-31 23:45:29.000000000 +0000
+++ procd-2013-07-23-new/syslog.c       2013-11-11 22:48:50.657312341 +0000
@@ -29,6 +29,7 @@
 #include <libubox/uloop.h>
 #include <libubox/usock.h>
 #include <libubox/ustream.h>
+#include <linux/version.h>

 #include "procd.h"
 #include "syslog.h"
@@ -38,7 +39,11 @@
 #define LOG_LINE_LEN           256
 #define SYSLOG_PADDING         16

+#if KERNEL_VERSION >= KERNEL_VERSION(3,5,0)
+#define KLOG_DEFAULT_PROC      "/dev/kmsg"
+#else
 #define KLOG_DEFAULT_PROC      "/proc/kmsg"
+#endif

 #define PAD(x) (x % 4) ? (((x) - (x % 4)) + 4) : (x)
_______________________________________________
openwrt-devel mailing list
[email protected]
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel

Reply via email to