bionic: add compatibility mode for properties

Allow a new bionic to work with an old init property area by supporting
the old format.

(cherry picked from commit ad76c85b9ca587084089d086f954158bc0eae905)

Change-Id: Ib496e818a62a5834d40c71eb4745783d998be893
diff --git a/libc/include/sys/_system_properties.h b/libc/include/sys/_system_properties.h
index 92e35e1..5eee7f0 100644
--- a/libc/include/sys/_system_properties.h
+++ b/libc/include/sys/_system_properties.h
@@ -38,6 +38,7 @@
 
 #define PROP_AREA_MAGIC   0x504f5250
 #define PROP_AREA_VERSION 0xfc6ed0ab
+#define PROP_AREA_VERSION_COMPAT 0x45434f76
 
 #define PROP_SERVICE_NAME "property_service"
 #define PROP_FILENAME "/dev/__properties__"
@@ -129,6 +130,15 @@
 ** successive call. */
 unsigned int __system_property_wait_any(unsigned int serial);
 
+/*  Compatibility functions to support using an old init with a new libc,
+ ** mostly for the OTA updater binary.  These can be deleted once OTAs from
+ ** a pre-K release no longer needed to be supported. */
+const prop_info *__system_property_find_compat(const char *name);
+int __system_property_read_compat(const prop_info *pi, char *name, char *value);
+int __system_property_foreach_compat(
+        void (*propfn)(const prop_info *pi, void *cookie),
+        void *cookie);
+
 __END_DECLS
 
 #endif