blob: 54366b4f1750cd77d54bc218f61402a1f5df831b [file] [log] [blame]
ArtHell357e6a02016-04-19 08:39:55 +03001#ifdef _MSC_VER
2
3#define _CRT_SECURE_NO_WARNINGS
4#include <windows.h>
5
6#else
7
8#include <unistd.h>
9#include <sys/types.h>
10#include <semaphore.h>
11#include <signal.h>
12#include <cstring>
13#include <sys/wait.h>
14
15#endif
16
17#include <iostream>
18#include <stdio.h>
19#include <string>
20using namespace std;
21
22#ifdef _MSC_VER
23
24#define UP_EVENT 'U'
25#define DOWN_EVENT 'D'
26#define EXIT_EVENT 'E'
27#define ACCESS_EVENT "A"
28#define PATH "..\\Debug\\labka2_spo_child_lin.exe"
29
30#endif
31
32#define PROCESSCOUNT 4
33
34#ifdef _MSC_VER
35STARTUPINFOA si[PROCESSCOUNT];
36PROCESS_INFORMATION pi[PROCESSCOUNT];
37HANDLE upEvent[PROCESSCOUNT], downEvent[PROCESSCOUNT], exitEvent[PROCESSCOUNT], accessEvent;
38
39#else
40
41#define PATH "child"
42int pid[PROCESSCOUNT];
43bool fl;
44void synchandler(int p){
45 fl = false;
46}
47
48#endif