Files
linux-kernel-module-cheat/userland/posix/count.c
Ciro Santilli 六四事件 法轮功 fe9c31f737 fix run-toolchain, qemu-monitor, trace-boot, trace2line, bisect-linux-boot-gem5. Fixes part of #63
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.
2019-05-12 00:00:00 +00:00

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);
}
}