diff options
author | Franck Bui <fbui@suse.com> | 2019-10-22 16:09:21 +0200 |
---|---|---|
committer | Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> | 2019-10-25 15:24:49 +0200 |
commit | 21b40f16622f171a9969dc334d74fb5eb2f575c2 (patch) | |
tree | ea2e335a4330b93c25a35075ebe82edaf72a3242 /units/systemd-journald.service.in | |
parent | Merge pull request #13682 from zachsmith/systemd-sleep-prefer-resume-over-pri... (diff) | |
download | systemd-21b40f16622f171a9969dc334d74fb5eb2f575c2.tar.xz systemd-21b40f16622f171a9969dc334d74fb5eb2f575c2.zip |
fileio: introduce read_full_virtual_file() for reading virtual files in sysfs, procfs
Virtual filesystems such as sysfs or procfs use kernfs, and kernfs can work
with two sorts of virtual files.
One sort uses "seq_file", and the results of the first read are buffered for
the second read. The other sort uses "raw" reads which always go direct to the
device.
In the later case, the content of the virtual file must be retrieved with a
single read otherwise subsequent read might get the new value instead of
finding EOF immediately. That's the reason why the usage of fread(3) is
prohibited in this case as it always performs a second call to read(2) looking
for EOF which is subject to the race described previously.
Fixes: #13585.
Diffstat (limited to 'units/systemd-journald.service.in')
0 files changed, 0 insertions, 0 deletions