Index: share/man/man5/core.5 =================================================================== --- share/man/man5/core.5 +++ share/man/man5/core.5 @@ -82,6 +82,8 @@ process name. .It Em \&%P processes PID. +.It Em \&%S +signal during core. .It Em \&%U process UID. .El Index: sys/kern/kern_sig.c =================================================================== --- sys/kern/kern_sig.c +++ sys/kern/kern_sig.c @@ -3433,7 +3433,7 @@ */ static int corefile_open(const char *comm, uid_t uid, pid_t pid, struct thread *td, - int compress, struct vnode **vpp, char **namep) + int compress, int signum, struct vnode **vpp, char **namep) { struct sbuf sb; struct nameidata nd; @@ -3482,6 +3482,9 @@ case 'P': /* process id */ sbuf_printf(&sb, "%u", pid); break; + case 'S': /* signal number */ + sbuf_printf(&sb, "%i", signum); + break; case 'U': /* user id */ sbuf_printf(&sb, "%u", uid); break; @@ -3599,7 +3602,7 @@ PROC_UNLOCK(p); error = corefile_open(p->p_comm, cred->cr_uid, p->p_pid, td, - compress_user_cores, &vp, &name); + compress_user_cores, p->p_sig, &vp, &name); if (error != 0) return (error);