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

* Add _PyTime_AsTimespec()
* Add unit tests for _PyTime_AsTimespec()
This commit is contained in:
Victor Stinner 2015-03-27 18:19:03 +01:00
parent 7181dec3f1
commit 34dc0f46ae
5 changed files with 88 additions and 15 deletions

View file

@ -145,6 +145,12 @@ PyAPI_FUNC(int) _PyTime_AsTimeval(_PyTime_t t,
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.