yushuailong opened a new pull request, #20104:
URL: https://github.com/apache/nuttx/pull/20104

   ## Summary
   
   Fix two waitid() bugs found during a code review of sched/sched:
   
   * Parent/child verification compared the child's tg_ppid against the calling 
thread's pid (rtcb->pid) instead of its group pid, so any non-leader thread 
waiting for a child of its own group always got ECHILD (sched_waitid.c x2; same 
bug also fixed in sched_waitpid.c).
   * waitid() documented WNOWAIT as supported but always discarded the child 
status entry, so WNOWAIT|WEXITED consumed the status and a subsequent real wait 
failed with ECHILD. Now the entry is kept when WNOWAIT is set, matching 
waitpid() behavior.
   
   Also includes two small one-line fixes in the same area: 
sched_setscheduler() now rejects a NULL param with -EINVAL instead of 
dereferencing it, and cpuload_oneshot.c uses USEC_PER_SEC instead of a 
hardcoded 100000.
   
   ## Impact
   
   bug fixes only
   
   ## Testing
   
      Host: macOS 26.6.2 ARM64, Apple Clang 21.0.0.
      Target: sim:ostest .
       Build: cmake + ninja complete successfully with "Linking C executable 
nuttx".
       Runtime: ran ./nuttx and executed ostest; all enabled OSTest subtests (5 
loops) completed without assertions or unexpected errors, exiting with status 0.
       Static checks: nxstyle, checkpatch, and commit-message checks pass.
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to