diff options
author | Victor Stinner <victor.stinner@gmail.com> | 2015-03-27 17:19:03 (GMT) |
---|---|---|
committer | Victor Stinner <victor.stinner@gmail.com> | 2015-03-27 17:19:03 (GMT) |
commit | 34dc0f46ae5c0c9ec91d9402fac61111b802855f (patch) | |
tree | 274e9bac8b7049fabac4f16161676edfd847c771 /Include/pytime.h | |
parent | 7181dec3f12f11c9a5f4adc6336b1c7273452308 (diff) | |
download | cpython-34dc0f46ae5c0c9ec91d9402fac61111b802855f.zip cpython-34dc0f46ae5c0c9ec91d9402fac61111b802855f.tar.gz cpython-34dc0f46ae5c0c9ec91d9402fac61111b802855f.tar.bz2 |
Issue #22117: The signal modules uses the new _PyTime_t API
* Add _PyTime_AsTimespec()
* Add unit tests for _PyTime_AsTimespec()
Diffstat (limited to 'Include/pytime.h')
-rw-r--r-- | Include/pytime.h | 6 |
1 files changed, 6 insertions, 0 deletions
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 @@ 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. |