Bug 1792539

Summary: Missing autoconf check for non-portable mutex types
Product: [Community] GlusterFS Reporter: Jason High <json.high>
Component: buildAssignee: bugs <bugs>
Status: CLOSED UPSTREAM QA Contact:
Severity: low Docs Contact:
Priority: low    
Version: mainlineCC: bugs, hgowtham, pasik
Target Milestone: ---Keywords: Triaged
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2020-03-12 14:49:57 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Jason High 2020-01-17 21:32:17 UTC
Description of problem:

Fails to compile due to non-portable mutex types in rpcsvc.c.  Could we please add a autoconf check for non-portable mutex types?

Version-Release number of selected component (if applicable):
7.1

How reproducible:
Easy

Steps to Reproduce:
1.Try to compile on system without PTHREAD_MUTEX_ADAPTIVE_NP mutex type
2.
3.

Actual results:
Fails to compile - unknown type PTHREAD_MUTEX_ADAPTIVE_NP type in rpcsvc.c

Expected results:
Check for non-portable types

Additional info:

Check should be easy.  Something like

AC_MSG_CHECKING([for PTHREAD_MUTEX_ADAPTIVE_NP])
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
#define _GNU_SOURCE
#include <pthread.h>
]], [[
  return (PTHREAD_MUTEX_ADAPTIVE_NP);
]])], [
AC_MSG_RESULT([yes])
AC_DEFINE([HAVE_PTHREAD_MUTEX_ADAPTIVE_NP], 1,
          [Define to 1 if system has the `PTHREAD_MUTEX_ADAPTIVE_NP'.])
], [
AC_MSG_RESULT([no])
])

Comment 1 hari gowtham 2020-02-12 06:51:01 UTC
Hi Jason,

As you already know the solution, can you send out the fix as a patch so we can review and take it up?
I'm assigning this bug to you. If you couldn't look into it, feel free to take out your name from the assignee.

Regards,
Hari.

Comment 2 Jason High 2020-02-19 08:52:55 UTC
patch submitted via gerrit

Comment 3 Worker Ant 2020-02-19 11:25:53 UTC
REVIEW: https://review.gluster.org/24135 (check for non-portable mutex type) posted (#4) for review on master by None

Comment 4 Jason High 2020-02-19 13:58:09 UTC
working/tested patch tested on debian and NetBSD.  Added bz#, change-id, and updated version in hopes of clearing up some of the automated jenkins test issues

Comment 5 Worker Ant 2020-03-12 14:49:57 UTC
This bug is moved to https://github.com/gluster/glusterfs/issues/1074, and will be tracked there from now on. Visit GitHub issues URL for further details