Created
March 22, 2016 22:30
-
-
Save lucindo/434b92ad978440ba27eb to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <sys/klog.h> | |
#include <stdlib.h> | |
#include <unistd.h> | |
int main(void) { | |
int logsize = klogctl(10 /* SYSLOG_ACTION_SIZE_BUFFER */, 0, 0); | |
char *bufp = malloc(logsize); | |
klogctl(3 /* SYSLOG_ACTION_READ_ALL */, bufp, logsize); | |
write(1, bufp, logsize); | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment