[PATCH v2] Linux: Add missing si_code constants from Linux kernel

Carlos O'Donell carlos@redhat.com
Mon Sep 8 18:13:52 GMT 2025


On 9/3/25 10:26 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.
> 
> Suggested-by: Carlos O'Donell <carlos@redhat.com>

This passes pre-commit CI, which looks good to me.

Thanks, I re-tested on 64-bit and 32-bit and it looks clean to me too.

Thank you! Pushed.

Reviewed-by: Carlos O'Donell <carlos@redhat.com>
Tested-by: Carlos O'Donell <carlos@redhat.com>

> ---
> 
> Change in v2:
> - Surrounded enum of SIGSYS s_codes with #ifdef __USE_GNU, as suggested
>    by Carlos to fix the conform failures in signal.h and wait.h.
> 
>   sysdeps/unix/sysv/linux/bits/siginfo-consts.h | 16 +++++++++++++++-
>   1 file changed, 15 insertions(+), 1 deletion(-)
> 
> diff --git a/sysdeps/unix/sysv/linux/bits/siginfo-consts.h b/sysdeps/unix/sysv/linux/bits/siginfo-consts.h
> index fd38bb3147f7..4ce88aef304b 100644
> --- a/sysdeps/unix/sysv/linux/bits/siginfo-consts.h
> +++ b/sysdeps/unix/sysv/linux/bits/siginfo-consts.h
> @@ -168,8 +168,10 @@ enum
>   #  define TRAP_BRANCH	TRAP_BRANCH
>     TRAP_HWBKPT,			/* Hardware breakpoint/watchpoint.  */
>   #  define TRAP_HWBKPT	TRAP_HWBKPT
> -  TRAP_UNK			/* Undiagnosed trap.  */
> +  TRAP_UNK,			/* Undiagnosed trap.  */

OK.

>   #  define TRAP_UNK	TRAP_UNK
> +  TRAP_PERF			/* Perf event with sigtrap=1.  */
> +#  define TRAP_PERF	TRAP_PERF

OK. Looks good.

>   };
>   # endif
>   
> @@ -209,6 +211,18 @@ enum
>   };
>   # endif
>   
> +/* The Linux-specific SIGSYS values are all considered GNU extensions.  */
> +#ifdef __USE_GNU
> +/* `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
> +};
> +#endif

OK. Yes, both of these are present upstream in Linux.

> +
>   /* Architectures might also add architecture-specific constants.
>      These are all considered GNU extensions.  */
>   #ifdef __USE_GNU
> 


-- 
Cheers,
Carlos.



More information about the Libc-alpha mailing list