From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=-3.3 required=5.0 tests=MAILING_LIST_MULTI, RCVD_IN_DNSWL_MED,RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL, SUBJ_OBFU_PUNCT_FEW autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 13368 invoked from network); 7 Dec 2020 22:34:56 -0000 Received: from mother.openwall.net (195.42.179.200) by inbox.vuxu.org with ESMTPUTF8; 7 Dec 2020 22:34:56 -0000 Received: (qmail 32619 invoked by uid 550); 7 Dec 2020 22:34:49 -0000 Mailing-List: contact musl-help@lists.openwall.com; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-ID: Reply-To: musl@lists.openwall.com Received: (qmail 32595 invoked from network); 7 Dec 2020 22:34:48 -0000 Date: Mon, 7 Dec 2020 17:34:34 -0500 From: Rich Felker To: Bogdan Nistor Cc: "musl@lists.openwall.com" Message-ID: <20201207223433.GI534@brightrain.aerifal.cx> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) Subject: Re: [musl] pthread_mutexattr_getprotocol() issue On Mon, Dec 07, 2020 at 10:09:54AM +0000, Bogdan Nistor wrote: > Hi, > > While using MUSL C-library 1.1.22. we observed an issue with the pthread_mutexattr_getprotocol() implementation. The same implementation is in the latest version also. > When the priority inheritance mutexes were implemented, it seems that pthread_mutexattr_getprotocol() wasn't updated to return the proper mutex protocol type. > > The PI mutexes update was done in this commit: http://git.musl-libc.org/cgit/musl/commit/?id=54ca677983d47529bab8752315ac1a2b49888870 > > If possible, maybe the get protocol function can be updated in a future merge. > > In order to fix the get protocol function, we changed it to: > int pthread_mutexattr_getprotocol(const pthread_mutexattr_t *restrict a, int *restrict protocol) > { > if (a->__attr & 8) > *protocol = PTHREAD_PRIO_INHERIT; > else > *protocol = PTHREAD_PRIO_NONE; > return 0; > } Thanks. I'm doing it just by moving the bit around since that's how the other similar functions are implemented now. Expect the fix to be included in the next release, which should appear in the next couple days. Rich