libbpf_android: waitForProgsLoaded
Creating a function for this rather than having people copy/paste a loop
there.
It's very intentional that there is no timeout here. If bpfloader is
down, there is a serious problem, and we shouldn't let code move forward
in a state where it may not have been tested.
Bug: 140330870
Test: boot & use bpf/netd
Change-Id: I358d1fcf77ad5406e294dd57307bc411e2c8ad6a
diff --git a/libbpf_android/include/libbpf_android.h b/libbpf_android/include/libbpf_android.h
index cea707c..0a01c85 100644
--- a/libbpf_android/include/libbpf_android.h
+++ b/libbpf_android/include/libbpf_android.h
@@ -23,8 +23,13 @@
namespace android {
namespace bpf {
+
// BPF loader implementation. Loads an eBPF ELF object
int loadProg(const char* elfpath);
+
+// Wait for bpfloader to load BPF programs.
+void waitForProgsLoaded();
+
} // namespace bpf
} // namespace android