From 27b9689b0b66f2d18608a7969c117c3371b33a7c Mon Sep 17 00:00:00 2001 From: MaximGolubev Date: Thu, 1 Oct 2015 21:19:24 +0300 Subject: [PATCH 01/12] First lab --- main.c | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 main.c diff --git a/main.c b/main.c new file mode 100644 index 0000000..1e3a128 --- /dev/null +++ b/main.c @@ -0,0 +1,36 @@ +#include +#include +#include +#include + +int main() +{ + int pid = fork (); + char parent_filename[41] = "../process_"; + char child_filename[41] = "../process_"; + char buffer_parent [30]; + char buffer_child [30]; + if (pid == -1) + printf ("Error \n"); + else if (pid != 0) + { + printf("parent %d\n", getpid()); + snprintf (buffer_parent, 30, "%d", getpid()); + snprintf (buffer_child, 30, "%d", pid); + strcat(parent_filename, buffer_parent); + FILE * parent_file = fopen(parent_filename,"wb"); + strcat (buffer_parent, " - parent\n"); + strcat (buffer_child, " - child\n"); + fwrite(buffer_parent, strlen(buffer_parent), 1, parent_file); + fwrite(buffer_child, strlen(buffer_child), 1, parent_file); + } + else + { + printf ("child %d\n", getpid()); + snprintf (buffer_child, 30, "%d", getpid()); + strcat(child_filename, buffer_child); + FILE * child_file = fopen(child_filename,"wb"); + fwrite(buffer_child, strlen(buffer_child), 1, child_file); + } + return 0; +} From ea5c3bf5b4211aadbe63302ee23478149cebb3e5 Mon Sep 17 00:00:00 2001 From: MaximGolubev Date: Fri, 2 Oct 2015 22:20:51 +0300 Subject: [PATCH 02/12] First lab: fix --- README.md | 1 + fork.c | 39 +++++++++++++++++++++++++++++++++++++++ 2 files changed, 40 insertions(+) create mode 100644 README.md create mode 100644 fork.c diff --git a/README.md b/README.md new file mode 100644 index 0000000..51b25a2 --- /dev/null +++ b/README.md @@ -0,0 +1 @@ +# OS diff --git a/fork.c b/fork.c new file mode 100644 index 0000000..b5dc49e --- /dev/null +++ b/fork.c @@ -0,0 +1,39 @@ +#include +#include +#include +#include + +int main() +{ + int pid = fork (); + char parent_filename[41] = "../process_"; + char child_filename[41] = "../process_"; + char buffer_parent [30]; + char buffer_child [30]; + if (pid == -1) + printf ("Error \n"); + else if (pid != 0) + { + wait(); + printf("parent %d\n", getpid()); + snprintf (buffer_parent, 30, "%d", getpid()); + snprintf (buffer_child, 30, "%d", pid); + strcat(parent_filename, buffer_parent); + FILE * parent_file = fopen(parent_filename,"wb"); + strcat (buffer_parent, " - parent\n"); + strcat (buffer_child, " - child\n"); + fwrite(buffer_parent, strlen(buffer_parent), 1, parent_file); + fwrite(buffer_child, strlen(buffer_child), 1, parent_file); + fclose(parent_file); + } + else + { + printf ("child %d\n", getpid()); + snprintf (buffer_child, 30, "%d", getpid()); + strcat(child_filename, buffer_child); + snprintf (buffer_child, 30, "%d", getppid()); + FILE * child_file = fopen(child_filename,"wb"); + fwrite(buffer_child, strlen(buffer_child), 1, child_file); + } + return 0; +} From ca490daba884e2f85311da56632771ef5e0153f8 Mon Sep 17 00:00:00 2001 From: MaximGolubev Date: Fri, 2 Oct 2015 22:22:58 +0300 Subject: [PATCH 03/12] Delete main.c --- main.c | 36 ------------------------------------ 1 file changed, 36 deletions(-) delete mode 100644 main.c diff --git a/main.c b/main.c deleted file mode 100644 index 1e3a128..0000000 --- a/main.c +++ /dev/null @@ -1,36 +0,0 @@ -#include -#include -#include -#include - -int main() -{ - int pid = fork (); - char parent_filename[41] = "../process_"; - char child_filename[41] = "../process_"; - char buffer_parent [30]; - char buffer_child [30]; - if (pid == -1) - printf ("Error \n"); - else if (pid != 0) - { - printf("parent %d\n", getpid()); - snprintf (buffer_parent, 30, "%d", getpid()); - snprintf (buffer_child, 30, "%d", pid); - strcat(parent_filename, buffer_parent); - FILE * parent_file = fopen(parent_filename,"wb"); - strcat (buffer_parent, " - parent\n"); - strcat (buffer_child, " - child\n"); - fwrite(buffer_parent, strlen(buffer_parent), 1, parent_file); - fwrite(buffer_child, strlen(buffer_child), 1, parent_file); - } - else - { - printf ("child %d\n", getpid()); - snprintf (buffer_child, 30, "%d", getpid()); - strcat(child_filename, buffer_child); - FILE * child_file = fopen(child_filename,"wb"); - fwrite(buffer_child, strlen(buffer_child), 1, child_file); - } - return 0; -} From 62788d4a2ba49ad057a1e6e8b6e1d424d7f021d6 Mon Sep 17 00:00:00 2001 From: MaximGolubev Date: Fri, 2 Oct 2015 22:54:29 +0300 Subject: [PATCH 04/12] Update fork.c --- fork.c | 1 + 1 file changed, 1 insertion(+) diff --git a/fork.c b/fork.c index b5dc49e..7f768a9 100644 --- a/fork.c +++ b/fork.c @@ -34,6 +34,7 @@ int main() snprintf (buffer_child, 30, "%d", getppid()); FILE * child_file = fopen(child_filename,"wb"); fwrite(buffer_child, strlen(buffer_child), 1, child_file); + fclose(child_file); } return 0; } From 93fe254db033d53d14eeed666a681d2f1fc49e8c Mon Sep 17 00:00:00 2001 From: frodo Date: Mon, 5 Oct 2015 10:00:51 +0300 Subject: [PATCH 05/12] fix encoding --- pid.c | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/pid.c b/pid.c index 4a15a20..0e0ca33 100644 --- a/pid.c +++ b/pid.c @@ -4,32 +4,32 @@ int main() { - char p_data[15]; // , + char p_data[15]; // в эти строки будут записаны данные, которые нужно записать в файлы char c_data[15]; - char p_filename[32] = "parent_process_id"; // + char p_filename[32] = "parent_process_id"; // в эти строки будут записаны названия создаваемых процессами файлов char c_filename[31] = "child_process_id"; - int pid = fork(); // + int pid = fork(); // копируем родительский процесс - if (pid == -1) { printf("Error, child process is not created\n"); } // fork() + if (pid == -1) { printf("Error, child process is not created\n"); } // если fork() возвращает ошибку - if (pid == 0) // + if (pid == 0) // для дочернего процесса { - snprintf(c_data, 15, "%d", getpid()); // pid - strcat(c_filename, c_data); // , , pid - snprintf(c_data, 15, "%d", getppid()); // ppid + snprintf(c_data, 15, "%d", getpid()); //записываем pid дочернего процесса в строку + strcat(c_filename, c_data); // получаем имя файла, создаваемого дочерним процессом, содержащее pid + snprintf(c_data, 15, "%d", getppid()); //записываем ppid процесса FILE * c_file = fopen(c_filename, "wb"); fwrite(c_data, strlen(c_data), 1, c_file); fclose(c_file); } - else // ( fork() pid ) + else // для родительского процесса (если fork() вернул pid дочернего) { wait(); - snprintf(p_data, 15, "%d", getpid()); // pid - snprintf(c_data, 15, "%d", pid); // pid - strcat(p_filename, p_data); // , + snprintf(p_data, 15, "%d", getpid()); // записываем в строку pid родительского процесса + snprintf(c_data, 15, "%d", pid); // записываем в строку pid дочернего процесса + strcat(p_filename, p_data); // получаем имя файла, создаваемого родительским процессом strcat(p_data, "\n"); FILE * p_file = fopen (p_filename, "wb"); From becd11fab99b52029debcfc8925237da5e44503e Mon Sep 17 00:00:00 2001 From: frodo Date: Mon, 5 Oct 2015 10:01:11 +0300 Subject: [PATCH 06/12] add error.log --- error.log | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 error.log diff --git a/error.log b/error.log new file mode 100644 index 0000000..b661187 --- /dev/null +++ b/error.log @@ -0,0 +1,22 @@ +pid.c:12:12: warning: implicit declaration of function 'fork' is invalid in C99 [-Wimplicit-function-declaration] + int pid = fork(); // копируем родительский процесс + ^ +pid.c:18:30: warning: implicit declaration of function 'getpid' is invalid in C99 [-Wimplicit-function-declaration] + snprintf(c_data, 15, "%d", getpid()); //записываем pid дочернего процесса в строку + ^ +/usr/include/secure/_stdio.h:57:62: note: expanded from macro 'snprintf' + __builtin___snprintf_chk (str, len, 0, __darwin_obsz(str), __VA_ARGS__) + ^ +pid.c:20:30: warning: implicit declaration of function 'getppid' is invalid in C99 [-Wimplicit-function-declaration] + snprintf(c_data, 15, "%d", getppid()); //записываем ppid процесса + ^ +/usr/include/secure/_stdio.h:57:62: note: expanded from macro 'snprintf' + __builtin___snprintf_chk (str, len, 0, __darwin_obsz(str), __VA_ARGS__) + ^ +pid.c:29:8: error: too few arguments to function call, expected 1, have 0 + wait(); + ~~~~ ^ +/usr/include/sys/wait.h:248:1: note: 'wait' declared here +pid_t wait(int *) __DARWIN_ALIAS_C(wait); +^ +3 warnings and 1 error generated. \ No newline at end of file From 3b8e61bf7650158409aa2a0b30e283542b7276a4 Mon Sep 17 00:00:00 2001 From: MaximGolubev Date: Tue, 6 Oct 2015 08:01:09 +0300 Subject: [PATCH 07/12] Update fork.c --- fork.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/fork.c b/fork.c index 7f768a9..505f87c 100644 --- a/fork.c +++ b/fork.c @@ -3,11 +3,11 @@ #include #include -int main() +int main(int argc, char* argv[]) { int pid = fork (); - char parent_filename[41] = "../process_"; - char child_filename[41] = "../process_"; + char parent_filename[41] = "process_"; + char child_filename[41] = "process_"; char buffer_parent [30]; char buffer_child [30]; if (pid == -1) From 39d7c5de8bd8e0f86213c5d47e47a3683986701d Mon Sep 17 00:00:00 2001 From: MaximGolubev Date: Mon, 12 Oct 2015 12:34:33 +0300 Subject: [PATCH 08/12] fixed MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Теперь обращаю внимание на warnings --- fork.c | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/fork.c b/fork.c index 505f87c..0b49fde 100644 --- a/fork.c +++ b/fork.c @@ -2,6 +2,8 @@ #include #include #include +#include +#include int main(int argc, char* argv[]) { @@ -14,10 +16,10 @@ int main(int argc, char* argv[]) printf ("Error \n"); else if (pid != 0) { - wait(); + wait(NULL); printf("parent %d\n", getpid()); - snprintf (buffer_parent, 30, "%d", getpid()); - snprintf (buffer_child, 30, "%d", pid); + sprintf (buffer_parent, "%d", getpid()); + sprintf (buffer_child, "%d", pid); strcat(parent_filename, buffer_parent); FILE * parent_file = fopen(parent_filename,"wb"); strcat (buffer_parent, " - parent\n"); @@ -29,12 +31,12 @@ int main(int argc, char* argv[]) else { printf ("child %d\n", getpid()); - snprintf (buffer_child, 30, "%d", getpid()); + sprintf (buffer_child, "%d", getpid()); strcat(child_filename, buffer_child); - snprintf (buffer_child, 30, "%d", getppid()); + sprintf (buffer_child, "%d", getppid()); FILE * child_file = fopen(child_filename,"wb"); fwrite(buffer_child, strlen(buffer_child), 1, child_file); fclose(child_file); } - return 0; + return 0; } From 4ce2cdbf2314b7daf1c0cf6d6e246a3b2a4406d9 Mon Sep 17 00:00:00 2001 From: MaximGolubev Date: Thu, 15 Oct 2015 21:44:31 +0300 Subject: [PATCH 09/12] Lab-2 thread_game.c MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Вторая лабораторная работа, запускать с параметрами -lncurses -lpthread --- .../C/S---Q/thread_game.c | 65 +++++++++++++++++++ 1 file changed, 65 insertions(+) create mode 100644 include-stdio.h-include-stdlib.h-include-ncurses.h-include-unistd.h-include-pthread.h-void-print_func-void-arg-char-buffer-fread-buffer-1-1-arg-while-feof-arg-printw-c-buffer-usleep-10000-fread-buffer-1-1-arg-refresh-refresh-pthread_exit-NULL-int-main-initscr-printw-Enter-the-path-to-the-file-n/char-filename-80-getstr-filename-FILE-file-fopen-filename-r-if-file-NULL-printw-return-1-else-printw-C---start/continue-nS---pause-nQ---quit-n-n/C/S---Q/thread_game.c diff --git a/include-stdio.h-include-stdlib.h-include-ncurses.h-include-unistd.h-include-pthread.h-void-print_func-void-arg-char-buffer-fread-buffer-1-1-arg-while-feof-arg-printw-c-buffer-usleep-10000-fread-buffer-1-1-arg-refresh-refresh-pthread_exit-NULL-int-main-initscr-printw-Enter-the-path-to-the-file-n/char-filename-80-getstr-filename-FILE-file-fopen-filename-r-if-file-NULL-printw-return-1-else-printw-C---start/continue-nS---pause-nQ---quit-n-n/C/S---Q/thread_game.c b/include-stdio.h-include-stdlib.h-include-ncurses.h-include-unistd.h-include-pthread.h-void-print_func-void-arg-char-buffer-fread-buffer-1-1-arg-while-feof-arg-printw-c-buffer-usleep-10000-fread-buffer-1-1-arg-refresh-refresh-pthread_exit-NULL-int-main-initscr-printw-Enter-the-path-to-the-file-n/char-filename-80-getstr-filename-FILE-file-fopen-filename-r-if-file-NULL-printw-return-1-else-printw-C---start/continue-nS---pause-nQ---quit-n-n/C/S---Q/thread_game.c new file mode 100644 index 0000000..d70dba4 --- /dev/null +++ b/include-stdio.h-include-stdlib.h-include-ncurses.h-include-unistd.h-include-pthread.h-void-print_func-void-arg-char-buffer-fread-buffer-1-1-arg-while-feof-arg-printw-c-buffer-usleep-10000-fread-buffer-1-1-arg-refresh-refresh-pthread_exit-NULL-int-main-initscr-printw-Enter-the-path-to-the-file-n/char-filename-80-getstr-filename-FILE-file-fopen-filename-r-if-file-NULL-printw-return-1-else-printw-C---start/continue-nS---pause-nQ---quit-n-n/C/S---Q/thread_game.c @@ -0,0 +1,65 @@ +#include +#include +#include +#include +#include + +void *print_func (void * arg) +{ + char buffer; + fread(&buffer, 1, 1, arg); + while (!feof(arg)) + { + printw("%c", buffer); + usleep(10000); + fread(&buffer, 1, 1, arg); + refresh(); + } + refresh(); + pthread_exit(NULL); +} + +int main() +{ + initscr(); + printw("Enter the path to the file \n"); /*путь до файла, мои превосходные знания английского*/ + char filename[80]; + getstr(filename); + FILE * file = fopen(filename, "r"); + if (file==NULL) + { + printw("Ошибка при открытии файла"); + return 1; + } + else printw("C - start/continue\nS - pause\nQ - quit \n\n"); + /*C - начать/продолжить работу S - поставить программу на паузу Q - выход из программы*/ + pthread_t print; + int buf = getch(); + printw("\n"); + bool work = false; + while (1) + { + if (work == false && (buf=='c' || buf=='C')) + { + pthread_create(&print, NULL, print_func, file); + work = true; + } + if (buf=='s' || buf=='S') + { + pthread_cancel(print); + work = false; + } + if (buf=='q' || buf=='Q') + { + pthread_cancel(print); + break; + } + buf = getch(); + printw("\n"); + } + pthread_join(print, NULL); + refresh(); + system("pause"); + endwin(); + return 0; +} From d2e7bf7f1c15971a6f4830a53130b7d5ea9facaf Mon Sep 17 00:00:00 2001 From: MaximGolubev Date: Thu, 15 Oct 2015 21:55:05 +0300 Subject: [PATCH 10/12] Delete thread_game.c --- .../C/S---Q/thread_game.c | 65 ------------------- 1 file changed, 65 deletions(-) delete mode 100644 include-stdio.h-include-stdlib.h-include-ncurses.h-include-unistd.h-include-pthread.h-void-print_func-void-arg-char-buffer-fread-buffer-1-1-arg-while-feof-arg-printw-c-buffer-usleep-10000-fread-buffer-1-1-arg-refresh-refresh-pthread_exit-NULL-int-main-initscr-printw-Enter-the-path-to-the-file-n/char-filename-80-getstr-filename-FILE-file-fopen-filename-r-if-file-NULL-printw-return-1-else-printw-C---start/continue-nS---pause-nQ---quit-n-n/C/S---Q/thread_game.c diff --git a/include-stdio.h-include-stdlib.h-include-ncurses.h-include-unistd.h-include-pthread.h-void-print_func-void-arg-char-buffer-fread-buffer-1-1-arg-while-feof-arg-printw-c-buffer-usleep-10000-fread-buffer-1-1-arg-refresh-refresh-pthread_exit-NULL-int-main-initscr-printw-Enter-the-path-to-the-file-n/char-filename-80-getstr-filename-FILE-file-fopen-filename-r-if-file-NULL-printw-return-1-else-printw-C---start/continue-nS---pause-nQ---quit-n-n/C/S---Q/thread_game.c b/include-stdio.h-include-stdlib.h-include-ncurses.h-include-unistd.h-include-pthread.h-void-print_func-void-arg-char-buffer-fread-buffer-1-1-arg-while-feof-arg-printw-c-buffer-usleep-10000-fread-buffer-1-1-arg-refresh-refresh-pthread_exit-NULL-int-main-initscr-printw-Enter-the-path-to-the-file-n/char-filename-80-getstr-filename-FILE-file-fopen-filename-r-if-file-NULL-printw-return-1-else-printw-C---start/continue-nS---pause-nQ---quit-n-n/C/S---Q/thread_game.c deleted file mode 100644 index d70dba4..0000000 --- a/include-stdio.h-include-stdlib.h-include-ncurses.h-include-unistd.h-include-pthread.h-void-print_func-void-arg-char-buffer-fread-buffer-1-1-arg-while-feof-arg-printw-c-buffer-usleep-10000-fread-buffer-1-1-arg-refresh-refresh-pthread_exit-NULL-int-main-initscr-printw-Enter-the-path-to-the-file-n/char-filename-80-getstr-filename-FILE-file-fopen-filename-r-if-file-NULL-printw-return-1-else-printw-C---start/continue-nS---pause-nQ---quit-n-n/C/S---Q/thread_game.c +++ /dev/null @@ -1,65 +0,0 @@ -#include -#include -#include -#include -#include - -void *print_func (void * arg) -{ - char buffer; - fread(&buffer, 1, 1, arg); - while (!feof(arg)) - { - printw("%c", buffer); - usleep(10000); - fread(&buffer, 1, 1, arg); - refresh(); - } - refresh(); - pthread_exit(NULL); -} - -int main() -{ - initscr(); - printw("Enter the path to the file \n"); /*путь до файла, мои превосходные знания английского*/ - char filename[80]; - getstr(filename); - FILE * file = fopen(filename, "r"); - if (file==NULL) - { - printw("Ошибка при открытии файла"); - return 1; - } - else printw("C - start/continue\nS - pause\nQ - quit \n\n"); - /*C - начать/продолжить работу S - поставить программу на паузу Q - выход из программы*/ - pthread_t print; - int buf = getch(); - printw("\n"); - bool work = false; - while (1) - { - if (work == false && (buf=='c' || buf=='C')) - { - pthread_create(&print, NULL, print_func, file); - work = true; - } - if (buf=='s' || buf=='S') - { - pthread_cancel(print); - work = false; - } - if (buf=='q' || buf=='Q') - { - pthread_cancel(print); - break; - } - buf = getch(); - printw("\n"); - } - pthread_join(print, NULL); - refresh(); - system("pause"); - endwin(); - return 0; -} From 7dc22da48bddf6f5b61c141e9538f11be5fd26ae Mon Sep 17 00:00:00 2001 From: MaximGolubev Date: Thu, 15 Oct 2015 21:57:13 +0300 Subject: [PATCH 11/12] Lab-2 thread_game.c MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Запускать c параметрами -lncurses -lpthread --- thread_game.c | 65 +++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 65 insertions(+) create mode 100644 thread_game.c diff --git a/thread_game.c b/thread_game.c new file mode 100644 index 0000000..d70dba4 --- /dev/null +++ b/thread_game.c @@ -0,0 +1,65 @@ +#include +#include +#include +#include +#include + +void *print_func (void * arg) +{ + char buffer; + fread(&buffer, 1, 1, arg); + while (!feof(arg)) + { + printw("%c", buffer); + usleep(10000); + fread(&buffer, 1, 1, arg); + refresh(); + } + refresh(); + pthread_exit(NULL); +} + +int main() +{ + initscr(); + printw("Enter the path to the file \n"); /*путь до файла, мои превосходные знания английского*/ + char filename[80]; + getstr(filename); + FILE * file = fopen(filename, "r"); + if (file==NULL) + { + printw("Ошибка при открытии файла"); + return 1; + } + else printw("C - start/continue\nS - pause\nQ - quit \n\n"); + /*C - начать/продолжить работу S - поставить программу на паузу Q - выход из программы*/ + pthread_t print; + int buf = getch(); + printw("\n"); + bool work = false; + while (1) + { + if (work == false && (buf=='c' || buf=='C')) + { + pthread_create(&print, NULL, print_func, file); + work = true; + } + if (buf=='s' || buf=='S') + { + pthread_cancel(print); + work = false; + } + if (buf=='q' || buf=='Q') + { + pthread_cancel(print); + break; + } + buf = getch(); + printw("\n"); + } + pthread_join(print, NULL); + refresh(); + system("pause"); + endwin(); + return 0; +} From fccf01666846c6e4a299ca599b8eb7406ea40b34 Mon Sep 17 00:00:00 2001 From: frodo Date: Sun, 6 Dec 2015 22:18:17 +0300 Subject: [PATCH 12/12] errors --- error.log | 26 ++++---------------------- 1 file changed, 4 insertions(+), 22 deletions(-) diff --git a/error.log b/error.log index b661187..b0e2aa0 100644 --- a/error.log +++ b/error.log @@ -1,22 +1,4 @@ -pid.c:12:12: warning: implicit declaration of function 'fork' is invalid in C99 [-Wimplicit-function-declaration] - int pid = fork(); // копируем родительский процесс - ^ -pid.c:18:30: warning: implicit declaration of function 'getpid' is invalid in C99 [-Wimplicit-function-declaration] - snprintf(c_data, 15, "%d", getpid()); //записываем pid дочернего процесса в строку - ^ -/usr/include/secure/_stdio.h:57:62: note: expanded from macro 'snprintf' - __builtin___snprintf_chk (str, len, 0, __darwin_obsz(str), __VA_ARGS__) - ^ -pid.c:20:30: warning: implicit declaration of function 'getppid' is invalid in C99 [-Wimplicit-function-declaration] - snprintf(c_data, 15, "%d", getppid()); //записываем ppid процесса - ^ -/usr/include/secure/_stdio.h:57:62: note: expanded from macro 'snprintf' - __builtin___snprintf_chk (str, len, 0, __darwin_obsz(str), __VA_ARGS__) - ^ -pid.c:29:8: error: too few arguments to function call, expected 1, have 0 - wait(); - ~~~~ ^ -/usr/include/sys/wait.h:248:1: note: 'wait' declared here -pid_t wait(int *) __DARWIN_ALIAS_C(wait); -^ -3 warnings and 1 error generated. \ No newline at end of file +thread_game.c +- не выдается сообщения об ошибке при открытие несуществующего файла или файла, к которому нет прав доступа +- при заполнении всего экрана символы начинают перезатираться в правом нижнем углу +- если нет make-файла в где-то должно быть написано как это все собирается. Собирал по памяти, а должен был через make файл \ No newline at end of file