mirror of
https://github.com/cirosantilli/linux-kernel-module-cheat.git
synced 2026-01-22 17:55:57 +01:00
22 lines
480 B
C
22 lines
480 B
C
/* Count to infinity with 1 second sleep between each increment.
|
|
*
|
|
* https://cirosantilli.com/linux-kernel-module-cheat#unistd-h
|
|
*
|
|
* Sample application: https://cirosantilli.com/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);
|
|
}
|
|
}
|