FORK
Section: ¸®´ª½º ÇÁ·Î±×·¡¸Ó ¸Å´º¾ó (2)
Updated: 1995³â 6¿ù 10ÀÏ
Index
Return to Main Contents
À̸§
fork - ÀÚ½Ä ÇÁ·Î¼¼½º¸¦ ¸¸µç´Ù.
»ç¿ë¹ý
#include <unistd.h>
pid_t fork(void);
¼³¸í
fork´Â
ºÎ¸ð ÇÁ·Î¼¼½º¿Í´Â ´ÜÁö PID¿Í PPID¸¸ÀÌ ´Ù¸¥ ÀÚ½Ä ÇÁ·Î¼¼½º¸¦ ¸¸µç´Ù. ±×¸®°í
ÀÚ¿ø »ç¿ë·®À» 0À¸·Î ¸ÂÃá´Ù. ÆÄÀÏ ¶ô(lock)°ú ½Ã±×³Î Ææµù(pending)Àº »ó¼Ó¹ÞÁö ¾Ê´Â´Ù.
¸®´ª½º¿¡¼,
fork´Â
copy-on-wite ÆäÀÌÁöµé¸¦ »ç¿ëÇÏ¿© ¼öÇàµÇ¸ç, forkÀÇ À¯ÀÏÇÑ ´ÜÁ¡Àº
ºÎ¸ð ÇÁ·Î¼¼½ºÀÇ ÆäÀÌÁö Å×À̺íÀ» º¹»çÇÏ°í ÀÚ½Ä ÇÁ·Î¼¼½º¿¡ ´ëÇÑ task ±¸Á¶Ã¼¸¦
¸¸µé±â À§ÇØ ÇÊ¿äÇÑ ½Ã°£°ú ¸Þ¸ð¸®ÀÌ´Ù.
¹Ýȯ°ª
¼º°ø½Ã, ÀÚ½Ä ÇÁ·Î¼¼½ºÀÇ PID°¡ ºÎ¸ð¿¡°Ô ¸®ÅϵǸç, ÀڽĿ¡°Ô´Â 0ÀÌ ¸®ÅϵȴÙ.
½ÇÆÐÇÒ °æ¿ì, -1ÀÌ ºÎ¸ð¿¡°Ô ¸®ÅϵǸç, ÀÚ½ÄÀº »ý¼ºµÇÁö ¾Ê´Â´Ù. ±×¸®°í
errno´Â
ÀûÀýÇÑ °ªÀ¸·Î ¼³Á¤µÈ´Ù.
¿¡·¯
- EAGAIN
-
ºÎ¸ð ÇÁ·Î¼¼½ºÀÇ ÆäÀÌÁö Å×À̺íµéÀ» º¹»çÇϱâ À§ÇÑ ÃæºÐÇÑ ¸Þ¸ð¸®¸¦ ÇÒ´çÇÒ ¼ö
¾ø°Å³ª ÀÚ½Ä ÇÁ·Î¼¼½º¸¦ À§ÇØ Å½ºÅ© ±¸Á¶Ã¼¸¦ ÇÒ´çÇÒ ¼ö ¾ø´Ù.
- ENOMEM
-
¸Þ¸ð¸®°¡ ²Ë Â÷¼ ÇÊ¿äÇÑ Ä¿³Î ±¸Á¶Ã¼¸¦ ÇÒ´çÇÒ ¼ö ¾ø´Ù.
ȣȯ
SVr4, SVID, POSIX, X/OPEN, BSD 4.3
°ü·Ã Ç׸ñ
clone(2),
execve(2),
vfork(2),
wait(2)
¿ªÀÚ
Á¤°ÈÆ <skyeyes@soback.kornet.net>, 2000³â 4¿ù 27ÀÏ
Index
- À̸§
-
- »ç¿ë¹ý
-
- ¼³¸í
-
- ¹Ýȯ°ª
-
- ¿¡·¯
-
- ȣȯ
-
- °ü·Ã Ç׸ñ
-
- ¿ªÀÚ
-
This document was created by
man2html,
using the manual pages.
Time: 08:07:00 GMT, March 25, 2004