diff options
author | Lennart Poettering <lennart@poettering.net> | 2009-03-19 18:13:40 +0100 |
---|---|---|
committer | Lennart Poettering <lennart@poettering.net> | 2009-03-19 18:13:40 +0100 |
commit | 3a09a88fd1f3dfe365dc1f3e455c097010d00964 (patch) | |
tree | 16dffe707c91b7bc3c5212f2a135b6d3e63d6d56 /src/pulsecore/rtclock.c | |
parent | dd4000671808df746a3fd29090aad8cf939cf512 (diff) |
prepare move to rtpoll
Diffstat (limited to 'src/pulsecore/rtclock.c')
-rw-r--r-- | src/pulsecore/rtclock.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/pulsecore/rtclock.c b/src/pulsecore/rtclock.c index 56ab2ef0..11eb8eae 100644 --- a/src/pulsecore/rtclock.c +++ b/src/pulsecore/rtclock.c @@ -145,6 +145,15 @@ struct timeval* pa_rtclock_from_wallclock(struct timeval *tv) { return tv; } +struct timespec *pa_timespec_store(struct timespec *ts, pa_usec_t v) { + pa_assert(ts); + + ts->tv_sec = (time_t) (v / PA_USEC_PER_SEC); + ts->tv_nsec = (long) ((v % PA_USEC_PER_SEC) * PA_NSEC_PER_USEC); + + return ts; +} + pa_usec_t pa_timespec_load(const struct timespec *ts) { pa_assert(ts); |