Add support for musl libc
musl does not support pthread_rwlockattr_setkind_np. Don't use it if it is
not available.
diff --git a/src/session_server.c b/src/session_server.c
index f2a6838..9de4052 100644
--- a/src/session_server.c
+++ b/src/session_server.c
@@ -588,6 +588,7 @@
errno=0;
if (pthread_rwlockattr_init(&attr) == 0) {
+#if defined(HAVE_PTHREAD_RWLOCKATTR_SETKIND_NP)
if (pthread_rwlockattr_setkind_np(&attr, PTHREAD_RWLOCK_PREFER_WRITER_NONRECURSIVE_NP) == 0) {
if (pthread_rwlock_init(&server_opts.endpt_lock, &attr) != 0) {
ERR("%s: failed to init rwlock(%s).", __FUNCTION__, strerror(errno));
@@ -598,6 +599,7 @@
} else {
ERR("%s: failed set attribute (%s).", __FUNCTION__, strerror(errno));
}
+#endif
pthread_rwlockattr_destroy(&attr);
} else {
ERR("%s: failed init attribute (%s).", __FUNCTION__, strerror(errno));