PIVOT_ROOT
Section: System Calls
(2)
Updated: Feb 23, 2000
Index
Return to Main Contents
À̸§
pivot_root - ·çÆ®ÆÄÀϽýºÅÛ ¹Ù²Ù±â.
»ç¿ë¹ý
#include <linux/unistd.h>
_syscall2(int,pivot_root,const char *,new_root,const char *,put_old)
int pivot_root(const char *new_root, const char *put_old);
¼³¸í
pivot_root´Â µð·ºÅ丮 put_old·Î ÇöÀç ÇÁ·Î¼¼½ºÀÇ ·çÆ® ÆÄÀϽýºÅÛÀ» ¿Å±â°í,
ÇöÀç ÇÁ·Î¼¼½ºÀÇ »õ·Î¿î ÆÄÀϽýºÅÛ new_root¸¦ ¸¸µç´Ù.
ÀÇ ÀüÇüÀûÀÎ »ç¿ëÀº ½Ã½ºÅÛÀÌ Àӽà ·çÆ® ÆÄÀϽýºÅÛÀ» ¸¶¿îÆ®ÇÒ ¶§ÀÎ ½Ã½ºÅÛ ºÎÆõ¿¾ÈÀÌ´Ù.
±×¸®°í³ª¼ ½ÇÁ¦ ·çÆ® ÆÄÀÏ ½Ã½ºÅÛÀ» ¸¶¿îÆ®ÇÏ°í, °á±¹ ¸ðµç °ü·ÃµÈ ÇÁ·Î¼¼½ºµé°ú ¾²·¹µåÀÇ
ÇöÀç ·çÆ®¾È¿¡ ÈÄÀÚ·Î ¹Ù²Û´Ù.
pivot_root´Â ÇöÀç ·çÆ®¿Í ¸ðµç ÇÁ·Î¼¼½º³ª ¾²·¹µåÀÇ ÇöÀç ÀÛ¾÷ÁßÀÎ µð·ºÅ丮(cwd)¸¦ º¯È½ÃÅ°³ª
±×·¸Áö ¾ÊÀ» ¼öµµ ÀÖ´Ù. pivot_rootÀÇ caller´Â ·çÆ®³ª cwdÀÇ ÇÁ·Î¼¼½º¸¦ È®ÀÎÇؾ߸¸ ÇÑ´Ù. È®ÀÎÀÇ ½¬¿î ¹æ¹ýÀº pivot_root
ÀÌ ½ÇÇàµÇ±â Àü¿¡ new_root·Î ·çÆ®, cwd¸¦ ¹Ù²Ù´Â °ÍÀÌ´Ù.
ÀÌ°ÍÀº ¶ÇÇÑ ÇöÀç ÇÁ·Î¼¼½º¿¡ Àû¿ëÇÑ´Ù´Â °ÍÀ» ÁÖÁöÇÑ´Ù:pivot_root´Â cwd¿¡ ¿µÇâÀ»
¹ÞÀ» ¼öµµ ÀÖ°í ±×·¸Áö ¾ÊÀ» ¼öµµ ÀÖ´Ù. ±×·¯¹Ç·Î ±×°ÍÀº pivot_rootÈÄ¿¡ Áï½Ã chdir("/")
È£ÃâÀ» ¸í·ÉÇÑ´Ù.
´ÙÀ½ÀÇ Á¦ÇÑÀº new_root¿Í put_old¸¦ Àû¿ëÇÑ´Ù:
- -
-
µð·ºÅ丮¿©¸¸ ÇÑ´Ù.
- -
-
new_root ¿Í put_old´Â ÇöÀç ·çÆ®¿Í °°Àº ÆÄÀÏ ½Ã½ºÅÛÀÌ ¾Æ´Ï¾î¾ßÇÑ´Ù.
- -
-
put_old´Â new_root ¾Æ·¡À̾î¾ß¸¸ ÇÑ´Ù.
- -
-
¾î¶°ÇÑ ´Ù¸¥ ÆÄÀÏ ½Ã½ºÅÛµµ put_old¿¡ ¸¶¿îÆ®µÇÁö ¾Ê¾ÒÀ» ·±Áö ¸ð¸¥´ô.
Ãß°¡ »ç¿ë¿¹Á¦¸¦ À§ÇØ pivot_root(8)¸¦ º»´Ù.
ÁÖÀÇ
new_root´Â ¸¶¿îÆ® Æ÷ÀÎÆ®°¡ µÇÁö¾Ê¾Æ¾ß ÇÑ´Ù.
¹Ýȯ°ª
¼º°ø½Ã, 0ÀÌ ¹ÝȯµÈ´Ù. ½ÇÆнÃ,-1ÀÌ ¹ÝȯµÇ°í
errno´Â ÀûÀýÈ÷ ¼³Á¤µÈ´Ù.
¿¡·¯
pivot_root´Â stat(2)¿¡ ÀÇÇØ ¹ÝȯµÈ ¿¡·¯ÀÇ ´ëºÎºÐÀ» ¹ÝȯÇÒ·±Áö ¸ð¸¥´Ù. Ãß°¡ÀûÀ¸·Î, ¾Æ
·¡ÀÇ »çÇ×ÀÌ ¹ÝȯµÉ·±Áöµµ ¸ð¸¥´Ù:
- EBUSY
-
new_root ³ªput_old´Â ÇöÀç ·çÆ®ÆÄÀϽýºÅÛ¿¡ Àְųª ÆÄÀÏ ½Ã½ºÅÛÀÌ À̹Ì
put_old¿¡ ¸¶¿îÆ® µÇ¾ú´Ù.
- EINVAL
-
put_old°¡ new_root¹Ø¿¡ ¾ø´Ù.
- ENOTDIR
-
new_root ³ª put_old°¡ µð·ºÅ丮°¡ ¾Æ´Ï´Ù.
- EPERM
-
ÇöÀç ÇÁ·Î¼¼½º°¡ °ü¸®ÀÚ ±â´ÉÀÌ ¾ø´Ù.
¹ö±×
pivot_root´Â ½Ã½ºÅÛÀÇ ¸ðµç ´Ù¸¥ ÇÁ·Î¼¼½ºµéÀÇ ·çÆ®¿Í cwd¸¦ ¹Ù²ÙÁö ¾Ê¾Æ¾ß¸¸ Çß´Ù.
ȣȯ
pivot_root´Â ¸®´ª½º¿¡¼¸¸ ¾²À̹ǷΠÀÌ½ÄµÉ ¼ö ¾ø´Ù.
¿ª»ç
pivot_root´Â ¸®´ª½º 2.3.41¿¡¼ ¼Ò°³ µÇ¾ú´Ù.
°ü·Ã Ç׸ñ
chdir(2),
chroot(2),
initrd(4),
pivot_root(8),
stat(2)
¿ªÀÚ
ASPLINUX<man@asp-linux.co.kr>, 2000³â 7¿ù 26
Index
- À̸§
-
- »ç¿ë¹ý
-
- ¼³¸í
-
- ÁÖÀÇ
-
- ¹Ýȯ°ª
-
- ¿¡·¯
-
- ¹ö±×
-
- ȣȯ
-
- ¿ª»ç
-
- °ü·Ã Ç׸ñ
-
- ¿ªÀÚ
-
This document was created by
man2html,
using the manual pages.
Time: 08:07:00 GMT, March 25, 2004