This repository has been archived on 2026-07-28. You can view files and clone it. You cannot open issues or pull requests or push a commit.
Files
cmc/3sem/seminars/l11/02.c
T
2025-04-13 21:48:15 +03:00

26 lines
446 B
C
Executable File

#include <stdio.h>
#include <sys/types.h>
#include <sys/sem.h>
#include <sys/shm.h>
#include <sys/ipc.h>
#include <stdlib.h>
#include <sys/wait.h>
#include <unistd.h>
// пинг понг для n процессов
int
main(int argc, char **argv)
{
int n = (int) strtoll(argv[1], NULL, 10);
int max_n = (int) strtoll(argv[2], NULL, 10);
for (int i = 0; i < n; ++i) {
}
while (wait(NULL) != -1)
;
return 0;
}