Skip to content
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

Switch to u64 from usize in many places #147

Merged
merged 1 commit into from Oct 2, 2021
Merged

Conversation

h33p
Copy link
Contributor

@h33p h33p commented Sep 19, 2021

Apologies for such a long delay, work got in the way.

I've implemented the base changes needed to fix #141. Both diskstats and stat were changed to use u64. I've noticed my NAS having diskstat numbers in the tens of billions so I thought the change there was appropriate. Some places I'm still not sure what to do about:

sys/vm admin_reserve_kbytes was kept as usize, as it would not make much sense to reserve billions of kilobytes.
sys/fs file_max was kept as usize, since I am not sure where would billions of files be opened.

However, both of these are rather arbitrary, and could be changed to u64. If you'd like that I'll be glad to make the change.

In the end, procfs now works just fine as a 32-bit executable on 64-bit machines.

This should allow 32-bit executables to function on 64-bit hosts.
@eminence
Copy link
Owner

eminence commented Oct 2, 2021

Thanks for this PR, these changes look good to me. I'm OK keeping admin_reserve_kbytes and file_max as they are. If anyone does run into that 32-bit limit, hopefully they'll open an issue :)

@eminence eminence merged commit 497fb8b into eminence:master Oct 2, 2021
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.

Does not work when running as 32-bit process on 64-bit machines
2 participants