summaryrefslogtreecommitdiff
path: root/host/include/crossystem.h
diff options
context:
space:
mode:
Diffstat (limited to 'host/include/crossystem.h')
-rw-r--r--host/include/crossystem.h15
1 files changed, 14 insertions, 1 deletions
diff --git a/host/include/crossystem.h b/host/include/crossystem.h
index c116b0c2..25b9cc0b 100644
--- a/host/include/crossystem.h
+++ b/host/include/crossystem.h
@@ -10,6 +10,12 @@
extern "C" {
#endif
+#include <stddef.h>
+
+/* Recommended size for string property buffers used with
+ * VbGetSystemPropertyString(). */
+#define VB_MAX_STRING_PROPERTY ((size_t) 8192)
+
/* Reads a system property integer.
*
* Returns the property value, or -1 if error. */
@@ -19,8 +25,12 @@ int VbGetSystemPropertyInt(const char* name);
* specified size. Returned string will be null-terminated. If the
* buffer is too small, the returned string will be truncated.
*
+ * The caller can expect an un-truncated value if the size provided is
+ * at least VB_MAX_STRING_PROPERTY.
+ *
* Returns the passed buffer, or NULL if error. */
-const char* VbGetSystemPropertyString(const char* name, char* dest, int size);
+const char* VbGetSystemPropertyString(const char* name, char* dest,
+ size_t size);
/* Sets a system property integer.
*
@@ -29,6 +39,9 @@ int VbSetSystemPropertyInt(const char* name, int value);
/* Set a system property string.
*
+ * The maximum length of the value accepted depends on the specific
+ * property, not on VB_MAX_STRING_PROPERTY.
+ *
* Returns 0 if success, -1 if error. */
int VbSetSystemPropertyString(const char* name, const char* value);