Skip to contentSkip to conversation

tc: {m_gate,q_etf,q_taprio}.c: fix compilation with older glibc versions

PATCH New Thomas Devoogdt 1 participant 1 message Jan 19, 2024

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 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

---
 tc/m_gate.c   | 4 ++++
 tc/q_etf.c    | 4 ++++
 tc/q_taprio.c | 4 ++++
 3 files changed, 12 insertions(+)
tc/m_gate.c +4 -0
index c091ae19..1dacd4b3 100644
@@ -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 }
 };
tc/q_etf.c +4 -0
index 572e2bc8..041d72ce 100644
@@ -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 }
 };
tc/q_taprio.c +4 -0
index ef8fc7a0..c82bede1 100644
@@ -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 }
 };
Signature · 1 line
2.43.0