diff options
author | Lennart Poettering <lennart@poettering.net> | 2021-02-19 18:29:13 +0100 |
---|---|---|
committer | Lennart Poettering <lennart@poettering.net> | 2021-02-19 18:29:13 +0100 |
commit | 1cf36084a7860c60d68d59b466083a79dfb2376a (patch) | |
tree | 308fcf39efc5c63f5f0c8cd4dec4599bfa1acf34 | |
parent | Merge pull request #18703 from poettering/cgroupsv1-bad (diff) | |
download | systemd-1cf36084a7860c60d68d59b466083a79dfb2376a.tar.xz systemd-1cf36084a7860c60d68d59b466083a79dfb2376a.zip |
fileio: extend comment about file sizes in virtual file systems
-rw-r--r-- | src/basic/fileio.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/basic/fileio.c b/src/basic/fileio.c index 21532515fb..15f0ffbdfa 100644 --- a/src/basic/fileio.c +++ b/src/basic/fileio.c @@ -385,7 +385,9 @@ int read_full_virtual_file(const char *filename, char **ret_contents, size_t *re if (fd < 0) return -errno; - /* Start size for files in /proc which usually report a file size of 0. */ + /* Start size for files in /proc/ which usually report a file size of 0. (Files in /sys/ report a + * file size of 4K, which is probably OK for sizing our initial buffer, and sysfs attributes can't be + * larger anyway.) */ size = LINE_MAX / 2; /* Limit the number of attempts to read the number of bytes returned by fstat(). */ |