From owner-freebsd-hackers@freebsd.org Thu Dec 13 06:05:07 2018 Return-Path: Delivered-To: freebsd-hackers@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 819D0130AB12 for ; Thu, 13 Dec 2018 06:05:07 +0000 (UTC) (envelope-from sgk@troutmask.apl.washington.edu) Received: from troutmask.apl.washington.edu (troutmask.apl.washington.edu [128.95.76.21]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "troutmask", Issuer "troutmask" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 7BCF06F941 for ; Thu, 13 Dec 2018 06:05:06 +0000 (UTC) (envelope-from sgk@troutmask.apl.washington.edu) Received: from troutmask.apl.washington.edu (localhost [127.0.0.1]) by troutmask.apl.washington.edu (8.15.2/8.15.2) with ESMTPS id wBD654Mv043728 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NO); Wed, 12 Dec 2018 22:05:04 -0800 (PST) (envelope-from sgk@troutmask.apl.washington.edu) Received: (from sgk@localhost) by troutmask.apl.washington.edu (8.15.2/8.15.2/Submit) id wBD654lE043727; Wed, 12 Dec 2018 22:05:04 -0800 (PST) (envelope-from sgk) Date: Wed, 12 Dec 2018 22:05:04 -0800 From: Steve Kargl To: Andrew Kelley Cc: freebsd-hackers@freebsd.org Subject: Re: raise() implementation in freebsd libc vs musl libc Message-ID: <20181213060504.GA43628@troutmask.apl.washington.edu> Reply-To: sgk@troutmask.apl.washington.edu References: <70c7214e-3619-115d-abca-09853a1729a6@ziglang.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <70c7214e-3619-115d-abca-09853a1729a6@ziglang.org> User-Agent: Mutt/1.10.1 (2018-07-13) X-Rspamd-Queue-Id: 7BCF06F941 X-Spamd-Bar: ++ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [2.55 / 15.00]; ARC_NA(0.00)[]; HAS_REPLYTO(0.00)[sgk@troutmask.apl.washington.edu]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; NEURAL_SPAM_SHORT(0.76)[0.764,0]; MIME_GOOD(-0.10)[text/plain]; RCVD_TLS_LAST(0.00)[]; DMARC_NA(0.00)[washington.edu]; AUTH_NA(1.00)[]; REPLYTO_ADDR_EQ_FROM(0.00)[]; RCVD_COUNT_THREE(0.00)[3]; TO_MATCH_ENVRCPT_SOME(0.00)[]; RCVD_IN_DNSWL_MED(-0.20)[21.76.95.128.list.dnswl.org : 127.0.11.2]; RCPT_COUNT_TWO(0.00)[2]; MX_GOOD(-0.01)[troutmask.apl.washington.edu]; NEURAL_SPAM_MEDIUM(0.92)[0.915,0]; R_SPF_NA(0.00)[]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; MIME_TRACE(0.00)[0:+]; ASN(0.00)[asn:73, ipnet:128.95.0.0/16, country:US]; MID_RHS_MATCH_FROM(0.00)[]; IP_SCORE(0.18)[ip: (0.80), ipnet: 128.95.0.0/16(0.09), asn: 73(0.11), country: US(-0.09)] X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 13 Dec 2018 06:05:07 -0000 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