Skip to content

Commit 594839b

Browse files
committed
Merge branch 'PHP-8.3'
2 parents 239379b + ff2b508 commit 594839b

File tree

4 files changed

+22
-12
lines changed

4 files changed

+22
-12
lines changed

ext/posix/config.m4

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,12 @@ if test "$PHP_POSIX" = "yes"; then
1010

1111
AC_CHECK_HEADERS([sys/mkdev.h sys/sysmacros.h])
1212

13-
AC_CHECK_FUNCS(seteuid setegid setsid getsid getpgid ctermid mkfifo mknod setrlimit getrlimit getgroups makedev initgroups getgrgid_r posix_pathconf eaccess)
13+
AC_CHECK_FUNCS(seteuid setegid setsid getsid getpgid ctermid mkfifo mknod setrlimit getrlimit getgroups makedev initgroups getgrgid_r eaccess)
14+
15+
dnl Skip pathconf and fpathconf check on musl libc due to limited implementation
16+
dnl (first argument is not validated and has different error).
17+
AS_IF([command -v ldd >/dev/null && ldd --version 2>&1 | grep -q "^musl"],[],
18+
[AC_CHECK_FUNCS(pathconf fpathconf)])
1419

1520
AC_MSG_CHECKING([for working ttyname_r() implementation])
1621
AC_RUN_IFELSE([AC_LANG_SOURCE([[

ext/posix/posix.c

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -533,8 +533,8 @@ PHP_FUNCTION(posix_isatty)
533533
/* }}} */
534534

535535
/*
536-
POSIX.1, 4.8.1 sysconf() - TODO
537-
POSIX.1, 5.7.1 pathconf(), fpathconf() - TODO
536+
POSIX.1, 4.8.1 sysconf()
537+
POSIX.1, 5.7.1 pathconf(), fpathconf()
538538
539539
POSIX.1, 5.1.2 opendir(), readdir(), rewinddir(), closedir()
540540
POSIX.1, 5.2.1 chdir()
@@ -1240,7 +1240,7 @@ PHP_FUNCTION(posix_sysconf)
12401240
RETURN_LONG(sysconf(conf_id));
12411241
}
12421242

1243-
#ifdef HAVE_POSIX_PATHCONF
1243+
#ifdef HAVE_PATHCONF
12441244
PHP_FUNCTION(posix_pathconf)
12451245
{
12461246
zend_long name, ret;
@@ -1269,7 +1269,9 @@ PHP_FUNCTION(posix_pathconf)
12691269

12701270
RETURN_LONG(ret);
12711271
}
1272+
#endif
12721273

1274+
#ifdef HAVE_FPATHCONF
12731275
PHP_FUNCTION(posix_fpathconf)
12741276
{
12751277
zend_long name, ret, fd = 0;

ext/posix/posix.stub.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -446,8 +446,11 @@ function posix_initgroups(string $username, int $group_id): bool {}
446446

447447
function posix_sysconf(int $conf_id): int {}
448448

449-
#ifdef HAVE_POSIX_PATHCONF
449+
#ifdef HAVE_PATHCONF
450450
function posix_pathconf(string $path, int $name): int|false {}
451+
#endif
452+
453+
#ifdef HAVE_FPATHCONF
451454
/** @param resource|int $file_descriptor */
452455
function posix_fpathconf($file_descriptor, int $name): int|false {}
453456
#endif

ext/posix/posix_arginfo.h

Lines changed: 7 additions & 7 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)