raise() implementation in freebsd libc vs musl libc

Steve Kargl sgk at troutmask.apl.washington.edu
Thu Dec 13 06:05:07 UTC 2018


On Thu, Dec 13, 2018 at 12:11:21AM -0500, Andrew Kelley wrote:
> 
> I noticed that musl-libc blocks signals in raise() to prevent a race
> condition, but freebsd libc does not. is there a reason it's necessary
> on linux and not freebsd?
> 
> 	if (__sys_thr_self(&id) == -1)
> 		return (-1);
> 	return (__sys_thr_kill(id, s));

The answer probably lies in the meaining of '_thr_' in the
above function names.  See src/sys/kern/kern_thr.c.

-- 
Steve


More information about the freebsd-hackers mailing list