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
+35
View File
@@ -0,0 +1,35 @@
#include <stdio.h>
#include <unistd.h>
#include <sys/types.h>
#include <stdlib.h>
#include <signal.h>
volatile int cnt = 0;
void
f(int n)
{
if (cnt == 5) {
exit(0);
}
printf("%d\n", cnt++);
fflush(stdout);
return;
}
int
main(int argc, char *argv[])
{
sigaction(SIGHUP, &(struct sigaction){.sa_handler = f, .sa_flags = SA_RESTART}, NULL);
printf("%d\n", getpid());
fflush(stdout);
for (;;) {
pause();
}
return 0;
}