mirror of
https://github.com/python/cpython.git
synced 2025-08-04 00:48:58 +00:00
Add chroot call. Implements feature #459267.
This commit is contained in:
parent
fcc16330a4
commit
244edc8985
5 changed files with 27 additions and 3 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue