mirror of
https://github.com/php/php-src.git
synced 2025-08-15 21:48:51 +02:00
Fix GH-8048: disk_*_space wrong for some filesystems on macOS
A macOS bug in libc statvfs(3) call truncates 64 bit elements (e.g. f_blocks) to 32 bits. Thus, we force macOS to use statfs. Closes GH-8056.
This commit is contained in:
parent
e6cf583160
commit
57ef16bb5d
2 changed files with 12 additions and 0 deletions
2
NEWS
2
NEWS
|
@ -2,6 +2,8 @@ PHP NEWS
|
|||
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||
?? ??? 2022, PHP 8.0.18
|
||||
|
||||
- Standard:
|
||||
. Fixed bug GH-8048 (Force macOS to use statfs). (risner)
|
||||
|
||||
17 Mar 2022, PHP 8.0.17
|
||||
|
||||
|
|
|
@ -42,6 +42,16 @@
|
|||
# include <os2.h>
|
||||
#endif
|
||||
|
||||
#if defined(__APPLE__)
|
||||
/*
|
||||
Apple statvfs has an interger overflow in libc copying to statvfs.
|
||||
cvt_statfs_to_statvfs(struct statfs *from, struct statvfs *to) {
|
||||
to->f_blocks = (fsblkcnt_t)from->f_blocks;
|
||||
*/
|
||||
# undef HAVE_SYS_STATVFS_H
|
||||
# undef HAVE_STATVFS
|
||||
#endif
|
||||
|
||||
#if defined(HAVE_SYS_STATVFS_H) && defined(HAVE_STATVFS)
|
||||
# include <sys/statvfs.h>
|
||||
#elif defined(HAVE_SYS_STATFS_H) && defined(HAVE_STATFS)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue