init commit

This commit is contained in:
2025-04-13 21:48:15 +03:00
commit 23255e9121
192 changed files with 12200 additions and 0 deletions
+34
View File
@@ -0,0 +1,34 @@
#include <stdio.h>
#include <unistd.h>
#include <signal.h>
#include <stdlib.h>
volatile int count = 0;
void
func(int sign)
{
if (count < 5) {
printf("%d\n", count);
fflush(stdout);
count++;
} else {
exit(0);
}
}
int
main(int argc, char *argv[])
{
printf("%d\n", getpid());
fflush(stdout);
if (signal(SIGHUP, func) == SIG_ERR) {
exit(1);
}
for (;;) {
pause();
}
return 0;
}