dual_timestamp* dual_timestamp_from_boottime(dual_timestamp *ts, usec_t u) {
usec_t nowm;
+ assert(ts);
+
if (u == USEC_INFINITY) {
ts->realtime = ts->monotonic = USEC_INFINITY;
return ts;
}
usec_t triple_timestamp_by_clock(triple_timestamp *ts, clockid_t clock) {
+ assert(ts);
switch (clock) {
const char *s;
usec_t n, d;
+ assert(buf);
+
if (!timestamp_is_set(t))
return NULL;
ParseTimestampResult *shared, tmp;
int r;
+ assert(t);
+
last_space = strrchr(t, ' ');
if (last_space != NULL && timezone_is_valid(last_space + 1, LOG_DEBUG))
tz = last_space + 1;
{ "µs", 1ULL },
};
+ assert(p);
+ assert(ret);
+
for (size_t i = 0; i < ELEMENTSOF(table); i++) {
char *e;
}
int parse_sec_def_infinity(const char *t, usec_t *ret) {
+ assert(t);
+ assert(ret);
+
t += strspn(t, WHITESPACE);
if (isempty(t)) {
*ret = USEC_INFINITY;
};
size_t i;
+ assert(p);
+ assert(ret);
+
for (i = 0; i < ELEMENTSOF(table); i++) {
char *e;
_cleanup_strv_free_ char **zones = NULL;
int r;
+ assert(ret);
+
f = fopen("/usr/share/zoneinfo/tzdata.zi", "re");
if (!f)
return -errno;
char *z;
int r;
+ assert(ret);
+
r = readlink_malloc("/etc/localtime", &t);
if (r == -ENOENT) {
/* If the symlink does not exist, assume "UTC", like glibc does */
}
time_t mktime_or_timegm(struct tm *tm, bool utc) {
+ assert(tm);
+
return utc ? timegm(tm) : mktime(tm);
}
struct tm *localtime_or_gmtime_r(const time_t *t, struct tm *tm, bool utc) {
+ assert(t);
+ assert(tm);
+
return utc ? gmtime_r(t, tm) : localtime_r(t, tm);
}