pcp
[Top] [All Lists]

pcp-3.5.5 build failure with glibc-2.3 (RHEL4) in the logger PMDA

To: pcp <pcp@xxxxxxxxxxx>
Subject: pcp-3.5.5 build failure with glibc-2.3 (RHEL4) in the logger PMDA
From: Mark Goodwin <mgoodwin@xxxxxxxxxx>
Date: Tue, 19 Jul 2011 16:41:15 +1000
User-agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.18) Gecko/20110621 Fedora/3.1.11-1.fc14 Thunderbird/3.1.11
sys/queue.h in glibc-2.3 doesn't define TAILQ_FIRST and friends,
which are used by the new logger PMDA. The hacky patch below fixes
it, but I'm wondering if the logger PMDA is even needed by anyone
on RHEL4 (and other distros using glibc-2.3)? Any preference?

--

diff --git a/src/pmdas/logger/event.h b/src/pmdas/logger/event.h
index 29e219a..5f86113 100644
--- a/src/pmdas/logger/event.h
+++ b/src/pmdas/logger/event.h
@@ -26,6 +26,21 @@
 #include "pmda.h"
 #include <sys/queue.h>

+#ifndef TAILQ_FIRST
+/*
+ * Tail queue access methods.
+ */
+#define TAILQ_EMPTY(head)               ((head)->tqh_first == NULL)
+#define TAILQ_FIRST(head)               ((head)->tqh_first)
+#define TAILQ_NEXT(elm, field)          ((elm)->field.tqe_next)
+
+#define TAILQ_LAST(head, headname) \
+        (*(((struct headname *)((head)->tqh_last))->tqh_last))
+#define TAILQ_PREV(elm, headname, field) \
+        (*(((struct headname *)((elm)->field.tqe_prev))->tqh_last))
+#endif
+
+
 struct event {
     TAILQ_ENTRY(event) events;
     int                        clients;

<Prev in Thread] Current Thread [Next in Thread>