diff --git a/ext/posix/config.m4 b/ext/posix/config.m4 index 865546356953..4b795016fb07 100644 --- a/ext/posix/config.m4 +++ b/ext/posix/config.m4 @@ -42,12 +42,7 @@ if test "$PHP_POSIX" = "yes"; then #endif ])]) -dnl Skip pathconf and fpathconf check on musl libc due to limited implementation -dnl (first argument is not validated and has different error). - PHP_C_STANDARD_LIBRARY - AS_VAR_IF([php_cv_c_standard_library], [musl], - [], - [AC_CHECK_FUNCS([pathconf fpathconf])]) + AC_CHECK_FUNCS([pathconf fpathconf]) AC_CACHE_CHECK([for working ttyname_r() implementation], [php_cv_func_ttyname_r], diff --git a/ext/posix/tests/posix_pathconf.phpt b/ext/posix/tests/posix_pathconf.phpt index ba451c62df97..8df6e872119b 100644 --- a/ext/posix/tests/posix_pathconf.phpt +++ b/ext/posix/tests/posix_pathconf.phpt @@ -13,12 +13,15 @@ try { } catch (\ValueError $e) { echo $e->getMessage(). "\n"; } -var_dump(posix_pathconf(str_repeat('non_existent', 4096), POSIX_PC_NAME_MAX)); -var_dump(posix_errno() != 0); + +/* POSIX specifically allows implementations to ignore the first + * argument if it will not affect the result. */ +$result = posix_pathconf(str_repeat('non_existent', 4096), + POSIX_PC_NAME_MAX); +var_dump( ($result == false && posix_errno() != 0) || is_int($result) ); var_dump(posix_pathconf(sys_get_temp_dir(), POSIX_PC_PATH_MAX)); ?> --EXPECTF-- posix_pathconf(): Argument #1 ($path) must not be empty -bool(false) bool(true) int(%d)