/* local_scan()) */
vtype_todbsdin, /* value not used; generate BSD inbox tod */
vtype_tode, /* value not used; generate tod in epoch format */
+ vtype_todel, /* value not used; generate tod in epoch/usec format */
vtype_todf, /* value not used; generate full tod */
vtype_todl, /* value not used; generate log tod */
vtype_todlf, /* value not used; generate log file datestamp tod */
#endif
{ "tod_bsdinbox", vtype_todbsdin, NULL },
{ "tod_epoch", vtype_tode, NULL },
+ { "tod_epoch_l", vtype_todel, NULL },
{ "tod_full", vtype_todf, NULL },
{ "tod_log", vtype_todl, NULL },
{ "tod_logfile", vtype_todlf, NULL },
case vtype_tode: /* Unix epoch time of day */
return tod_stamp(tod_epoch);
+ case vtype_todel: /* Unix epoch/usec time of day */
+ return tod_stamp(tod_epoch_l);
+
case vtype_todf: /* Full time of day */
return tod_stamp(tod_full);
enum { tod_log, tod_log_bare, tod_log_zone, tod_log_datestamp_daily,
tod_log_datestamp_monthly, tod_zone, tod_full, tod_bsdin,
- tod_mbx, tod_epoch, tod_zulu };
+ tod_mbx, tod_epoch, tod_epoch_l, tod_zulu };
/* For identifying types of driver */
Argument: type of timestamp required:
tod_bsdin BSD inbox format
tod_epoch Unix epoch format
+ tod_epochl Unix epoch/usec format
tod_full full date and time
tod_log log file data line format,
with zone if log_timezone is TRUE
uschar *
tod_stamp(int type)
{
-time_t now = time(NULL);
+time_t now;
struct tm *t;
+if (type == tod_epoch_l)
+ {
+ struct timeval tv;
+ gettimeofday(&tv, NULL);
+ (void) sprintf(CS timebuf, "%ld%06ld", tv.tv_sec, tv.tv_usec ); /* Unix epoch/usec format */
+ return timebuf;
+ }
+
+now = time(NULL);
+
/* Vary log type according to timezone requirement */
if (type == tod_log) type = log_timezone? tod_log_zone : tod_log_bare;