+#if defined(can_gettimeofday) && defined(CAN_MSG_VERSION_2) && 1
+static inline
+void can_filltimestamp(canmsg_tstamp_t *ptimestamp)
+{
+ can_gettimeofday(ptimestamp);
+}
+#else /* No timestamp support, set field to zero */
+static inline
+void can_filltimestamp(canmsg_tstamp_t *ptimestamp)
+{
+ #ifdef CAN_MSG_VERSION_2
+ ptimestamp->tv_sec = 0;
+ ptimestamp->tv_usec = 0;
+ #else /* CAN_MSG_VERSION_2 */
+ *ptimestamp = 0;
+ #endif /* CAN_MSG_VERSION_2 */
+
+}
+#endif /* End of timestamp source selection */
+