Repository navigation
Conversation
Only the default seed-source branch included it, so --enable-leanpsk (NO_DEV_RANDOM) called getpid() undeclared, which GCC 14 rejects.
|
@claude review |
There was a problem hiding this comment.
🟢 Approval recommended
No active review issues are reported for the lean PSK getpid() header fix and added regression configuration.
No open issues 🎉
What changed in this PR
Fixes an undeclared getpid() call in lean PSK builds by making its header available independently of the selected random seed source.
Changes:
- Includes
<unistd.h>whenHAVE_GETPIDis defined andWOLFSSL_NO_GETPIDis not. - Adds a lean PSK CI configuration that rejects implicit function declarations and runs the wolfCrypt self-test.
| File | Description |
|---|---|
wolfcrypt/src/random.c |
Adds a conditional <unistd.h> include for getpid(). |
.github/configs/os-check-linux.json |
Adds lean PSK regression coverage with targeted compiler flags. |
Review effort: Balanced
wolfSSL-Fenrir-bot
left a comment
There was a problem hiding this comment.
Fenrir Automated Review — PR #11918
Scan targets checked: wolfcrypt-src, wolfcrypt-bugs
Not reviewed (no scan target covers them): .github/configs/os-check-linux.json
Coverage: 1 of 1 in-scope changed file(s) opened by the reviewer
Fenrir result: Approved ✅
No new issues found in the changed files.
Advisory only — this automated result does not count as a GitHub approval.
Review tier: Lite
|
There was a problem hiding this comment.
LGTM. This is a small, correctly guarded include fix, and the new CI entry should catch it if it regresses.
What was reviewed:
- The new
<unistd.h>include inwolfcrypt/src/random.cuses the sameHAVE_GETPID && !WOLFSSL_NO_GETPIDguard as everygetpid()/pid_tuse in the file, so builds without getpid are unaffected. - Non-POSIX ports:
HAVE_GETPIDis set only when configure or CMake finds getpid (CMake probes it throughunistd.h, so MSVC never sets it), andsettings.hforcesWOLFSSL_NO_GETPIDfor its bare-metal profiles. - The
leanpskentry is valid JSON, uses keysparallel-make-check.pyaccepts, and itsextra_cflagsmatch the workflow's global set minus-pedantic/-Wno-overlength-strings.
Extended reasoning...
The change adds one guarded #include <unistd.h> to wolfcrypt/src/random.c and one new CI config entry in .github/configs/os-check-linux.json. It does not change any RNG, seeding or crypto logic. It only makes the existing getpid() calls declared under NO_DEV_RANDOM and other seed branches that never included unistd.h. The include's guard matches the guard on every getpid use, and HAVE_GETPID is only defined when the build system has found getpid, so non-POSIX targets are unaffected. No CODEOWNERS file covers these paths, and the PR has no outstanding reviewer objections.
Description
Only the default seed-source branch included unistd.h, so --enable-leanpsk (NO_DEV_RANDOM) called getpid() undeclared, which GCC 14 rejects.
Upstream repro:
./autogen.sh ./configure --enable-leanpsk EXTRA_CFLAGS="-Werror=implicit-function-declaration -Wno-error=cpp"Testing
Checklist