summaryrefslogtreecommitdiff
path: root/base/errors_unix.cpp
diff options
context:
space:
mode:
authorSuren Baghdasaryan <surenb@google.com>2019-07-15 13:35:04 -0700
committerSuren Baghdasaryan <surenb@google.com>2019-09-30 16:53:18 +0000
commita77b327bb9c74eb3e975e1cb5b1c6359f1655cfc (patch)
tree0aaf9a43442f69b95726efd11af4308fa7590a35 /base/errors_unix.cpp
parent7c2f94bdf0df2df75e0819b1fcd3b4c58d849767 (diff)
lmkd: Change procfs read routine to handle files larger than 1 page in size
Files like /proc/zoneinfo or /proc/<pid>/status can be larger than 4KB page size. Change reread_file routine to resize read buffer whenever it is not big enough to read the entire file. Start with 1-page buffer and double its size until it's big enough to read the entire file. Read /proc/zoneinfo during initialization to initialize the buffer to a big enough size and avoid re-allocations when under memory pressure. Bug: 137010962 Test: lmkd_unit_test Change-Id: If9a5b0d27c2f4de9063f0fd0f36f908ece87dcce Signed-off-by: Suren Baghdasaryan <surenb@google.com>
Diffstat (limited to 'base/errors_unix.cpp')
0 files changed, 0 insertions, 0 deletions