summaryrefslogtreecommitdiff
path: root/src/basic/time-util.h
Commit message (Collapse)AuthorAge
* Parse "timeout=0" as infinity in various generators (#6264)Zbigniew Jędrzejewski-Szmek2017-07-25
| | | | | | | | | | | | | This extends 2d79a0bbb9f651656384a0a86ed814e6306fb5dd to the kernel command line parsing. The parsing is changed a bit to only understand "0" as infinity. If units are specified, parse normally, e.g. "0s" is just 0. This makes it possible to provide a zero timeout if necessary. Simple test is added. Fixes https://bugzilla.redhat.com/show_bug.cgi?id=1462378.
* time-util: add new call usec_shift_clock() for converting times between clocksLennart Poettering2017-07-25
| | | | We use that quite often, let's implement one clean version of it.
* time-util: rename usec_sub() to usec_sub_signed() and add usec_sub_unsigned()Lennart Poettering2017-07-25
| | | | | Quite often we just want to subtract two normal usec_t values, hence provide an implementation for that.
* time-util: refuse formatting/parsing times that we can't storeLennart Poettering2017-07-17
| | | | | | | | | | | usec_t is always 64bit, which means it can cover quite a number of years. However, 4 digit year display and glibc limitations around time_t limit what we can actually parse and format. Let's make this explicit, so that we never end up formatting dates we can#t parse and vice versa. Note that this is really just about formatting/parsing. Internal calculations with times outside of the formattable range are not affected.
* tree-wide: add PRI_[NU]SEC, and use time format strings moreZbigniew Jędrzejewski-Szmek2017-07-17
|
* Prep v232.2: Mask more unneeded functionsSven Eden2017-07-07
|
* time-util: export timespec_load_nsec()Ivan Shapovalov2017-07-05
|
* util-lib: make timestamp generation and parsing reversible (#3869)Lennart Poettering2017-07-05
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch improves parsing and generation of timestamps and calendar specifications in two ways: - The week day is now always printed in the abbreviated English form, instead of the locale's setting. This makes sure we can always parse the week day again, even if the locale is changed. Given that we don't follow locale settings for printing timestamps in any other way either (for example, we always use 24h syntax in order to make uniform parsing possible), it only makes sense to also stick to a generic, non-localized form for the timestamp, too. - When parsing a timestamp, the local timezone (in its DST or non-DST name) may be specified, in addition to "UTC". Other timezones are still not supported however (not because we wouldn't want to, but mostly because libc offers no nice API for that). In itself this brings no new features, however it ensures that any locally formatted timestamp's timezone is also parsable again. These two changes ensure that the output of format_timestamp() may always be passed to parse_timestamp() and results in the original input. The related flavours for usec/UTC also work accordingly. Calendar specifications are extended in a similar way. The man page is updated accordingly, in particular this removes the claim that timestamps elogind prints wouldn't be parsable by elogind. They are now. The man page previously showed invalid timestamps as examples. This has been removed, as the man page shouldn't be a unit test, where such negative examples would be useful. The man page also no longer mentions the names of internal functions, such as format_timestamp_us() or UNIX error codes such as EINVAL.
* Prep v231: Apply missing fixes from upstream (1/6) src/basicSven Eden2017-06-16
|
* Prep v230: Apply missing upstream fixes and updates (2/8) src/basic.Sven Eden2017-06-16
|
* Prep v229: Add missing fixes from upstream [1/6] src/basicSven Eden2017-05-17
|
* tree-wide: remove Emacs lines from all filesDaniel Mack2017-05-17
| | | | | This should be handled fine now by .dir-locals.el, so need to carry that stuff in every file.
* util: add check that makes sure time_t and TIME_T_MAX work the way we assume ↵Lennart Poettering2017-05-17
| | | | they do
* basic: include only what we useThomas Hindoe Paaboel Andersen2017-05-17
| | | | | This is a cleaned up result of running iwyu but without forward declarations on src/basic.
* Prep v228: Condense elogind source masks (3/5)Sven Eden2017-04-26
|
* Prep v228: Substitute declaration masks (3/4)Sven Eden2017-04-26
|
* Prep v228: Add remaining updates from upstream (2/3)Sven Eden2017-04-26
| | | | | Apply remaining fixes and the performed move of utility functions into their own foo-util.[hc] files on libbasic.
* [1/5] Apply missing fixes from upstreamSven Eden2017-03-29
|
* Cleaned up more unneeded functions and types in:Sven Eden2017-03-14
| | | | | | | | | | | | | | | | | | | | - src/basic/ioprio.h - removed - src/basic/ring.h - removed - src/basic/capability.[hc] - cleaned - src/basic/cgroup-util.[hc] - cleaned - src/basic/hostname-util.[hc] - cleaned - src/basic/path-util.[hc] - cleaned - src/basic/socket-util.h - cleaned - src/basic/strv.[hc] - cleaned - src/basic/time-util.[hc] - cleaned - src/basic/unit-name.[hc] - cleaned - src/basic/util.[hc] - cleaned - src/libelogind/sd-bus/bus-introspect.c - cleaned - src/login/loginctl.c - cleaned - src/login/logind-dbus.c - cleaned - src/login/logind.h - cleaned - src/shared/conf-parser.[hc] - cleaned
* Prep v220: Fix src/basic/time-util.h, unmask timezone_is_valid, mask ↵Sven Eden2017-03-14
| | | | unneeded functions.
* Prep v226: Apply missing fixes and changes to src/basicSven Eden2017-03-14
|
* Prep v225: Added needed udev support and re-enabled some masked cgroup ↵Sven Eden2017-03-14
| | | | functions.
* Prep v225: Applying various fixes and changes to src/basic that got lost ↵Sven Eden2017-03-14
| | | | during git am transfer.
* Prep v224: Major cleanup of unneeded functions and some source files.Sven Eden2017-03-14
|
* Prep v221: Update and clean up build system to sync with upstreamSven Eden2017-03-14
This commit replays the moving around of source files that have been done between systemd-219 and systemd-221. Further the Makefile.am is synchronized with the upstream version and then "re-cleaned". A lot of functions, that are not used anywhere in elogind have been coated into #if 0/#endif directives to further shorten the list of dependencies. All unneeded files have been removed.