-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
fix(parse_size): Add cross-platform total_physical_memory implementat… #9653
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
base: main
Are you sure you want to change the base?
fix(parse_size): Add cross-platform total_physical_memory implementat… #9653
Conversation
401a9fe to
8fae6fc
Compare
|
GNU testsuite comparison: |
80fa255 to
34d1ef3
Compare
|
GNU testsuite comparison: |
34d1ef3 to
f57d398
Compare
|
GNU testsuite comparison: |
|
LGTM for FreeBSD and OpenBSD to get "Total physical memory" via |
sylvestre
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this patch has a lot of duplication, could you please have a look? thanks
f57d398 to
6c0f36a
Compare
|
GNU testsuite comparison: |
…ions - Implements total_physical_memory() for macOS (hw.memsize) - Implements total_physical_memory() for FreeBSD (hw.physmem) - Implements total_physical_memory() for OpenBSD (hw.physmem) - Implements total_physical_memory() for NetBSD (hw.physmem64) - Enables 'sort -S 50%' to work on all BSD-based platforms - Updates tests to include percentage buffer sizes for BSD platforms Fixes uutils#7257
6c0f36a to
67839ab
Compare
|
GNU testsuite comparison: |
Replace subprocess-based sysctl calls with native libc::sysctl() syscalls for macOS, FreeBSD, OpenBSD, and NetBSD to fix test_buffer_sizes failure in CI environments. The previous implementation spawned sysctl subprocesses which could fail in sandboxed GitHub Actions runners. The native approach is more reliable, performant, and includes subprocess fallback for robustness. Fixes percentage-based buffer size parsing (e.g., sort -S 10%)
67839ab to
e104905
Compare
|
GNU testsuite comparison: |
Implements
total_physical_memory()for macOS, FreeBSD, OpenBSD, and NetBSD using platform-specificsysctlcommands. Enablessort -S 50%to work on all BSD-based systems.Fixes #7257