}
}
+static inline void timespec2msec(const struct timespec *timespec, long *msec)
+{
+ *msec = 0;
+
+ /* We convert first the seconds checking for a possible overflow */
+ if (timespec->tv_sec < 2147482)
+ {
+ *msec = timespec->tv_sec*1000;
+ }
+ else
+ {
+ *msec = -1;
+ return;
+ }
+
+ /* Now we add the contribution from the msecs with a truncation */
+ *msec += (timespec->tv_nsec/1000000);
+
+}
+
//------------------------//
// timespec_lessthan_msec //
//------------------------//