diff options
Diffstat (limited to '')
-rw-r--r-- | libnetdata/procfile/procfile.h (renamed from src/procfile.h) | 30 |
1 files changed, 6 insertions, 24 deletions
diff --git a/src/procfile.h b/libnetdata/procfile/procfile.h index 012c6efe1..b107358ab 100644 --- a/src/procfile.h +++ b/libnetdata/procfile/procfile.h @@ -1,31 +1,10 @@ -/* - * procfile is a library for reading kernel files from /proc - * - * The idea is this: - * - * - every file is opened once with procfile_open(). - * - * - to read updated contents, we rewind it (lseek() to 0) and read again - * with procfile_readall(). - * - * - for every file, we use a buffer that is adjusted to fit its entire - * contents in memory, allowing us to read it with a single read() call. - * (this provides atomicity / consistency on the data read from the kernel) - * - * - once the data are read, we update two arrays of pointers: - * - a words array, pointing to each word in the data read - * - a lines array, pointing to the first word for each line - * - * This is highly optimized. Both arrays are automatically adjusted to - * fit all contents and are updated in a single pass on the data: - * - a raspberry Pi can process 5.000+ files / sec. - * - a J1900 celeron processor can process 23.000+ files / sec. -*/ - +// SPDX-License-Identifier: GPL-3.0-or-later #ifndef NETDATA_PROCFILE_H #define NETDATA_PROCFILE_H 1 +#include "../libnetdata.h" + // ---------------------------------------------------------------------------- // An array of words @@ -103,6 +82,9 @@ extern char *procfile_filename(procfile *ff); // ---------------------------------------------------------------------------- +// set to the O_XXXX flags, to have procfile_open and procfile_reopen use them when opening proc files +extern int procfile_open_flags; + // set this to 1, to have procfile adapt its initial buffer allocation to the max allocation used so far extern int procfile_adaptive_initial_allocation; |