summaryrefslogtreecommitdiffstats
path: root/src/shared/clock-util.c (follow)
Commit message (Collapse)AuthorAgeFilesLines
* tree-wide: avoid uninitialized warning on _cleanup_ variablesLuca Boccassi2021-04-141-1/+1
| | | | | | | With some versions of the compiler, the _cleanup_ attr makes it think the variable might be freed/closed when uninitialized, even though it cannot happen. The added cost is small enough to be worth the benefit, and optimized builds will help reduce it even further.
* clock-util: modernize settimeofday() timezone callsLennart Poettering2021-02-101-26/+21
| | | | | | | Let's use structured initialization, and avoid the weird `tv_null` indirection. No changes in behaviour, just some clean-ups.
* license: LGPL-2.1+ -> LGPL-2.1-or-laterYu Watanabe2020-11-091-1/+1
|
* clock-util: trivial clean-upsLennart Poettering2020-10-221-2/+2
|
* clock-util: read timestamp from /usr/lib/clock-epochDaniel Mack2020-08-281-3/+13
| | | | | | | | | | | On systems without an RTC, systemd currently sets the clock to a compile-time epoch value, derived from the NEWS file in the repository. This is not ideal as the initial clock hence depends on the last time systemd was built, not when the image was compiled. Let's provide a different way here and look at `/usr/lib/clock-epoch`. If that file exists, it's timestamp for the last modification will be used instead of the compile-time default.
* util: split out errno related stuffLennart Poettering2019-03-141-1/+1
|
* Move various files that don't need to be in basic/ to shared/Zbigniew Jędrzejewski-Szmek2018-11-201-0/+157
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This doesn't have much effect on the final build, because we link libbasic.a into libsystemd-shared.so, so in the end, all the object built from basic/ end up in libsystemd-shared. And when the static library is linked into binaries, any objects that are included in it but are not used are trimmed. Hence, the size of output artifacts doesn't change: $ du -sb /var/tmp/inst* 54181861 /var/tmp/inst1 (old) 54207441 /var/tmp/inst1s (old split-usr) 54182477 /var/tmp/inst2 (new) 54208041 /var/tmp/inst2s (new split-usr) (The negligible change in size is because libsystemd-shared.so is bigger by a few hundred bytes. I guess it's because symbols are named differently or something like that.) The effect is on the build process, in particular partial builds. This change effectively moves the requirements on some build steps toward the leaves of the dependency tree. Two effects: - when building items that do not depend on libsystemd-shared, we build less stuff for libbasic.a (which wouldn't be used anyway, so it's a net win). - when building items that do depend on libshared, we reduce libbasic.a as a synchronization point, possibly allowing better parallelism. Method: 1. copy list of .h files from src/basic/meson.build to /tmp/basic 2. $ for i in $(grep '.h$' /tmp/basic); do echo $i; git --no-pager grep "include \"$i\"" src/basic/ 'src/lib*' 'src/nss-*' 'src/journal/sd-journal.c' |grep -v "${i%.h}.c";echo ;done | less
* build-sys: split internal basic/ library from shared/Kay Sievers2015-06-111-142/+0
| | | | | | | | | | basic/ can be used by everything cannot use anything outside of basic/ libsystemd/ can use basic/ cannot use shared/ shared/ can use libsystemd/
* remove unused includesThomas Hindoe Paaboel Andersen2015-02-231-13/+0
| | | | | | This patch removes includes that are not used. The removals were found with include-what-you-use which checks if any of the symbols from a header is in use.
* shared: correct spacing near eol in code commentsTorstein Husebø2014-12-111-2/+2
|
* core: only set the kernel's timezone when the RTC runs in local timeKay Sievers2014-07-271-7/+8
| | | | | | | | | | | | | | | | | | | We can not reliably manage any notion of local time. Every daylight saving time change or time zone change by traveling will make the time jump, and the local time might jump backwards which creates unsolvable problems with file timestamps. We will no longer tell the kernel our local time zone and leave everything set to UTC. This will effectively turn FAT timestamps into UTC timestamps. If and only if the machine is configured to read the RTC in local time mode, the kernel's time zone will be configured, but systemd-timesysnc will disable the kernel's system time to RTC syncing. In this mode, the RTC will not be managed, and external tools like Windows bootups are expected to manage the RTC's time. https://bugs.freedesktop.org/show_bug.cgi?id=81538
* clock-util: clock_[sg]et_time() -> clock_[sg]et_hwclock()Kay Sievers2014-05-241-2/+2
|
* timesyncd: only update stamp file when we are synchronizedKay Sievers2014-05-241-1/+1
| | | | | | | | Create initial stamp file with compiled-in time to prevent bootups with clocks in the future from storing invalid timestamps. At shutdown, only update the timestamp if we got an authoritative time to store.
* shared: rename hwclock.[ch] to clock-util.[ch]Kay Sievers2014-05-241-0/+154