Re: [PATCH v3] pidfds: add coredump_code field to pidfd_info

From: Oleg Nesterov

Date: Mon Mar 23 2026 - 07:54:47 EST


On 03/22, Emanuele Rocca wrote:
>
> The struct pidfd_info currently exposes in a field called coredump_signal the
> signal number (si_signo) that triggered the dump (for example, 11 for SIGSEGV).
> However, it is also valuable to understand the reason why that signal was sent.
> This additional context is provided by the signal code (si_code), such as 2 for
> SEGV_ACCERR.
>
> Add a new field to struct pidfd_info called coredump_code with the value of
> si_code for the benefit of sysadmins who pipe core dumps to user-space programs
> for later analysis.

FWIW, the changes in pidfs.c and pidfd.h look good to me.

Acked-by: Oleg Nesterov <oleg@xxxxxxxxxx>