[<prev] [next>] [day] [month] [year] [list]
Message-ID: <20240119151211.3193876-1-thomas.devoogdt@barco.com>
Date: Fri, 19 Jan 2024 16:12:11 +0100
From: Thomas Devoogdt <thomas@...oogdt.com>
To: netdev@...r.kernel.org
Cc: Thomas Devoogdt <thomas.devoogdt@...co.com>
Subject: [PATCH iproute2 v1] tc: {m_gate,q_etf,q_taprio}.c: fix compilation with older glibc versions
glibc < 2.14 does not define CLOCK_BOOTTIME
glibc < 2.21 does not define CLOCK_TAI
Signed-off-by: Thomas Devoogdt <thomas.devoogdt@...co.com>
---
tc/m_gate.c | 4 ++++
tc/q_etf.c | 4 ++++
tc/q_taprio.c | 4 ++++
3 files changed, 12 insertions(+)
diff --git a/tc/m_gate.c b/tc/m_gate.c
index c091ae19..1dacd4b3 100644
--- a/tc/m_gate.c
+++ b/tc/m_gate.c
@@ -26,8 +26,12 @@ static const struct clockid_table {
clockid_t clockid;
} clockt_map[] = {
{ "REALTIME", CLOCK_REALTIME },
+#ifdef CLOCK_TAI
{ "TAI", CLOCK_TAI },
+#endif
+#ifdef CLOCK_BOOTTIME
{ "BOOTTIME", CLOCK_BOOTTIME },
+#endif
{ "MONOTONIC", CLOCK_MONOTONIC },
{ NULL }
};
diff --git a/tc/q_etf.c b/tc/q_etf.c
index 572e2bc8..041d72ce 100644
--- a/tc/q_etf.c
+++ b/tc/q_etf.c
@@ -25,8 +25,12 @@ static const struct static_clockid {
clockid_t clockid;
} clockids_sysv[] = {
{ "REALTIME", CLOCK_REALTIME },
+#ifdef CLOCK_TAI
{ "TAI", CLOCK_TAI },
+#endif
+#ifdef CLOCK_BOOTTIME
{ "BOOTTIME", CLOCK_BOOTTIME },
+#endif
{ "MONOTONIC", CLOCK_MONOTONIC },
{ NULL }
};
diff --git a/tc/q_taprio.c b/tc/q_taprio.c
index ef8fc7a0..c82bede1 100644
--- a/tc/q_taprio.c
+++ b/tc/q_taprio.c
@@ -35,8 +35,12 @@ static const struct static_clockid {
clockid_t clockid;
} clockids_sysv[] = {
{ "REALTIME", CLOCK_REALTIME },
+#ifdef CLOCK_TAI
{ "TAI", CLOCK_TAI },
+#endif
+#ifdef CLOCK_BOOTTIME
{ "BOOTTIME", CLOCK_BOOTTIME },
+#endif
{ "MONOTONIC", CLOCK_MONOTONIC },
{ NULL }
};
--
2.43.0
Powered by blists - more mailing lists