Search
j0ke.net Open Build Service
>
Projects
>
stresslinux
>
busybox
> busybox-1.11.0-dmesg-size.patch
Sign Up
|
Log In
Username
Password
Cancel
Overview
Repositories
Revisions
Requests
Users
Advanced
Attributes
Meta
File busybox-1.11.0-dmesg-size.patch of Package busybox (Revision 23)
Currently displaying revision
23
,
show latest
--- util-linux/dmesg.c.orig 2008-06-25 14:51:38.000000000 +0200 +++ util-linux/dmesg.c 2008-07-06 10:12:12.000000000 +0200 @@ -12,6 +12,14 @@ #include <sys/klog.h> #include "libbb.h" +static int kernel_ringbuffer_size(void) +{ + int len = klogctl(10, NULL, 0); + if (len > 0) + return len; + return 16384; +} + int dmesg_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE; int dmesg_main(int argc ATTRIBUTE_UNUSED, char **argv) { @@ -31,7 +39,7 @@ return EXIT_SUCCESS; } - len = (flags & OPT_s) ? xatoul_range(size, 2, INT_MAX) : 16384; + len = (flags & OPT_s) ? xatoul_range(size, 2, INT_MAX) : kernel_ringbuffer_size(); buf = xmalloc(len); len = klogctl(3 + (flags & OPT_c), buf, len); if (len < 0)