29#if __STDC_NO_ATOMICS__
32#ifdef HAVE_STDATOMIC_H
36#define __STDC_NO_ATOMICS__ 1
41#define LOG(kind, ...) GNUNET_log_from (kind, "util-time", __VA_ARGS__)
116 gettimeofday (&tv, NULL);
117 ret.abs_value_us = (uint64_t) (((uint64_t) tv.tv_sec * 1000LL * 1000LL)
118 + ((uint64_t) tv.tv_usec))
223 tp = localtime (&
tt);
232 "%a %b %d %H:%M:%S %Y",
247 tt =
t.abs_value_us / 1000LL / 1000LL;
248 tp = localtime (&
tt);
257 "%a %b %d %H:%M:%S %Y",
268 const char *unit =
"µs";
276 (dval > 5 * 1000)) ||
277 (0 == (dval % 1000)))
309 (
unsigned long long) dval,
325 if (rel.rel_value_us + now.
abs_value_us < rel.rel_value_us)
347 return (t1.rel_value_us < t2.rel_value_us) ? t1 : t2;
355 return (t1.rel_value_us > t2.rel_value_us) ? t1 : t2;
363 return (t1.abs_value_us < t2.abs_value_us) ? t1 : t2;
371 return (t1.abs_value_us > t2.abs_value_us) ? t1 : t2;
379 return (t1.abs_time.abs_value_us > t2.abs_time.abs_value_us) ? t1 : t2;
387 return (t1.abs_time.abs_value_us < t2.abs_time.abs_value_us) ? t1 : t2;
400 - at.abs_value_us % rt.rel_value_us;
430 if (
end.abs_value_us <
start.abs_value_us)
487 unsigned long long factor)
496 if (
ret.rel_value_us / factor != rel.rel_value_us)
517 m = ((double) rel.rel_value_us) * factor;
530 unsigned long long factor)
539 if (
ret.rel_value_us / factor != rel.rel_value_us)
549 unsigned long long factor)
588 if ((a1.rel_value_us == UINT64_MAX) || (a2.rel_value_us == UINT64_MAX))
590 if (a1.rel_value_us + a2.rel_value_us < a1.rel_value_us)
595 ret.rel_value_us = a1.rel_value_us + a2.rel_value_us;
606 if (a2.rel_value_us >= a1.rel_value_us)
608 if (a1.rel_value_us == UINT64_MAX)
756 return t->tm_year + 1900;
770 return t->tm_year + 1900;
785 setenv (
"TZ",
"", 1);
789 setenv (
"TZ", tz, 1);
807 memset (&
t, 0,
sizeof(
t));
813 t.tm_year = year - 1900;
824 ret.abs_value_us = tp * 1000LL * 1000LL;
833 double r = (rand () % 500) / 1000.0;
853 double d = ((rand () % 1001) + 500) / 1000.0;
874 if (NULL != map_handle)
886 "MONOTONIC_TIME_FILENAME",
901 _ (
"Failed to map `%s', cannot assure monotonic time!\n"),
910 if (
size < (off_t)
sizeof(*
map))
929 "Failed to map `%s', cannot assure monotonic time!\n")
938 "Failed to setup monotonic time file `%s', cannot assure monotonic time!\n"),
950#if __STDC_NO_ATOMICS__
968#if __STDC_NO_ATOMICS__
970 (void) __sync_lock_test_and_set (
map, val);
975 atomic_store (
map, val);
999 : localtime_r (seconds,
1062 if (0 != at.abs_value_us % 1000000)
1063 result.abs_value_us = (seconds + 1) * 1000000ULL;
1068 if ( (timeinfo.tm_sec > 0) ||
1069 (0 != at.abs_value_us % 1000000) )
1071 timeinfo.tm_sec = 0;
1072 timeinfo.tm_min += 1;
1077 if ( (timeinfo.tm_min > 0) ||
1078 (timeinfo.tm_sec > 0) ||
1079 (0 != (at.abs_value_us % 1000000)) )
1081 timeinfo.tm_sec = 0;
1082 timeinfo.tm_min = 0;
1083 timeinfo.tm_hour += 1;
1087 if ( (timeinfo.tm_hour > 0) ||
1088 (timeinfo.tm_min > 0) ||
1089 (timeinfo.tm_sec > 0) ||
1090 (0 != at.abs_value_us % 1000000) )
1092 timeinfo.tm_sec = 0;
1093 timeinfo.tm_min = 0;
1094 timeinfo.tm_hour = 0;
1095 timeinfo.tm_mday += 1;
1102 int days_until_monday = (8 - timeinfo.tm_wday) % 7;
1104 if ( (0 == days_until_monday) &&
1105 ( (timeinfo.tm_hour > 0) ||
1106 (timeinfo.tm_min > 0) ||
1107 (timeinfo.tm_sec > 0) ||
1108 (0 != at.abs_value_us % 1000000) ) )
1109 days_until_monday = 7;
1110 if (days_until_monday > 0)
1112 timeinfo.tm_sec = 0;
1113 timeinfo.tm_min = 0;
1114 timeinfo.tm_hour = 0;
1115 timeinfo.tm_mday += days_until_monday;
1120 if ( (timeinfo.tm_mday > 1) ||
1121 (timeinfo.tm_hour > 0) ||
1122 (timeinfo.tm_min > 0) ||
1123 (timeinfo.tm_sec > 0) ||
1124 (0 != (at.abs_value_us % 1000000)) )
1126 timeinfo.tm_sec = 0;
1127 timeinfo.tm_min = 0;
1128 timeinfo.tm_hour = 0;
1129 timeinfo.tm_mday = 1;
1130 timeinfo.tm_mon += 1;
1135 int next_quarter_month = ((timeinfo.tm_mon / 3) + 1) * 3;
1137 if ( (next_quarter_month > timeinfo.tm_mon) ||
1138 (timeinfo.tm_mday > 1) ||
1139 (timeinfo.tm_hour > 0) ||
1140 (timeinfo.tm_min > 0) ||
1141 (timeinfo.tm_sec > 0) ||
1142 (0 != (at.abs_value_us % 1000000)) )
1144 timeinfo.tm_sec = 0;
1145 timeinfo.tm_min = 0;
1146 timeinfo.tm_hour = 0;
1147 timeinfo.tm_mday = 1;
1148 timeinfo.tm_mon = next_quarter_month;
1153 if ( (timeinfo.tm_mon > 0) ||
1154 (timeinfo.tm_mday > 1) ||
1155 (timeinfo.tm_hour > 0) ||
1156 (timeinfo.tm_min > 0) ||
1157 (timeinfo.tm_sec > 0) ||
1158 (0 != (at.abs_value_us % 1000000)) )
1160 timeinfo.tm_sec = 0;
1161 timeinfo.tm_min = 0;
1162 timeinfo.tm_hour = 0;
1163 timeinfo.tm_mday = 1;
1164 timeinfo.tm_mon = 0;
1165 timeinfo.tm_year += 1;
1212 result.abs_value_us = seconds * 1000000ULL;
1215 timeinfo.tm_sec = 0;
1218 timeinfo.tm_sec = 0;
1219 timeinfo.tm_min = 0;
1222 timeinfo.tm_sec = 0;
1223 timeinfo.tm_min = 0;
1224 timeinfo.tm_hour = 0;
1230 int days_since_monday = (0 == timeinfo.tm_wday)
1232 : (timeinfo.tm_wday - 1);
1234 timeinfo.tm_sec = 0;
1235 timeinfo.tm_min = 0;
1236 timeinfo.tm_hour = 0;
1237 timeinfo.tm_mday -= days_since_monday;
1241 timeinfo.tm_sec = 0;
1242 timeinfo.tm_min = 0;
1243 timeinfo.tm_hour = 0;
1244 timeinfo.tm_mday = 1;
1248 int quarter_start_month = (timeinfo.tm_mon / 3) * 3;
1250 timeinfo.tm_sec = 0;
1251 timeinfo.tm_min = 0;
1252 timeinfo.tm_hour = 0;
1253 timeinfo.tm_mday = 1;
1254 timeinfo.tm_mon = quarter_start_month;
1258 timeinfo.tm_sec = 0;
1259 timeinfo.tm_min = 0;
1260 timeinfo.tm_hour = 0;
1261 timeinfo.tm_mday = 1;
1262 timeinfo.tm_mon = 0;
1384 for (
unsigned int i = 0;
1388 if (0 == strcasecmp (ri_str,
1402 for (
unsigned int i = 0;
static mp_limb_t d[(((256)+GMP_NUMB_BITS - 1)/GMP_NUMB_BITS)]
static struct GNUNET_ARM_MonitorHandle * m
Monitor connection with ARM.
static int start
Set if we are to start default services (including ARM).
static int ret
Final status code.
static struct GNUNET_CONFIGURATION_Handle * cfg
Our configuration.
static int end
Set if we are to shutdown all services (including ARM).
static bool finished
Set to true once we are finished and should exit after sending our final message to the parent.
static struct GNUNET_SCHEDULER_Task * tt
Task scheduled to handle timeout.
static struct GNUNET_SCHEDULER_Task * t
Main task.
static int result
Global testing status.
static const struct GNUNET_CRYPTO_BlindablePrivateKey zero
Public key of all zeros.
static void do_round(void *cls)
Send out PUSHes and PULLs, possibly update #view, samplers.
static struct GNUNET_TIME_Relative duration
Option '-d': duration of the mapping.
struct GNUNET_PQ_ResultSpec __attribute__
enum GNUNET_GenericReturnValue GNUNET_CONFIGURATION_get_value_filename(const struct GNUNET_CONFIGURATION_Handle *cfg, const char *section, const char *option, char **value)
Get a configuration value that should be the name of a file or directory.
struct GNUNET_DISK_FileHandle * GNUNET_DISK_file_open(const char *fn, enum GNUNET_DISK_OpenFlags flags, enum GNUNET_DISK_AccessPermissions perm)
Open a file.
ssize_t GNUNET_DISK_file_write(const struct GNUNET_DISK_FileHandle *h, const void *buffer, size_t n)
Write a buffer to a file.
enum GNUNET_GenericReturnValue GNUNET_DISK_file_close(struct GNUNET_DISK_FileHandle *h)
Close an open file.
void * GNUNET_DISK_file_map(const struct GNUNET_DISK_FileHandle *h, struct GNUNET_DISK_MapHandle **m, enum GNUNET_DISK_MapType access, size_t len)
Map a file into memory.
enum GNUNET_GenericReturnValue GNUNET_DISK_file_handle_size(struct GNUNET_DISK_FileHandle *fh, off_t *size)
Get the size of an open file.
enum GNUNET_GenericReturnValue GNUNET_DISK_file_unmap(struct GNUNET_DISK_MapHandle *h)
Unmap a file.
@ GNUNET_DISK_OPEN_CREATE
Create file if it doesn't exist.
@ GNUNET_DISK_OPEN_READWRITE
Open the file for both reading and writing.
@ GNUNET_DISK_PERM_USER_READ
Owner can read.
@ GNUNET_DISK_PERM_GROUP_READ
Group can read.
@ GNUNET_DISK_PERM_GROUP_WRITE
Group can write.
@ GNUNET_DISK_PERM_USER_WRITE
Owner can write.
@ GNUNET_DISK_MAP_TYPE_READWRITE
Read-write memory map.
#define GNUNET_log(kind,...)
uint64_t GNUNET_ntohll(uint64_t n)
Convert unsigned 64-bit integer to host byte order.
uint64_t GNUNET_htonll(uint64_t n)
Convert unsigned 64-bit integer to network byte order.
GNUNET_GenericReturnValue
Named constants for return values.
#define GNUNET_assert(cond)
Use this for fatal errors that cannot be handled.
#define GNUNET_break(cond)
Use this for internal assertion violations that are not fatal (can be handled) but should not occur.
@ GNUNET_ERROR_TYPE_WARNING
int GNUNET_snprintf(char *buf, size_t size, const char *format,...) __attribute__((format(printf
Like snprintf, just aborts if the buffer is of insufficient size.
#define GNUNET_free(ptr)
Wrapper around free.
struct GNUNET_TIME_Absolute GNUNET_TIME_year_to_time(unsigned int year)
Convert a year to an expiration time of January 1st of that year.
struct GNUNET_TIME_Relative GNUNET_TIME_relative_min(struct GNUNET_TIME_Relative t1, struct GNUNET_TIME_Relative t2)
Return the minimum of two relative time values.
struct GNUNET_TIME_Relative GNUNET_TIME_relative_get_zero_()
Return relative time of 0ms.
struct GNUNET_TIME_Relative GNUNET_TIME_relative_get_hour_()
Return relative time of 1 hour.
const char * GNUNET_TIME_relative2s(struct GNUNET_TIME_Relative delta, bool do_round)
Give relative time in human-readable fancy format.
#define GNUNET_TIME_UNIT_FOREVER_REL
Constant used to specify "forever".
struct GNUNET_TIME_Absolute GNUNET_TIME_absolute_from_s(uint64_t s_after_epoch)
Convert seconds after the UNIX epoch to absolute time.
struct GNUNET_TIME_Relative GNUNET_TIME_relative_ntoh(struct GNUNET_TIME_RelativeNBO a)
Convert relative time from network byte order.
bool GNUNET_TIME_absolute_is_future(struct GNUNET_TIME_Absolute abs)
Test if abs is truly in the future (excluding now).
struct GNUNET_TIME_Relative GNUNET_TIME_relative_get_millisecond_()
Return relative time of 1ms.
struct GNUNET_TIME_Relative GNUNET_TIME_absolute_get_duration(struct GNUNET_TIME_Absolute whence)
Get the duration of an operation as the difference of the current time and the given start time "henc...
struct GNUNET_TIME_Relative GNUNET_TIME_relative_saturating_multiply(struct GNUNET_TIME_Relative rel, unsigned long long factor)
Saturating multiply relative time by a given factor.
struct GNUNET_TIME_Relative GNUNET_TIME_relative_max(struct GNUNET_TIME_Relative t1, struct GNUNET_TIME_Relative t2)
Return the maximum of two relative time values.
struct GNUNET_TIME_Relative GNUNET_TIME_relative_get_minute_()
Return relative time of 1 minute.
struct GNUNET_TIME_Timestamp GNUNET_TIME_timestamp_min(struct GNUNET_TIME_Timestamp t1, struct GNUNET_TIME_Timestamp t2)
Return the minimum of two timestamps.
enum GNUNET_GenericReturnValue GNUNET_TIME_string_to_round_interval(const char *ri_str, enum GNUNET_TIME_RounderInterval *ri)
Convert rounding interval given as a string to the enum value.
#define GNUNET_TIME_UNIT_HOURS
One hour.
struct GNUNET_TIME_Absolute GNUNET_TIME_absolute_get_zero_()
Return absolute time of 0ms.
struct GNUNET_TIME_Timestamp GNUNET_TIME_relative_to_timestamp(struct GNUNET_TIME_Relative rel)
Convert relative time to a timestamp in the future.
#define GNUNET_TIME_relative_cmp(t1, op, t2)
Compare two relative times.
#define GNUNET_TIME_UNIT_SECONDS
One second.
struct GNUNET_TIME_Timestamp GNUNET_TIME_timestamp_from_s(uint64_t s_after_epoch)
Convert seconds after the UNIX epoch to timestamp.
struct GNUNET_TIME_Relative GNUNET_TIME_absolute_get_remaining(struct GNUNET_TIME_Absolute future)
Given a timestamp in the future, how much time remains until then?
GNUNET_TIME_RounderInterval
Quantities by which we support round up absolute time values.
struct GNUNET_TIME_Absolute GNUNET_TIME_absolute_max(struct GNUNET_TIME_Absolute t1, struct GNUNET_TIME_Absolute t2)
Return the maximum of two absolute time values.
unsigned int GNUNET_TIME_get_current_year()
Return the current year (e.g.
bool GNUNET_TIME_absolute_is_zero(struct GNUNET_TIME_Absolute abs)
Test if abs is truly zero.
struct GNUNET_TIME_Absolute GNUNET_TIME_absolute_from_ms(uint64_t ms_after_epoch)
Convert milliseconds after the UNIX epoch to absolute time.
bool GNUNET_TIME_relative_is_zero(struct GNUNET_TIME_Relative rel)
Test if rel is zero.
bool GNUNET_TIME_absolute_is_never(struct GNUNET_TIME_Absolute abs)
Test if abs is never.
#define GNUNET_TIME_UNIT_MILLISECONDS
One millisecond.
struct GNUNET_TIME_Relative GNUNET_TIME_randomized_backoff(struct GNUNET_TIME_Relative rt, struct GNUNET_TIME_Relative threshold)
Randomized exponential back-off, starting at 1 ms and going up by a factor of 2+r,...
#define GNUNET_TIME_UNIT_DAYS
One day.
struct GNUNET_TIME_Relative GNUNET_TIME_relative_subtract(struct GNUNET_TIME_Relative a1, struct GNUNET_TIME_Relative a2)
Subtract relative timestamp from the other.
#define GNUNET_TIME_UNIT_MONTHS
One month (30 days).
const char * GNUNET_TIME_absolute2s(struct GNUNET_TIME_Absolute t)
Like asctime, except for GNUnet time.
struct GNUNET_TIME_Absolute GNUNET_TIME_absolute_get_forever_()
Return "forever".
struct GNUNET_TIME_Absolute GNUNET_TIME_absolute_get()
Get the current time.
#define GNUNET_TIME_UNIT_MINUTES
One minute.
struct GNUNET_TIME_Relative GNUNET_TIME_relative_get_forever_()
Return "forever".
struct GNUNET_TIME_Timestamp GNUNET_TIME_timestamp_get()
Get timestamp representing the current time.
uint64_t GNUNET_TIME_timestamp_to_s(struct GNUNET_TIME_Timestamp ts)
Convert timestamp to number of seconds after the UNIX epoch.
struct GNUNET_TIME_Relative GNUNET_TIME_relative_multiply_double(struct GNUNET_TIME_Relative rel, double factor)
Multiply relative time by a given factor.
bool GNUNET_TIME_relative_is_forever(struct GNUNET_TIME_Relative rel)
Test if rel is forever.
struct GNUNET_TIME_Absolute GNUNET_TIME_round_down_utc(struct GNUNET_TIME_Absolute at, enum GNUNET_TIME_RounderInterval ri)
Round @at down to the start of the next interval ri, using UTC calendar boundaries.
long long GNUNET_TIME_get_offset()
Get the timestamp offset for this instance.
struct GNUNET_TIME_Absolute GNUNET_TIME_absolute_ntoh(struct GNUNET_TIME_AbsoluteNBO a)
Convert absolute time from network byte order.
struct GNUNET_TIME_Absolute GNUNET_TIME_absolute_round_down(struct GNUNET_TIME_Absolute at, struct GNUNET_TIME_Relative rt)
Round down absolute time at to multiple of rt.
#define GNUNET_TIME_UNIT_WEEKS
One week.
struct GNUNET_TIME_Relative GNUNET_TIME_relative_add(struct GNUNET_TIME_Relative a1, struct GNUNET_TIME_Relative a2)
Add relative times together.
void GNUNET_TIME_set_offset(long long offset)
Set the timestamp offset for this instance.
struct GNUNET_TIME_Relative GNUNET_TIME_randomize(struct GNUNET_TIME_Relative r)
Return a random time value between 0.5*r and 1.5*r.
struct GNUNET_TIME_Absolute GNUNET_TIME_absolute_subtract(struct GNUNET_TIME_Absolute start, struct GNUNET_TIME_Relative duration)
Subtract a given relative duration from the given start time.
unsigned int GNUNET_TIME_time_to_year(struct GNUNET_TIME_Absolute at)
Convert an expiration time to the respective year (rounds)
struct GNUNET_TIME_Relative GNUNET_TIME_relative_get_second_()
Return relative time of 1s.
struct GNUNET_TIME_Relative GNUNET_TIME_relative_get_unit_()
Return relative time of 1 microsecond.
struct GNUNET_TIME_Absolute GNUNET_TIME_relative_to_absolute(struct GNUNET_TIME_Relative rel)
Convert relative time to an absolute time in the future.
struct GNUNET_TIME_Relative GNUNET_TIME_relative_multiply(struct GNUNET_TIME_Relative rel, unsigned long long factor)
Multiply relative time by a given factor.
struct GNUNET_TIME_Absolute GNUNET_TIME_absolute_min(struct GNUNET_TIME_Absolute t1, struct GNUNET_TIME_Absolute t2)
Return the minimum of two absolute time values.
#define GNUNET_TIME_UNIT_ZERO
Relative time zero.
struct GNUNET_TIME_RelativeNBO GNUNET_TIME_relative_hton(struct GNUNET_TIME_Relative a)
Convert relative time to network byte order.
#define GNUNET_TIME_UNIT_FOREVER_TS
Constant used to specify "forever".
enum GNUNET_TIME_RounderInterval GNUNET_TIME_relative_to_round_interval(struct GNUNET_TIME_Relative rel)
Convert a relative time to the corresponding rounding interval.
bool GNUNET_TIME_absolute_approx_eq(struct GNUNET_TIME_Absolute a1, struct GNUNET_TIME_Absolute a2, struct GNUNET_TIME_Relative t)
Test if a1 and a2 are equal within a margin of error of t.
struct GNUNET_TIME_Absolute GNUNET_TIME_absolute_add(struct GNUNET_TIME_Absolute start, struct GNUNET_TIME_Relative duration)
Add a given relative duration to the given start time.
struct GNUNET_TIME_Timestamp GNUNET_TIME_timestamp_max(struct GNUNET_TIME_Timestamp t1, struct GNUNET_TIME_Timestamp t2)
Return the maximum of two timestamps.
#define GNUNET_TIME_UNIT_ZERO_ABS
Absolute time zero.
struct GNUNET_TIME_Absolute GNUNET_TIME_absolute_get_monotonic(const struct GNUNET_CONFIGURATION_Handle *cfg)
Obtain the current time and make sure it is monotonically increasing.
struct GNUNET_TIME_Absolute GNUNET_TIME_round_down(struct GNUNET_TIME_Absolute at, enum GNUNET_TIME_RounderInterval ri)
Round @at down to the start of the next interval ri.
struct GNUNET_TIME_Absolute GNUNET_TIME_round_up(struct GNUNET_TIME_Absolute at, enum GNUNET_TIME_RounderInterval ri)
Round up the given at to the interval ri.
struct GNUNET_TIME_TimestampNBO GNUNET_TIME_timestamp_hton(struct GNUNET_TIME_Timestamp t)
Convert timestamp to network byte order.
struct GNUNET_TIME_Relative GNUNET_TIME_relative_divide(struct GNUNET_TIME_Relative rel, unsigned long long factor)
Divide relative time by a given factor.
const char * GNUNET_TIME_round_interval2s(enum GNUNET_TIME_RounderInterval ri)
Convert rounding interval to string.
struct GNUNET_TIME_Relative GNUNET_TIME_absolute_get_difference(struct GNUNET_TIME_Absolute start, struct GNUNET_TIME_Absolute end)
Compute the time difference between the given start and end times.
struct GNUNET_TIME_AbsoluteNBO GNUNET_TIME_absolute_hton(struct GNUNET_TIME_Absolute a)
Convert absolute time to network byte order.
bool GNUNET_TIME_absolute_is_past(struct GNUNET_TIME_Absolute abs)
Test if abs is truly in the past (excluding now).
struct GNUNET_TIME_Relative GNUNET_TIME_calculate_eta(struct GNUNET_TIME_Absolute start, uint64_t finished, uint64_t total)
Calculate the estimate time of arrival/completion for an operation.
struct GNUNET_TIME_Timestamp GNUNET_TIME_timestamp_ntoh(struct GNUNET_TIME_TimestampNBO tn)
Convert timestamp from network byte order.
#define GNUNET_TIME_UNIT_FOREVER_ABS
Constant used to specify "forever".
struct GNUNET_TIME_Absolute GNUNET_TIME_round_up_utc(struct GNUNET_TIME_Absolute at, enum GNUNET_TIME_RounderInterval ri)
Round up the given at to the interval ri, using UTC calendar boundaries.
const char * GNUNET_TIME_timestamp2s(struct GNUNET_TIME_Timestamp ts)
Convert ts to human-readable timestamp.
#define GNUNET_TIME_UNIT_YEARS
One year (365 days).
struct GNUNET_TIME_Timestamp GNUNET_TIME_absolute_to_timestamp(struct GNUNET_TIME_Absolute at)
Round an absolute time to a timestamp.
@ GNUNET_TIME_RI_NONE
No rounding up.
@ GNUNET_TIME_RI_MINUTE
Round up to the next minute.
@ GNUNET_TIME_RI_QUARTER
Round up to the next quarter.
@ GNUNET_TIME_RI_HOUR
Round up to the next hour.
@ GNUNET_TIME_RI_SECOND
Round up to a multiple of seconds.
@ GNUNET_TIME_RI_WEEK
Round up to the next calendar week.
@ GNUNET_TIME_RI_DAY
Round up to the next day.
@ GNUNET_TIME_RI_YEAR
Round up to the next year.
@ GNUNET_TIME_RI_MONTH
Round up to the next month.
static struct GNUNET_CONTAINER_MultiPeerMap * map
Peermap of PeerIdentities to "struct PeerEntry" (for fast lookup).
static unsigned int size
Size of the "table".
static struct GNUNET_TIME_Relative delta
Handle used to access files (and pipes).
Handle for a memory-mapping operation.
Time for absolute time used by GNUnet, in microseconds and in network byte order.
uint64_t abs_value_us__
The actual value (in network byte order).
Time for absolute times used by GNUnet, in microseconds.
uint64_t abs_value_us
The actual value.
Time for relative time used by GNUnet, in microseconds and in network byte order.
uint64_t rel_value_us__
The actual value (in network byte order).
Time for relative time used by GNUnet, in microseconds.
uint64_t rel_value_us
The actual value.
Time for timestamps used by GNUnet, in seconds and in network byte order.
struct GNUNET_TIME_AbsoluteNBO abs_time_nbo
The actual value.
Time for timestamps used by GNUnet, in microseconds rounded to seconds.
struct GNUNET_TIME_Absolute abs_time
The actual value.
static struct tm * time_to_tm(const time_t *seconds, struct tm *tm, bool utc)
Convert seconds since the Epoch to broken-down time.
static long long timestamp_offset
Variable used to simulate clock skew.
static time_t tm_to_time(struct tm *tm, bool utc)
Convert broken-down time to seconds since the Epoch.
static struct GNUNET_TIME_Absolute round_down(struct GNUNET_TIME_Absolute at, enum GNUNET_TIME_RounderInterval ri, bool utc)
Round at down to the start of the interval ri.
static struct GNUNET_TIME_Absolute round_up(struct GNUNET_TIME_Absolute at, enum GNUNET_TIME_RounderInterval ri, bool utc)
Round up the given at to the interval ri.
static const struct @44 ri_lookup_table[]
Lookup table mapping rounding interval enum values to their string representations.
enum GNUNET_TIME_RounderInterval ri
void GNUNET_util_time_fini(void)
static time_t my_timegm(struct tm *tm)
As suggested in the timegm() man page.