diff options
author | Alistair Popple <alistair@popple.id.au> | 2014-08-14 18:47:49 +1000 |
---|---|---|
committer | Benjamin Herrenschmidt <benh@kernel.crashing.org> | 2014-08-15 13:03:08 +1000 |
commit | 39e53e483b186122db12712aca5dfb666e819729 (patch) | |
tree | 71d2402f8020b939c16151d5f29fd8823a825d3f /libc/include | |
parent | c0515b6361b03d18cffcbc358d0f6109cd684031 (diff) | |
download | skiboot-39e53e483b186122db12712aca5dfb666e819729.zip skiboot-39e53e483b186122db12712aca5dfb666e819729.tar.gz skiboot-39e53e483b186122db12712aca5dfb666e819729.tar.bz2 |
libc: Add mktime and gmtime_r
Both the FSP RTC and the upcoming IPMI RTC implementation need to
manipulate time in various ways. Rather than re-implementing slightly
different versions of the calculations twice lets implement some
standard library functions (with tests) and use those.
This patch adds mktime and gmtime_r to the libc.
Signed-off-by: Alistair Popple <alistair@popple.id.au>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Diffstat (limited to 'libc/include')
-rw-r--r-- | libc/include/time.h | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/libc/include/time.h b/libc/include/time.h index 807023b..517f596 100644 --- a/libc/include/time.h +++ b/libc/include/time.h @@ -33,10 +33,12 @@ struct timespec { long tv_nsec; /* nanoseconds */ }; +struct tm *gmtime_r(const time_t *timep, struct tm *result); +time_t mktime(struct tm *tm); + /* Not implemented by libc but by hosting environment, however * this is where the prototype is expected */ int nanosleep(const struct timespec *req, struct timespec *rem); #endif /* _TIME_H */ - |