Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: misleading message for SIGFPE



On 2024-09-24 13:03:27 -0700, Bart Schaefer wrote:
> On Tue, Sep 24, 2024 at 11:05 AM Bart Schaefer
> <schaefer@xxxxxxxxxxxxxxxx> wrote:
> >
> > I'm not very familiar with
> > usage of siginfo or whether the parent process is able to obtain it
> 
> Looks as if this is possible (man 5 siginfo).  It appears we'd have to
> switch to using waitid(2) for child reaping.

I don't think that it brings anything useful. You'll get the si_code
of the parent (i.e. corresponding to SIGCHLD)[*], not the one that
corresponds to the SIGFPE for the child.

[*] So, as the waitid(2) man page says:

  si_code
    Set  to  one  of:  CLD_EXITED (child called _exit(2)); CLD_KILLED
    (child killed by signal); CLD_DUMPED (child killed by signal, and
    dumped core); CLD_STOPPED (child stopped by signal);  CLD_TRAPPED
    (traced  child has trapped); or CLD_CONTINUED (child continued by
    SIGCONT).

-- 
Vincent Lefèvre <vincent@xxxxxxxxxx> - Web: <https://www.vinc17.net/>
100% accessible validated (X)HTML - Blog: <https://www.vinc17.net/blog/>
Work: CR INRIA - computer arithmetic / AriC project (LIP, ENS-Lyon)




Messages sorted by: Reverse Date, Date, Thread, Author