Skip to content

fix(v4): add missing sys/resource.h header for getrusage - #834

Closed
QQSHI13 wants to merge 1 commit into
JustVugg:devfrom
QQSHI13:fix/v4-sys-resource-header
Closed

fix(v4): add missing sys/resource.h header for getrusage#834
QQSHI13 wants to merge 1 commit into
JustVugg:devfrom
QQSHI13:fix/v4-sys-resource-header

Conversation

@QQSHI13

@QQSHI13 QQSHI13 commented Aug 5, 2026

Copy link
Copy Markdown
Contributor

Fixes a compilation break on Linux/WSL platforms where struct rusage and getrusage storage layouts are unrecognized.

@JustVugg

JustVugg commented Aug 5, 2026

Copy link
Copy Markdown
Owner

You found this independently and you were right — thank you.

It is already on dev, and only by a few hours. When #165 landed I hit the same failure and folded the include into the merge commit rather than landing a broken tree, so the fix went in without its own PR:

#if defined(__APPLE__) || defined(__linux__) || defined(__FreeBSD__)
#include <sys/resource.h>   /* getrusage/RUSAGE_SELF for v4_serve_rss_gb;
                             * on Windows compat.h supplies the shim. */
#endif

The guard is there because Windows has no <sys/resource.h>compat.h provides getrusage via GetProcessMemoryInfo. That is also why the failure was Linux-only and one of fourteen checks went red while the rest stayed green.

Closing as already fixed, not as wrong. Two people finding the same missing header on the same day is a good sign for the project, and the next one you find will very likely not already be in flight.

Separately, and unrelated to the code: thank you for what you wrote on #814. That reporter came back, retested, and confirmed the model reasons correctly — which would not have happened if he had been argued out of the thread first.

@JustVugg JustVugg closed this Aug 5, 2026
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.

2 participants