From ddeb0ab773992b046e277e8ca12d53e581ca28fe Mon Sep 17 00:00:00 2001 From: hyomin777 Date: Sun, 4 Jan 2026 12:12:22 +0900 Subject: [PATCH] =?UTF-8?q?Typo:=20Computer=20Science/Operating=20System/[?= =?UTF-8?q?OS]=20System=20Call=20(Fork=20Wait=20Exec)=201.=20=EC=84=B8?= =?UTF-8?q?=EB=AF=B8=EC=BD=9C=EB=A1=A0=20=EB=88=84=EB=9D=BD=20=EC=88=98?= =?UTF-8?q?=EC=A0=95=20-=20printf("this=20shouldn't=20print=20out")=20->?= =?UTF-8?q?=20=EC=8B=A4=ED=96=89=EB=90=98=EC=A7=80=20=EC=95=8A=EB=8A=94=20?= =?UTF-8?q?=EC=BD=94=EB=93=9C=EC=9D=B4=EB=AF=80=EB=A1=9C=20=20=20=EC=84=B8?= =?UTF-8?q?=EB=AF=B8=EC=BD=9C=EB=A1=A0=EC=9D=B4=20=ED=95=84=EC=9A=94?= =?UTF-8?q?=EC=97=86=EC=A7=80=EB=A7=8C=20=EC=BD=94=EB=93=9C=20=ED=86=B5?= =?UTF-8?q?=EC=9D=BC=EC=84=B1=EC=9D=84=20=EC=9C=84=ED=95=B4=20=EB=88=84?= =?UTF-8?q?=EB=9D=BD=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 2. 헤더파일 추가 - strdup() 실행을 위한 string.h 헤더파일 추가 --- .../Operating System/[OS] System Call (Fork Wait Exec).md | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Computer Science/Operating System/[OS] System Call (Fork Wait Exec).md b/Computer Science/Operating System/[OS] System Call (Fork Wait Exec).md index c56fcdb3..88b71387 100644 --- a/Computer Science/Operating System/[OS] System Call (Fork Wait Exec).md +++ b/Computer Science/Operating System/[OS] System Call (Fork Wait Exec).md @@ -119,6 +119,7 @@ child에서는 parent와 다른 동작을 하고 싶을 때는 exec를 사용할 ```c #include #include +#include #include #include @@ -137,10 +138,10 @@ int main(int argc, char *argv[]) { myargs[1] = strdup("p3.c"); // 실행할 파일에 넘겨줄 argument myargs[2] = NULL; // end of array execvp(myarges[0], myargs); // wc 파일 실행. - printf("this shouldn't print out") // 실행되지 않음. + printf("this shouldn't print out"); // 실행되지 않음. } else { // (3) parent case - int wc = wait(NULL) // 추가된 부분 + int wc = wait(NULL); // 추가된 부분 printf("parent of %d (wc : %d / pid : %d)", wc, rc, (int)getpid()); } }