Issue #22117: The signal modules uses the new _PyTime_t API

* Add _PyTime_AsTimespec()
* Add unit tests for _PyTime_AsTimespec()
diff --git a/Include/pytime.h b/Include/pytime.h
index 1648d03..17d5ea1 100644
--- a/Include/pytime.h
+++ b/Include/pytime.h
@@ -145,6 +145,12 @@
     struct timeval *tv,
     _PyTime_round_t round);
 
+#ifdef HAVE_CLOCK_GETTIME
+/* Convert a timestamp to a timespec structure (nanosecond resolution).
+   Raise an exception and return -1 on error, return 0 on success. */
+PyAPI_FUNC(int) _PyTime_AsTimespec(_PyTime_t t, struct timespec *ts);
+#endif
+
 /* Get the current time from the system clock.
  * Fill clock information if info is not NULL.
  * Raise an exception and return -1 on error, return 0 on success.