X-Git-Url: https://git.exim.org/exim.git/blobdiff_plain/0a3df1d651b9e11c7c91bf095aebaf8c65d6c276..9acf6b941e1356590e94e8e4a0bcf5dd3318087c:/src/src/os.c diff --git a/src/src/os.c b/src/src/os.c index 96ee35562..2b6f79c3f 100644 --- a/src/src/os.c +++ b/src/src/os.c @@ -2,7 +2,7 @@ * Exim - an Internet mail transport agent * *************************************************/ -/* Copyright (c) University of Cambridge 1995 - 2009 */ +/* Copyright (c) University of Cambridge 1995 - 2012 */ /* See the file NOTICE for conditions of use and distribution. */ #ifdef STAND_ALONE @@ -836,6 +836,39 @@ os_get_dns_resolver_res(void) /* ----------------------------------------------------------------------- */ +/*********************************************************** +* Time-related functions * +***********************************************************/ + +/* At least Solaris, and probably others, don't have this */ + +#ifndef _BSD_SOURCE + +# include +# include + +time_t +timegm(struct tm * tm) +{ +time_t ret; +char *tz; + +tz = getenv("TZ"); +setenv("TZ", "", 1); +tzset(); +ret = mktime(tm); +if (tz) + setenv("TZ", tz, 1); +else + unsetenv("TZ"); +tzset(); +return ret; +} + +#endif + +/* ----------------------------------------------------------------------- */ +