mirror of
https://github.com/cirosantilli/linux-kernel-module-cheat.git
synced 2026-01-25 11:11:35 +01:00
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.
22 lines
434 B
C
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);
|
|
}
|
|
}
|