[PATCH] Linux: Add missing si_code constants from Linux kernel
Thiago Jung Bauermann
thiago.bauermann@linaro.org
Thu Sep 4 02:24:53 GMT 2025
Carlos O'Donell <carlos@redhat.com> writes:
> On 9/2/25 10:41 PM, Thiago Jung Bauermann wrote:
>> This brings the si_codes listed in siginfo-consts.h up-to-date with
>> Linux v6.16's include/uapi/asm-generic/siginfo.h.
>> Tested on aarch64-linux-gnu and x86_64-linux-gnu.
>
> Looking forward to v2.
>
> This fails pre-commit CI:
> https://patchwork.sourceware.org/project/glibc/patch/20250903024151.3030839-1-thiago.bauermann@linaro.org/
>
> The header conformance tests are failing.
Argh, sorry about that.
>> Suggested-by: Carlos O'Donell <carlos@redhat.com>
>> Signed-off-by: Thiago Jung Bauermann <thiago.bauermann@linaro.org>
>
> Please drop the SOB since Linaro has copyright assignment, unless your contract
> with Linaro ensure you retain copyright. If you retain your own copyright then
> you should keep SOB and adjust siginfo-consts.h with the generalized
> "Copyright The GNU Toolchain Authors."
>
> Please see:
> https://sourceware.org/glibc/wiki/Contribution%20checklist
Ah, ok. I wasn't aware they were mutually exclusive.
>> };
>> # endif
>> @@ -209,6 +211,15 @@ enum
>> };
>> # endif
>> +/* `si_code' values for SIGSYS signal. */
>> +enum
>> +{
>> + SYS_SECCOMP = 1, /* Seccomp triggered. */
>> +# define SYS_SECCOMP SYS_SECCOMP
>> + SYS_USER_DISPATCH /* Syscall user dispatch triggered. */
>> +# define SYS_USER_DISPATCH SYS_USER_DISPATCH
>> +};
>
> These are not OK since they pollute the global namespace and cause conformance
> test failures. No POSIX or ISO C standard defines them.
>
> The fix for these is to wrap them e.g.
>
> /* The Linux-specific SIGSYS values are all considered GNU extensions. */
> #ifdef __USE_GNU
> ...
> #endif
>
> That way they are only defined when extensions to the standard are requested.
>
> The same is already in effect for Linux-specific Architecture-specific signals.
Thank you for mentioning the fix. I'm sending a v2 with #ifdef __USE_GNU.
> Please make sure that the conform-* test pass with your change.
I actually ran make check before and after the patch, but somehow I
fumbled analysing the results. I probably misplaced a tests.sum file.
--
Thiago
More information about the Libc-alpha
mailing list