#define CLOCK_TAI 11
#endif
+#ifndef CLOCK_AUX
+#define CLOCK_AUX 16
+#endif
+
+#define CLOCK_AUX0 (CLOCK_AUX + 0)
+#define CLOCK_AUX1 (CLOCK_AUX + 1)
+#define CLOCK_AUX2 (CLOCK_AUX + 2)
+#define CLOCK_AUX3 (CLOCK_AUX + 3)
+#define CLOCK_AUX4 (CLOCK_AUX + 4)
+#define CLOCK_AUX5 (CLOCK_AUX + 5)
+#define CLOCK_AUX6 (CLOCK_AUX + 6)
+#define CLOCK_AUX7 (CLOCK_AUX + 7)
+
+static inline bool is_aux_clock(clockid_t clockid)
+{
+ return clockid >= CLOCK_AUX0 && clockid <= CLOCK_AUX7;
+}
+
enum CLOCK_TYPE {
CT_SYS,
+ CT_AUX,
CT_PTP,
CT_CPU,
CT_RTC,
switch (type) {
case CT_SYS:
return "sys";
+ case CT_AUX:
+ return "aux";
case CT_PTP:
return "ptp";
case CT_CPU:
{ CT_SYS, CLOCK_REALTIME_ALARM, "CLOCK_REALTIME_ALARM", "realtime-alarm" },
{ CT_SYS, CLOCK_BOOTTIME_ALARM, "CLOCK_BOOTTIME_ALARM", "boottime-alarm" },
{ CT_SYS, CLOCK_TAI, "CLOCK_TAI", "tai" },
+ { CT_AUX, CLOCK_AUX0, "CLOCK_AUX0", "auxiliary-0" },
+ { CT_AUX, CLOCK_AUX1, "CLOCK_AUX1", "auxiliary-1" },
+ { CT_AUX, CLOCK_AUX2, "CLOCK_AUX2", "auxiliary-2" },
+ { CT_AUX, CLOCK_AUX3, "CLOCK_AUX3", "auxiliary-3" },
+ { CT_AUX, CLOCK_AUX4, "CLOCK_AUX4", "auxiliary-4" },
+ { CT_AUX, CLOCK_AUX5, "CLOCK_AUX5", "auxiliary-5" },
+ { CT_AUX, CLOCK_AUX6, "CLOCK_AUX6", "auxiliary-6" },
+ { CT_AUX, CLOCK_AUX7, "CLOCK_AUX7", "auxiliary-7" },
};
/* column IDs */
int rc;
rc = clock_gettime(clockinfo->id, &now);
- if (rc)
+ if (rc) {
+ if (is_aux_clock(clockinfo->id) && errno == EINVAL)
+ return; /* auxclocks are not supported */
+
now.tv_nsec = -1;
+ }
rc = clock_getres(clockinfo->id, &resolution);
if (rc)