Remove limit of system property name length
This change introduces new __system_property_read_callback
method to use in place of deprecated __system_property_read
__system_property_set() and get() should just work but now
do not have limit on system property names.
Bug: http://b/33926793
Test: boot device, run adb shell propget
Test: boot device with old version of init (protocol v1)
Test: run bionic-unit-tests --gtest_filter=prop*
Change-Id: I619fb5a7e27a272aac30011579665f6160888bc7
diff --git a/libc/include/sys/system_properties.h b/libc/include/sys/system_properties.h
index faed9a0..d80b2fe 100644
--- a/libc/include/sys/system_properties.h
+++ b/libc/include/sys/system_properties.h
@@ -30,6 +30,7 @@
#define _INCLUDE_SYS_SYSTEM_PROPERTIES_H
#include <sys/cdefs.h>
+#include <stddef.h>
__BEGIN_DECLS
@@ -64,13 +65,17 @@
/* Read the value of a system property. Returns the length
** of the value. Copies the value and \0 terminator into
** the provided value pointer. Total length (including
-** terminator) will be no greater that PROP_VALUE_MAX.
+** terminator) will be no greater that PROP_VALUE_MAX for
+** __system_property_read.
**
** If name is nonzero, up to PROP_NAME_MAX bytes will be
** copied into the provided name pointer. The name will
** be \0 terminated.
*/
int __system_property_read(const prop_info *pi, char *name, char *value);
+void __system_property_read_callback(const prop_info *pi,
+ void (*)(void* cookie, const char *name, const char *value),
+ void* cookie) __INTRODUCED_IN_FUTURE;
/* Return a prop_info for the nth system property, or NULL if
** there is no nth property. Use __system_property_read() to