From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.org/gmane.linux.lib.musl.general/11066 Path: news.gmane.org!.POSTED!not-for-mail From: Rich Felker Newsgroups: gmane.linux.lib.musl.general Subject: Re: No definition of PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP in musl Date: Mon, 20 Feb 2017 12:03:54 -0500 Message-ID: <20170220170354.GS1520@brightrain.aerifal.cx> References: <20170220162419.dxpcdbp23up3iopr@voyager> Reply-To: musl@lists.openwall.com NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: blaine.gmane.org 1487610251 10527 195.159.176.226 (20 Feb 2017 17:04:11 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Mon, 20 Feb 2017 17:04:11 +0000 (UTC) User-Agent: Mutt/1.5.21 (2010-09-15) To: musl@lists.openwall.com Original-X-From: musl-return-11081-gllmg-musl=m.gmane.org@lists.openwall.com Mon Feb 20 18:04:06 2017 Return-path: Envelope-to: gllmg-musl@m.gmane.org Original-Received: from mother.openwall.net ([195.42.179.200]) by blaine.gmane.org with smtp (Exim 4.84_2) (envelope-from ) id 1cfrNd-0002H5-V2 for gllmg-musl@m.gmane.org; Mon, 20 Feb 2017 18:04:06 +0100 Original-Received: (qmail 30002 invoked by uid 550); 20 Feb 2017 17:04:10 -0000 Mailing-List: contact musl-help@lists.openwall.com; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-ID: Original-Received: (qmail 29984 invoked from network); 20 Feb 2017 17:04:09 -0000 Content-Disposition: inline In-Reply-To: <20170220162419.dxpcdbp23up3iopr@voyager> Original-Sender: Rich Felker Xref: news.gmane.org gmane.linux.lib.musl.general:11066 Archived-At: On Mon, Feb 20, 2017 at 05:24:19PM +0100, Markus Wichmann wrote: > On Mon, Feb 20, 2017 at 03:22:41PM +0000, Raphael Cohn wrote: > > Hi, > > > > Whilst trying to compile ReOpenLDAP (https://github.com/ReOpen/ReOpenLDAP), > > a fork of OpenLDAP, I'm running into a wall. Some of the code wants a > > definition of PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP. musl doesn't define > > this; I suspect this is a non-portable glibc extension in pthread.h. Does > > any one have any ideas how I might workaround this? Is there an alternative > > construction that the code could use? > > > > Well, not directly. > > [...] > > Alternatively, you could look up the effects the above snippet has on > the mutex under musl, at least at the moment, and declare the > nonportable initializer yourself. At the moment, I think it would be > > #define PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP {{PTHREAD_MUTEX_RECURSIVE}} This is a very bad idea, and _will_ break when (not if, when) we change the layout. It's made opaque for a good reason. Rich