13 Oct
2025
13 Oct
'25
12:31 p.m.
On Mon, 13 Oct 2025 18:22:00 +0800
Yumei Huang
On Mon, Oct 13, 2025 at 8:21 AM David Gibson
wrote: On Fri, Oct 10, 2025 at 03:46:59PM +0800, Yumei Huang wrote:
+/** + * get_tcp_syn_param() - Read SYN parameters from /proc/sys + * @path: Path to the sysctl file + * @fallback: Default value if file can't be read + * + * Return: Parameter value, fallback on failure +*/ +int get_tcp_syn_param(const char *path, int fallback)
I wonder if it might be worth making a new function in util.c to read a file containing a single number.
I can do that. So it could be reused in the future.
If it helps: we already have write_file(), so it might be worth adding a read_file() symmetric to it. Maybe it's overkill though. -- Stefano