Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 1 addition & 6 deletions ext/posix/config.m4
Original file line number Diff line number Diff line change
Expand Up @@ -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],
Expand Down
9 changes: 6 additions & 3 deletions ext/posix/tests/posix_pathconf.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Loading