summaryrefslogtreecommitdiffstats
path: root/Modules
diff options
context:
space:
mode:
authorMartin v. Löwis <martin@v.loewis.de>2001-10-04 22:44:26 (GMT)
committerMartin v. Löwis <martin@v.loewis.de>2001-10-04 22:44:26 (GMT)
commit244edc89852ef4c0338438e94c7f3801f289f83e (patch)
tree58c5aa8e22e44fdc8b6d1b3f99facf5bb79d9c8d /Modules
parentfcc16330a4f751c0ff0d9c02f0762ce0eaf230bf (diff)
downloadcpython-244edc89852ef4c0338438e94c7f3801f289f83e.zip
cpython-244edc89852ef4c0338438e94c7f3801f289f83e.tar.gz
cpython-244edc89852ef4c0338438e94c7f3801f289f83e.tar.bz2
Add chroot call. Implements feature #459267.
Diffstat (limited to 'Modules')
-rw-r--r--Modules/posixmodule.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/Modules/posixmodule.c b/Modules/posixmodule.c
index 0b4b765..c21f7f8 100644
--- a/Modules/posixmodule.c
+++ b/Modules/posixmodule.c
@@ -724,6 +724,18 @@ posix_chmod(PyObject *self, PyObject *args)
}
+#ifdef HAVE_CHROOT
+static char posix_chroot__doc__[] =
+"chroot(path) -> None\n\
+Change root directory to path.";
+
+static PyObject *
+posix_chroot(PyObject *self, PyObject *args)
+{
+ return posix_1str(args, "et:chroot", chroot);
+}
+#endif
+
#ifdef HAVE_FSYNC
static char posix_fsync__doc__[] =
"fsync(fildes) -> None\n\
@@ -5336,6 +5348,9 @@ static PyMethodDef posix_methods[] = {
#ifdef HAVE_CHOWN
{"chown", posix_chown, METH_VARARGS, posix_chown__doc__},
#endif /* HAVE_CHOWN */
+#ifdef HAVE_CHROOT
+ {"chroot", posix_chroot, METH_VARARGS, posix_chroot__doc__},
+#endif
#ifdef HAVE_CTERMID
{"ctermid", posix_ctermid, METH_VARARGS, posix_ctermid__doc__},
#endif