aboutsummaryrefslogtreecommitdiff
path: root/libc/dns/net/gethostsfile.c
diff options
context:
space:
mode:
Diffstat (limited to 'libc/dns/net/gethostsfile.c')
-rw-r--r--libc/dns/net/gethostsfile.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/libc/dns/net/gethostsfile.c b/libc/dns/net/gethostsfile.c
new file mode 100644
index 000000000..ee5618ba3
--- /dev/null
+++ b/libc/dns/net/gethostsfile.c
@@ -0,0 +1,16 @@
+#include <string.h>
+#include <netdb.h>
+#include <sys/system_properties.h>
+
+#include "gethostsfile.h"
+
+const char *gethostsfile() {
+ char hosts_setting[128];
+ int prop_len = __system_property_get(AICP_HOSTS_SETTING_PROP,
+ hosts_setting);
+ if (prop_len > 0 && strncmp(hosts_setting, "true", 4) == 0) {
+ return AICP_PATH_ADBLOCK_HOSTS;
+ } else {
+ return _PATH_HOSTS;
+ }
+}