OSDN Git Service

Implement "dmesg -w".
authorElliott Hughes <enh@google.com>
Fri, 28 Oct 2016 22:56:01 +0000 (15:56 -0700)
committerRob Landley <rob@landley.net>
Sun, 30 Oct 2016 22:38:37 +0000 (17:38 -0500)
commita583afc812cf7be74ebab72294c8df485908ff04
tree3ec35e7b58e99c121193e94a3249787510323ec2
parent10e9abcb88be40b1382fca3d9010e46d4594996c
Implement "dmesg -w".

Annoyingly, this means writing a new dmesg implementation that uses /dev/kmsg
rather than the klogctl system call. Worse, pre-3.5 kernels don't support
that, so we need to keep the old implementation around as long as we still
care about those kernels.

Since I'm here, add the fancy colors from modern dmesg and the -C flag.

Tested on Nexus 9's 3.10 kernel, an Ubuntu 3.13 kernel, and the
Nexus One's 2.6.35 kernel.
toys/lsb/dmesg.c