]> git.ipfire.org Git - thirdparty/systemd.git/commit
macro: add READ_NOW() macro for force reading of memory, making a copy
authorLennart Poettering <lennart@poettering.net>
Thu, 23 Apr 2020 08:42:01 +0000 (10:42 +0200)
committerLennart Poettering <lennart@poettering.net>
Thu, 23 Apr 2020 10:11:24 +0000 (12:11 +0200)
commited50f18c4de7ebff81bff4d0a69fe535d7b1d78b
treeb50ca66f6931dc3578f83bbe8ffd20a36a315be1
parenta5f0f46f1a517ff9b8190d9f4b26f7cf23a9ab10
macro: add READ_NOW() macro for force reading of memory, making a copy

When accessing journal files we generally are fine when values change
beneath our feet, while we are looking at them, as long as they change
from something valid to zero. This is required since we nowadays
forcibly unallocate journal files on vacuuming, to ensure they are
actually released.

However, we need to make sure that the validity checks we enforce are
done on suitable copies of the fields in the file. Thus provide a macro
that forces a copy, and disallows the compiler from merging our copy
with the actually memory where it is from.
src/basic/macro.h