chiark
/
gitweb
/
~ianmdlvl
/
elogind.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Prep v228: Add remaining updates from upstream (2/3)
[elogind.git]
/
src
/
basic
/
time-util.h
diff --git
a/src/basic/time-util.h
b/src/basic/time-util.h
index a0c850b08386b23c8a6527e223f1c44bc357350b..d5c567eafaed03d1e5cfe9921e41aa8e45742494 100644
(file)
--- a/
src/basic/time-util.h
+++ b/
src/basic/time-util.h
@@
-21,8
+21,9
@@
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
-#include <stdio.h>
#include <inttypes.h>
#include <inttypes.h>
+#include <stdio.h>
+#include <time.h>
typedef uint64_t usec_t;
typedef uint64_t nsec_t;
typedef uint64_t usec_t;
typedef uint64_t nsec_t;
@@
-103,6
+104,7
@@
char *format_timespan(char *buf, size_t l, usec_t t, usec_t accuracy);
// UNNEEDED int parse_timestamp(const char *t, usec_t *usec);
int parse_sec(const char *t, usec_t *usec);
// UNNEEDED int parse_timestamp(const char *t, usec_t *usec);
int parse_sec(const char *t, usec_t *usec);
+int parse_time(const char *t, usec_t *usec, usec_t default_unit);
// UNNEEDED int parse_nsec(const char *t, nsec_t *nsec);
// UNNEEDED bool ntp_synced(void);
// UNNEEDED int parse_nsec(const char *t, nsec_t *nsec);
// UNNEEDED bool ntp_synced(void);
@@
-112,6
+114,13
@@
int parse_sec(const char *t, usec_t *usec);
// UNNEEDED clockid_t clock_boottime_or_monotonic(void);
// UNNEEDED clockid_t clock_boottime_or_monotonic(void);
-#define xstrftime(buf, fmt, tm) assert_se(strftime(buf, ELEMENTSOF(buf), fmt, tm) > 0)
+#define xstrftime(buf, fmt, tm) \
+ assert_message_se(strftime(buf, ELEMENTSOF(buf), fmt, tm) > 0, \
+ "xstrftime: " #buf "[] must be big enough")
// UNNEEDED int get_timezone(char **timezone);
// UNNEEDED int get_timezone(char **timezone);
+
+// UNNEEDED time_t mktime_or_timegm(struct tm *tm, bool utc);
+struct tm *localtime_or_gmtime_r(const time_t *t, struct tm *tm, bool utc);
+
+// UNNEEDED unsigned long usec_to_jiffies(usec_t usec);