chroot

CHROOT(2)                  Linux Programmer's Manual                 CHROOT(2)



åå
       chroot - ã«ã¼ãã»ãã£ã¬ã¯ããªãå¤æ´ãã

æ¸å¼
       #include <unistd.h>

       int chroot(const char *path);

説æ
       chroot ã¯ãã«ã¼ãã»ãã£ã¬ã¯ããªã path ã§æå®ããããã£ã¬ã¯ããªã«å¤æ´ããã
       ãã®ãã£ã¬ã¯ããªãã/ ã§å§ã¾ããã¹åã¨ãã¦ä½¿ãããã
       ãã®ã«ã¼ãã»ãã£ã¬ã¯ããªã¯ç¾å¨ã®ããã»ã¹ã®å¨ã¦ã®åããã»ã¹ã«åãç¶ãããã

       ã¹ã¼ãã¼ã»ã¦ã¼ã¶ã¼ã ããã«ã¼ãã»ãã£ã¬ã¯ããªãå¤æ´ã§ããã

       ãã®ã³ã¼ã«ã¯ç¾å¨ã®ä½æ¥ãã£ã¬ã¯ããª(working directory)ãå¤æ´ããªãã
       ã¨ã«æ³¨æãããã¨ããã㧠'.' ã '/' ãæ ¹ã¨ããããªã¼ã®å¤ã«ãªãå ´åã ããã

è¿ãå¤
       æåããã¨ã0ãè¿ãã 失æããã¨ã-1ãè¿ãã errno ã«é©åãªå¤ãè¨å®ããã

ã¨ã©ã¼
       ãã¡ã¤ã«ã·ã¹ãã ã«ãã£ã¦ã¯ä»ã®ã¨ã©ã¼ãè¿ãããäºãããã è¬çãªã¨ã©ã¼ã以ä¸ã«æãã:


       EPERM   å®å¹(effective)UIDãã¼ãã§ãªãã

       EFAULT  path ãå²ãå½ã¦ãããã¢ãã¬ã¹ç©ºéå¤ãæãã¦ããã

       ENAMETOOLONG
               path ãé·éããã

       ENOENT  ãã¡ã¤ã«ãåå¨ããªãã

       ENOMEM  ã«ã¼ãã«ã«ååãªã¡ã¢ãªããªãã

       ENOTDIR path ã®æ§æè¦ç´ ããã£ã¬ã¯ããªã§ã¯ãªãã

       EACCES  ãã¹åã®æ§æè¦ç´ ã«æ¤ç´¢è¨±å¯(search permission)ããªãã

       ELOOP   path ã解決ããéã«ééããã·ã³ããªãã¯ã»ãªã³ã¯ãå¤éããã

       EIO     I/O ã¨ã©ã¼ãçºçããã

æºæ
       SVr4, SVID, 4.4BSD, X/OPEN.  ãã®é¢æ°ã¯ POSIX.1 ã«ã¯ãªãã SVr4 ã«ã¯ä»ã«
       EINTR, ENOLINK, EMULTIHOP ã¨ã©ã¼ç¶æã«ã¤ãã¦ã®è¨è¿°ãããã X/OPEN ã«ã¯ EIO,
       ENOMEM, EFAULT ã¨ã©ã¼ç¶æã®è¨è¿°ã¯ãªãã ãã®ã¤ã³ã¿ã¼ãã§ã¼ã¹ã¯ X/OPEN
       ãåãç¶ãã ãã®ã§ããã

é¢é£é ç®
       chdir(2)



Linux 2.0.30                    21 August 1997                       CHROOT(2)