Created attachment 184480 [details] syscall-wrapper waitid handles infop=null correctly The syscall wrapper for waitid on linux warns about infop being null. This differs to the linux-kernel. it is e.g. used by Qt: https://github.com/qt/qtbase/blob/e17798560b107b7abd5f2cf472d942e8ac4213ff/src/3rdparty/forkfd/forkfd_linux.c#L128 reports can be found in multiple locations e.g. https://lists.lyx.org/pipermail/lyx-devel/2024-June/012624.html The attached patch is based on top of the one from https://bugs.kde.org/show_bug.cgi?id=508777
I was sceptical this was correct. But it is really a (non-portable) linux kernel extension for waitid: According to POSIX.1-2008, an application calling waitid() must ensure that infop points to a siginfo_t structure (i.e., that it is a non-null pointer). On Linux, if infop is NULL, waitid() succeeds, and returns the process ID of the waited-for child. Applications should avoid rely‐ ing on this inconsistent, nonstandard, and unnecessary feature. Thanks for the testcase.
Created attachment 184537 [details] syscall-wrapper waitid handles infop=null correctly (V2) Updated the patch to be applied after https://bugs.kde.org/show_bug.cgi?id=508777 and https://bugs.kde.org/show_bug.cgi?id=508869
commit 405fb0daaf329068a5219ef4c0e645cea872cf75 (HEAD -> master, origin/master, origin/HEAD) Author: Matthias Schwarzott <zzam@gentoo.org> Date: Sat Aug 23 13:37:46 2025 +0200 Bug 508778 - syscall-wrapper waitid warns about infop=null This is used by e.g. Qt: https://github.com/qt/qtbase/blob/e17798560b107b7abd5f2cf472d942e8ac4213ff/src/3rdparty/forkfd/forkfd_linux.c#L128