mirror of
https://github.com/cirosantilli/linux-kernel-module-cheat.git
synced 2026-01-25 19:21:35 +01:00
I'm sad no one reported qemu-monitor break, that one is kind of important. count.out arguments broke it as an init program, since the kernel adds trash parameters to every init. Is anyone using this repo, I wonder? Keep pushing, keep pushing. One day it gets good enough, and the whole world will see.
19 lines
418 B
C
19 lines
418 B
C
/* Count to infinity with 1 second sleep between each increment.
|
|
* Sample application: https://github.com/cirosantilli/linux-kernel-module-cheat#gdb-step-debug-userland-custom-init
|
|
*/
|
|
|
|
#define _XOPEN_SOURCE 700
|
|
#include <limits.h>
|
|
#include <stdio.h>
|
|
#include <stdlib.h>
|
|
#include <unistd.h>
|
|
|
|
int main(void) {
|
|
unsigned long i = 0;
|
|
while (1) {
|
|
printf("%lu\n", i);
|
|
i++;
|
|
sleep(1);
|
|
}
|
|
}
|