Контрольная работа: Копирование содержимого Файла 1 в остальные файлы
creat("file4",fd);
signal(SIGUSR1, p14);
kill(pid1,SIGUSR2);
sleep(1);
printf(" =IV= __eto konec prssa%d\n", prnum);
shmctl(shmid,IPC_RMID,0);
printf("================== prss4: memory closed\n");
kill(0,SIGKILL);
}
int p14(int signum) //2-oj sig
{
char temp_buf4[32]=" ";
signal(SIGUSR1, p14);
printf("***SIGUSR1*** : prss 4 (%d) has got a signal from prss 1 (%d)\n",pid4,pid1);
fd = open("temp_file", O_RDONLY);
read(fd,temp_buf4,strlen(temp_buf4));
close(fd);
creat("file4",fd);
printf("* *SIGUSR1* * : writing from temp_file to file4\n");
fd = open("file4", O_WRONLY);
write(fd,temp_buf4,strlen(temp_buf4));
close(fd);
printf("IV: writing to FILE4:\t%s\n",temp_buf4);
remove("temp_file");
printf("* *SIGUSR1* * : temp_file was removed\n");
printf("***SIGUSR1*** : end\n");
}
int p41(int signum) //1-ij sig
{