There might be more systems which do not support chroot, so we check

for the existence of it.

Additionally, if chroot is not supported, the warn_not_available function
is invoked now.
This commit is contained in:
Sascha Schumann 2001-02-15 05:21:27 +00:00
parent c239da7e66
commit 637e8e14aa
4 changed files with 6 additions and 3 deletions

View File

@ -358,6 +358,7 @@ dnl Checks for library functions.
AC_FUNC_VPRINTF
AC_CHECK_FUNCS(
asctime_r \
chroot \
crypt \
ctime_r \
cuserid \

View File

@ -465,8 +465,10 @@ function_entry basic_functions[] = {
PHP_FE(opendir, NULL)
PHP_FE(closedir, NULL)
PHP_FE(chdir, NULL)
#if !defined(ZEND_WIN32)&&!defined(ZTS)
#if defined(HAVE_CHROOT) && !defined(ZTS)
PHP_FE(chroot, NULL)
#else
PHP_FALIAS(chroot, warn_not_available, NULL)
#endif
PHP_FE(getcwd, NULL)
PHP_FE(rewinddir, NULL)

View File

@ -223,7 +223,7 @@ PHP_FUNCTION(closedir)
/* }}} */
#if !defined(ZEND_WIN32)&&!defined(ZTS)
#if defined(HAVE_CHROOT) && !defined(ZTS)
/* {{{ proto int chroot(string directory)
Change root directory */

View File

@ -28,7 +28,7 @@ PHP_RINIT_FUNCTION(dir);
PHP_FUNCTION(opendir);
PHP_FUNCTION(closedir);
PHP_FUNCTION(chdir);
#if !defined(ZEND_WIN32)&&!defined(ZTS)
#if defined(HAVE_CHROOT) && !defined(ZTS)
PHP_FUNCTION(chroot);
#endif
PHP_FUNCTION(getcwd);