Re: Add errdetail() with PID and UID about source of termination signal - Mailing list pgsql-hackers

From Andres Freund
Subject Re: Add errdetail() with PID and UID about source of termination signal
Date
Msg-id 3n7vxxydqfu4g2hr2lcvzriv5drekvayxrmfhtvjrdovmasp6w@u5lfxbs6f72p
Whole thread
In response to Re: Add errdetail() with PID and UID about source of termination signal  (Chao Li <li.evan.chao@gmail.com>)
Responses Re: Add errdetail() with PID and UID about source of termination signal
List pgsql-hackers
Hi,

On 2026-04-09 14:14:23 +0800, Chao Li wrote:
> > For uid, 0 is usually a valid value for root. So using 0 as the “unknown” value seems a bit awkward. Maybe we
shouldinstead document something like "uid is only meaningful when pid is not 0".
 
> > 
> 
> Forgot to mention, I got a lot of compile warnings, for example:
> ```
> parallel.c:1052:20: warning: cast from 'void (*)(int)' to 'pqsigfunc' (aka 'void (*)(int, struct pg_signal_info *)')
convertsto incompatible function type [-Wcast-function-type-mismatch]
 
>  1052 |         pqsignal(SIGPIPE, PG_SIG_IGN);
>       |                           ^~~~~~~~~~
> ../../../src/include/port.h:551:20: note: expanded from macro 'PG_SIG_IGN'
>   551 | #define PG_SIG_IGN (pqsigfunc) SIG_IGN
>       |                    ^~~~~~~~~~~~~~~~~~~
> 4 warnings generated.
> ```

That's an annoying warning, GAH. Can't imagine this is the only thing it
complains about. Yes, compiler, I put a cast there, because I did actually
want to cast, thanks.

I guess we'll have to define PG_SIG_IGN to 1 and PG_SIG_DFL to 0 ourselves.

Greetings,

Andres Freund



pgsql-hackers by date:

Previous
From: Andres Freund
Date:
Subject: Re: s/pg_attribute_always_inline/pg_always_inline/?
Next
From: Nathan Bossart
Date:
Subject: Re: pgstat vs aset