Skip to content

Commit 2384c23

Browse files
committed
Merge branch 'PHP-8.1'
* PHP-8.1: Fix GH-8048: disk_*_space wrong for some filesystems on macOS
2 parents 6744009 + 81048b9 commit 2384c23

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

ext/standard/filestat.c

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,16 @@
4242
# include <os2.h>
4343
#endif
4444

45+
#if defined(__APPLE__)
46+
/*
47+
Apple statvfs has an interger overflow in libc copying to statvfs.
48+
cvt_statfs_to_statvfs(struct statfs *from, struct statvfs *to) {
49+
to->f_blocks = (fsblkcnt_t)from->f_blocks;
50+
*/
51+
# undef HAVE_SYS_STATVFS_H
52+
# undef HAVE_STATVFS
53+
#endif
54+
4555
#if defined(HAVE_SYS_STATVFS_H) && defined(HAVE_STATVFS)
4656
# include <sys/statvfs.h>
4757
#elif defined(HAVE_SYS_STATFS_H) && defined(HAVE_STATFS)

0 commit comments

Comments
 (0)