diff --git a/include/time.h b/include/time.h index 067b5196812190f1b13b23b76218734f6961bf53..ecdc66dff781d05d92b8429ec40ffd7355b0355e 100644 --- a/include/time.h +++ b/include/time.h @@ -114,6 +114,9 @@ struct tm *getdate (const char *); int stime(time_t *); #endif +#if defined(_GNU_SOURCE) +time_t timegm(struct tm *); +#endif #ifdef __cplusplus } diff --git a/src/time/timegm.c b/src/time/timegm.c new file mode 100644 index 0000000000000000000000000000000000000000..6d08917e449518bb00179d56d7e38e8a2e61a98d --- /dev/null +++ b/src/time/timegm.c @@ -0,0 +1,9 @@ +#define _GNU_SOURCE +#include + +#include "__time.h" + +time_t timegm(struct tm *tm) +{ + return __tm_to_time(tm); +}