<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="ko">
	<id>http://junhoahn.kr/noriwiki/index.php?action=history&amp;feed=atom&amp;title=Wait</id>
	<title>Wait - 편집 역사</title>
	<link rel="self" type="application/atom+xml" href="http://junhoahn.kr/noriwiki/index.php?action=history&amp;feed=atom&amp;title=Wait"/>
	<link rel="alternate" type="text/html" href="http://junhoahn.kr/noriwiki/index.php?title=Wait&amp;action=history"/>
	<updated>2026-06-14T04:15:46Z</updated>
	<subtitle>이 문서의 편집 역사</subtitle>
	<generator>MediaWiki 1.43.0</generator>
	<entry>
		<id>http://junhoahn.kr/noriwiki/index.php?title=Wait&amp;diff=725&amp;oldid=prev</id>
		<title>Ahn9807: 새 문서: 분류: POSIX 시스템 콜  == 개요 == 자식 프로세스와의 종료를 동기화 시킨다. 좀비 프로세스를 제거 할 수 있는 단 하나의 방식은 부모 프로세스가 wait호출을 하는 것이다. 좀비 프로세스는 exit status를 report하면서 최종적으로 종료된다. 부모 프로세스가 wait호출 없이 종료되면 좀비 프로세스는 init프로세스가 상속하여 다 죽여버린다. 다 죽여 버리겠어...  : &lt;code&gt;...</title>
		<link rel="alternate" type="text/html" href="http://junhoahn.kr/noriwiki/index.php?title=Wait&amp;diff=725&amp;oldid=prev"/>
		<updated>2023-02-21T01:40:41Z</updated>

		<summary type="html">&lt;p&gt;새 문서: &lt;a href=&quot;/noriwiki/index.php?title=%EB%B6%84%EB%A5%98:POSIX_%EC%8B%9C%EC%8A%A4%ED%85%9C_%EC%BD%9C&quot; title=&quot;분류:POSIX 시스템 콜&quot;&gt;분류: POSIX 시스템 콜&lt;/a&gt;  == 개요 == 자식 프로세스와의 종료를 동기화 시킨다. &lt;a href=&quot;/noriwiki/index.php?title=%EC%A2%80%EB%B9%84_%ED%94%84%EB%A1%9C%EC%84%B8%EC%8A%A4&amp;amp;action=edit&amp;amp;redlink=1&quot; class=&quot;new&quot; title=&quot;좀비 프로세스 (없는 문서)&quot;&gt;좀비 프로세스&lt;/a&gt;를 제거 할 수 있는 단 하나의 방식은 부모 프로세스가 wait호출을 하는 것이다. 좀비 프로세스는 exit status를 report하면서 최종적으로 종료된다. 부모 프로세스가 wait호출 없이 종료되면 좀비 프로세스는 init프로세스가 상속하여 다 죽여버린다. 다 죽여 버리겠어...  : &amp;lt;code&amp;gt;...&lt;/p&gt;
&lt;p&gt;&lt;b&gt;새 문서&lt;/b&gt;&lt;/p&gt;&lt;div&gt;[[분류: POSIX 시스템 콜]]&lt;br /&gt;
&lt;br /&gt;
== 개요 ==&lt;br /&gt;
자식 프로세스와의 종료를 동기화 시킨다. [[좀비 프로세스]]를 제거 할 수 있는 단 하나의 방식은 부모 프로세스가 wait호출을 하는 것이다. 좀비 프로세스는 exit status를 report하면서 최종적으로 종료된다. 부모 프로세스가 wait호출 없이 종료되면 좀비 프로세스는 init프로세스가 상속하여 다 죽여버린다. 다 죽여 버리겠어...&lt;br /&gt;
&lt;br /&gt;
: &amp;lt;code&amp;gt; pid_t wait(int *status);&amp;lt;/code&amp;gt;&lt;br /&gt;
: &amp;lt;code&amp;gt;pid_t waitpid( pid_t pid, int *status, int opts)&amp;lt;/code&amp;gt;&lt;br /&gt;
# pid: 종료시킬 아이디&lt;br /&gt;
# status: 종료되면서 리턴되는 status. 후에 매크로를 이용하여 어떤 status인지 확인할 수 있다.&lt;br /&gt;
# opts: 0이나 WCONTINUED | WNOHANG | WUNTRUCED의 조합을 넣어서 적절한 옵션을 준다. &lt;br /&gt;
&lt;br /&gt;
== 과정 ==&lt;br /&gt;
1. 자식이 없으면 error을 리턴한다.&lt;br /&gt;
&lt;br /&gt;
2. 만약 좀비가 있으면, PID값과 자식 프로세스의 exit code값을 process table slot에서 가져온다. 또한 자식 프로세스가 사용한 CPU시간을 부모 프로세스의 u area에 작성한다. 그리고 자식 프로세스를 process table slot에서 삭제한다. 그리고 마지막으로 exit code와 PID를 리턴한다.&lt;br /&gt;
&lt;br /&gt;
3. 만약 자식이 없으면 error을 리턴한다.&lt;br /&gt;
&lt;br /&gt;
4. sleep waiting한후 다음 자식이 종료하는 것을 기다린다.&lt;br /&gt;
&lt;br /&gt;
5. 2로 이동한다.&lt;/div&gt;</summary>
		<author><name>Ahn9807</name></author>
	</entry>
</feed>