1
0
mirror of https://sourceware.org/git/glibc.git synced 2025-08-08 17:42:12 +03:00

resolv: Enhance __resolv_conf_load to capture file change data

The data is captured after reading the file.  This allows callers
to check the change data against an earlier measurement.

Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
This commit is contained in:
Florian Weimer
2020-01-21 17:25:39 +01:00
parent a1a20f0292
commit dd0b4df329
3 changed files with 19 additions and 7 deletions

View File

@@ -63,12 +63,16 @@ struct resolv_conf
and the struct resolv_context facility. */
struct __res_state;
struct file_change_detection;
/* Read /etc/resolv.conf and return a configuration object, or NULL if
/etc/resolv.conf cannot be read due to memory allocation errors.
If PREINIT is not NULL, some configuration values are taken from the
struct __res_state object. */
struct resolv_conf *__resolv_conf_load (struct __res_state *preinit)
If PREINIT is not NULL, some configuration values are taken from
the struct __res_state object. If CHANGE is not null, file change
detection data is written to *CHANGE, based on the state of the
file after reading it. */
struct resolv_conf *__resolv_conf_load (struct __res_state *preinit,
struct file_change_detection *change)
attribute_hidden __attribute__ ((warn_unused_result));
/* Return a configuration object for the current /etc/resolv.conf