On Thu, 27 Jan 2022 at 22:46, Warner Losh <[email protected]> wrote: > > > > > On Jan 24, 2022, at 6:29 PM, Warner Losh <[email protected]> wrote: > > > > Implement the meat of the sigaction(2) system call with do_sigaction and > > helper routiner block_signals (which is also used to implemement signal > > masking so it's global). > > > > Signed-off-by: Stacey Son <[email protected]> > > Signed-off-by: Kyle Evans <[email protected]> > > Signed-off-by: Warner Losh <[email protected]> > > > > Pending Comments from Peter Maydell <[email protected]> > > > > (1) in block_signals, sigprocmast > > For linux-user we rely on sigprocmask() in a multithreaded > > program setting the signal mask for only the calling thread, > > which isn't POSIX-mandated. (Arguably we should use > > pthread_sigmask() instead, but we don't for basically > > historical reasons since linux-user is host-OS-specific anyway.) > > Does BSD have the same "this changes this thread's signal mask" > > semantics for sigprocmask()? > > FreeBSD changes this on a per-thread basis for both > sigprocmask and pthread_sigmask(). pthread_sigmask() just > does some extra stuff with SIGCANCEL for pthread_cancel > support which qemu doesn’t use. They are the same. I’m inclined > to leave it as sigprocmask() since I’m unsure what the implications > of doing funky things for SIGCANCEL would be.
Yes, that sounds like the right thing. thanks -- PMM
