NetBSD-Users archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: copyparty ignores signals (inc. SIGINT)



On Sat, 13 Dec 2025 00:56:39 +0000 (UTC)
RVP <rvp%SDF.ORG@localhost> wrote:

> Hmm. In FreeBSD, OpenBSD & Linux, pthread_sigmask(3) seems to apply per-thread,
> but on NetBSD, the whole process gets blocked--not just the thread which called
> pthread_sigmask():


I think your example may not be portable, you should really block those
signals in main() since SIGINT is an asynchronous signal and can be
delivered to any random thread which is not blocking it. If first
blocked in main() all child threads created later will inherit the same
signal mask with the blocked signal.

On NetBSD it looks like SIGINT is delivered to sig_thread() while on
other platforms it is delivered to main() which then terminates entire
process.

This is different with synchronous signals like SIGSEGV which are
delivered to a specific thread that caused it.


Home | Main Index | Thread Index | Old Index