From 40e57b76988eedf4b12be9fb5f173a87f164b321 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=8E=E9=80=9A=E6=B4=B2?= Date: Mon, 30 Jun 2025 19:16:08 +0800 Subject: [PATCH] IO: increase `PROC_FILE_BUFFSIZ` to avoid possible short reads --- src/common/io/io.h | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/common/io/io.h b/src/common/io/io.h index bfa372111..2bb6e6e23 100644 --- a/src/common/io/io.h +++ b/src/common/io/io.h @@ -19,8 +19,7 @@ #define FF_INVALID_FD (-1) // procfs's file can be changed between read calls such as /proc/meminfo and /proc/uptime. // one safe way to read correct data is reading the whole file in a single read syscall - // 8192 comes from procps-ng: https://gitlab.com/procps-ng/procps/-/blob/master/library/meminfo.c?ref_type=heads#L39 - #define PROC_FILE_BUFFSIZ 8192 + #define PROC_FILE_BUFFSIZ (32 * 1024) #endif static inline FFNativeFD FFUnixFD2NativeFD(int unixfd)