Skip to content

Fixed GH-8048: Force macOS to use statfs. #8056

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from
Closed

Conversation

risner
Copy link
Contributor

@risner risner commented Feb 7, 2022

A macOS bug in libc statvfs(3) call truncates 64 bit elements (e.g. f_blocks) to 32 bits.

Tested in [email protected], but it is a clean patch against the current.

t.php:
echo "Total: " . disk_total_space("/Volumes/Data/H1/tank"), PHP_EOL;
echo "Free: " . disk_free_space("/Volumes/Data/H1/tank"), PHP_EOL;

Test results:
mbpm1# df -k/Volumes/Data/H1/tank
Filesystem 1024-blocks Used Available Capacity iused ifree %iused Mounted on
h1:/tank 30259027086 21624936060 8634091026 72% 218 17268182053 0% /System/Volumes/Data/H1/tank

mbpm1# php t.php
Total: 30985243736576
Free: 8841309211136

30985243736576 ~ 302590270861024 off by 512.
8841309211136 ~ 86340910261024 also off by 512.

A macOS bug in libc statvfs(3) call truncates 64 bit elements (e.g. f_blocks) to 32 bits.
@risner
Copy link
Contributor Author

risner commented Feb 11, 2022

@devnexen
This correctly formatted?
Do you need any thing else?

@devnexen
Copy link
Member

devnexen commented Feb 11, 2022

looks fine by me but someone else will look into this and merge eventually in due time. What you can do eventually is referring the bug you re fixing. updating the PR title with Fixed GH-bug id : ...

@risner risner changed the title Force macOS to use statfs. Fixed GH-8048: Force macOS to use statfs. Feb 11, 2022
@risner
Copy link
Contributor Author

risner commented Mar 4, 2022

looks fine by me but someone else will look into this and merge eventually in due time.

I noticed RC1's landed a couple days ago, but this didn't get picked up? Is there something I did wrong in tagging it? Or will it get picked up for RC2?

@devnexen
Copy link
Member

devnexen commented Mar 4, 2022

you did nothing wrong, but there is lot going on more issues more pressured to fix. @cmb69 when you can.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

disk_*_space uses statvfs on macOS and it returns inaccurate results for some filesystems
2 participants