Files
linux-kernel-module-cheat/userland/count.c
Ciro Santilli 六四事件 法轮功 146e568db8 move all our stuff into /lkmc in guest
Motivation: userland is getting several new subdirectories, it would be
too insane to just dump all of that in the guest root filesystem.

To alleviate the cd pain, .profile puts user inside /lkmc by default.
2019-05-05 00:00:00 +00:00

22 lines
434 B
C

/* Count to infinity with 1 second sleep between each increment. */
#define _XOPEN_SOURCE 700
#include <limits.h>
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
int main(int argc, char **argv) {
unsigned long i = 0, max;
if (argc > 1) {
max = strtoul(argv[1], NULL, 10);
} else {
max = ULONG_MAX;
}
while (i < max) {
printf("%lu\n", i);
i++;
sleep(1);
}
}