static public Method

Dir.chroot(p1)

Dir.chroot( string )  0

Changes this process’s idea of the file system root. Only a privileged process may make this call. Not available on all platforms. On Unix systems, see chroot(2) for more information.

Source Code

/*
*  call-seq:
*     Dir.chroot( string ) => 0
*
*  Changes this process's idea of the file system root. Only a
*  privileged process may make this call. Not available on all
*  platforms. On Unix systems, see <code>chroot(2)</code> for more
*  information.
*/
static VALUE
dir_s_chroot(dir, path)
   VALUE dir, path;
{
#if defined(HAVE_CHROOT) && !defined(__CHECKER__)
   check_dirname(&path);

   if (chroot(RSTRING(path)->ptr) == -1)
       rb_sys_fail(RSTRING(path)->ptr);

   return INT2FIX(0);
#else
   rb_notimplement();
   return Qnil;                /* not reached */
#endif
}
Comments

Have your say
Please use Textile formatting (click here for a cheat sheet). Use <code/> and <pre/> for code samples.
Click here to login with OpenID to to post comments.