Skip setting seccomp filter when running with ASan.
Also add an example build target for an ASan-ified libminijail (useful
for debugging).
Bug: 28052772
Change-Id: Ib36a0303d635becaa8802dee56d486f11060ea47
diff --git a/util.h b/util.h
index 0cc1d15..b4efc2f 100644
--- a/util.h
+++ b/util.h
@@ -37,6 +37,14 @@
#endif
}
+static inline int running_with_asan() {
+#if defined(__clang__) && __has_feature(address_sanitizer)
+ return 1;
+#else
+ return 0;
+#endif
+}
+
int lookup_syscall(const char *name);
const char *lookup_syscall_name(int nr);
long int parse_constant(char *constant_str, char **endptr);