X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~mdw/git/disorder/blobdiff_plain/e7eb3a2744aa45179daea235800753d3d1955338..34d37b3e2d05e305469a58166ff21c867c6f610b:/lib/syscalls.c diff --git a/lib/syscalls.c b/lib/syscalls.c index 0415a2d..b175666 100644 --- a/lib/syscalls.c +++ b/lib/syscalls.c @@ -15,7 +15,9 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ - +/** @file lib/syscalls.c + * @brief Error-checking library call wrappers + */ #include "common.h" #include @@ -146,6 +148,15 @@ void xgettimeofday(struct timeval *tv, struct timezone *tz) { mustnotbeminus1("gettimeofday", gettimeofday(tv, tz)); } +time_t xtime(time_t *whenp) { + struct timeval tv; + + xgettimeofday(&tv, NULL); + if(whenp) + *whenp = tv.tv_sec; + return tv.tv_sec; +} + /* Local Variables: c-basic-offset:2