Skip to content

Commit 81048b9

Browse files
committed
Merge branch 'PHP-8.0' into PHP-8.1
* PHP-8.0: Fix GH-8048: disk_*_space wrong for some filesystems on macOS
2 parents 925a309 + 57ef16b commit 81048b9

File tree

2 files changed

+13
-0
lines changed

2 files changed

+13
-0
lines changed

NEWS

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,9 @@ PHP NEWS
66
. Fixed bug GH-8115 (Can't catch arg type deprecation when instantiating Intl
77
classes). (ilutov)
88

9+
- Standard:
10+
. Fixed bug GH-8048 (Force macOS to use statfs). (risner)
11+
912
17 Mar 2022, PHP 8.1.4
1013

1114
- Core:

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)