diff --git a/UPGRADING.INTERNALS b/UPGRADING.INTERNALS index c3b49d9d888fc..459156f46c753 100644 --- a/UPGRADING.INTERNALS +++ b/UPGRADING.INTERNALS @@ -162,6 +162,7 @@ PHP 8.4 INTERNALS UPGRADE NOTES - Symbols PHP_HAVE_AVX512_SUPPORTS and PHP_HAVE_AVX512_VBMI_SUPPORTS are now either defined to 1 or undefined. - Symbol HAVE_LIBCRYPT has been removed. + - Symbol HAVE_ST_BLOCKS has been removed (use HAVE_STRUCT_STAT_ST_BLOCKS). - M4 macro PHP_DEFINE (atomic includes) removed (use AC_DEFINE and config.h). - M4 macro PHP_WITH_SHARED has been removed (use PHP_ARG_WITH). - M4 macro PHP_STRUCT_FLOCK has been removed (use AC_CHECK_TYPES). diff --git a/configure.ac b/configure.ac index f30f58983fa3b..503d40d254fc4 100644 --- a/configure.ac +++ b/configure.ac @@ -497,11 +497,11 @@ AS_VAR_IF([php_cv_have_alignof], [yes], dnl Check for structure members. AC_CHECK_MEMBERS([struct tm.tm_gmtoff],,,[#include ]) -AC_CHECK_MEMBERS([struct stat.st_blksize, struct stat.st_rdev]) -dnl AC_STRUCT_ST_BLOCKS will screw QNX because fileblocks.o does not exist. -if test "$(uname -s 2>/dev/null)" != "QNX"; then - AC_STRUCT_ST_BLOCKS -fi +AC_CHECK_MEMBERS(m4_normalize([ + struct stat.st_blksize, + struct stat.st_blocks, + struct stat.st_rdev +])) dnl Checks for types. AC_TYPE_UID_T diff --git a/ext/phar/func_interceptors.c b/ext/phar/func_interceptors.c index f1b2b0eba1e63..54afe2f5ae340 100644 --- a/ext/phar/func_interceptors.c +++ b/ext/phar/func_interceptors.c @@ -637,8 +637,10 @@ static void phar_file_stat(const char *filename, size_t filename_length, int typ if (data) { sb.st_ino = data->inode; } -#ifndef PHP_WIN32 +#ifdef HAVE_STRUCT_STAT_ST_BLKSIZE sb.st_blksize = -1; +#endif +#ifdef HAVE_STRUCT_STAT_ST_BLOCKS sb.st_blocks = -1; #endif phar_fancy_stat(&sb, type, return_value); diff --git a/ext/phar/stream.c b/ext/phar/stream.c index f5e1d9514c724..452ea34fa9f51 100644 --- a/ext/phar/stream.c +++ b/ext/phar/stream.c @@ -530,8 +530,10 @@ void phar_dostat(phar_archive_data *phar, phar_entry_info *data, php_stream_stat if (!is_temp_dir) { ssb->sb.st_ino = data->inode; } -#ifndef PHP_WIN32 +#ifdef HAVE_STRUCT_STAT_ST_BLKSIZE ssb->sb.st_blksize = -1; +#endif +#ifdef HAVE_STRUCT_STAT_ST_BLOCKS ssb->sb.st_blocks = -1; #endif } diff --git a/ext/zip/zip_stream.c b/ext/zip/zip_stream.c index a32324347d674..2fbfcac838bd2 100644 --- a/ext/zip/zip_stream.c +++ b/ext/zip/zip_stream.c @@ -184,8 +184,10 @@ static int php_zip_ops_stat(php_stream *stream, php_stream_statbuf *ssb) /* {{{ ssb->sb.st_ctime = sb.mtime; ssb->sb.st_nlink = 1; ssb->sb.st_rdev = -1; -#ifndef PHP_WIN32 +#ifdef HAVE_STRUCT_STAT_ST_BLKSIZE ssb->sb.st_blksize = -1; +#endif +#ifdef HAVE_STRUCT_STAT_ST_BLOCKS ssb->sb.st_blocks = -1; #endif ssb->sb.st_ino = -1; diff --git a/main/streams/memory.c b/main/streams/memory.c index ce11aec382bfe..4c5bf667aae4c 100644 --- a/main/streams/memory.c +++ b/main/streams/memory.c @@ -208,8 +208,10 @@ static int php_stream_memory_stat(php_stream *stream, php_stream_statbuf *ssb) / /* generate unique inode number for alias/filename, so no phars will conflict */ ssb->sb.st_ino = 0; -#ifndef PHP_WIN32 +#ifdef HAVE_STRUCT_STAT_ST_BLKSIZE ssb->sb.st_blksize = -1; +#endif +#ifdef HAVE_STRUCT_STAT_ST_BLOCKS ssb->sb.st_blocks = -1; #endif