1/* 2 * (C) 2009 by Pablo Neira Ayuso <pablo@netfilter.org> 3 * 4 * This program is free software; you can redistribute it and/or modify 5 * it under the terms of the GNU General Public License as published by 6 * the Free Software Foundation; either version 2 of the License, or 7 * (at your option) any later version. 8 */ 9#include "date.h" 10#include <stdlib.h> 11#include <string.h> 12 13static struct timeval now; 14 15int do_gettimeofday(void) 16{ 17 return gettimeofday(&now, NULL); 18} 19 20void gettimeofday_cached(struct timeval *tv) 21{ 22 memcpy(tv, &now, sizeof(struct timeval)); 23} 24 25int time_cached(void) 26{ 27 return now.tv_sec; 28} 29