Merge "Always use `__foo__` for attribute names." into main
diff --git a/libc/bionic/system_property_set.cpp b/libc/bionic/system_property_set.cpp
index 6e49bce..73cf151 100644
--- a/libc/bionic/system_property_set.cpp
+++ b/libc/bionic/system_property_set.cpp
@@ -257,6 +257,21 @@
}
}
+static const char* __prop_error_to_string(int error) {
+ switch (error) {
+ case PROP_ERROR_READ_CMD: return "PROP_ERROR_READ_CMD";
+ case PROP_ERROR_READ_DATA: return "PROP_ERROR_READ_DATA";
+ case PROP_ERROR_READ_ONLY_PROPERTY: return "PROP_ERROR_READ_ONLY_PROPERTY";
+ case PROP_ERROR_INVALID_NAME: return "PROP_ERROR_INVALID_NAME";
+ case PROP_ERROR_INVALID_VALUE: return "PROP_ERROR_INVALID_VALUE";
+ case PROP_ERROR_PERMISSION_DENIED: return "PROP_ERROR_PERMISSION_DENIED";
+ case PROP_ERROR_INVALID_CMD: return "PROP_ERROR_INVALID_CMD";
+ case PROP_ERROR_HANDLE_CONTROL_MESSAGE: return "PROP_ERROR_HANDLE_CONTROL_MESSAGE";
+ case PROP_ERROR_SET_FAILED: return "PROP_ERROR_SET_FAILED";
+ }
+ return "<unknown>";
+}
+
__BIONIC_WEAK_FOR_NATIVE_BRIDGE
int __system_property_set(const char* key, const char* value) {
if (key == nullptr) return -1;
@@ -310,8 +325,8 @@
if (result != PROP_SUCCESS) {
async_safe_format_log(ANDROID_LOG_WARN, "libc",
- "Unable to set property \"%s\" to \"%s\": error code: 0x%x", key, value,
- result);
+ "Unable to set property \"%s\" to \"%s\": %s (0x%x)", key, value,
+ __prop_error_to_string(result), result);
return -1;
}
diff --git a/libc/include/unistd.h b/libc/include/unistd.h
index c69db61..2732214 100644
--- a/libc/include/unistd.h
+++ b/libc/include/unistd.h
@@ -350,8 +350,11 @@
int daemon(int __no_chdir, int __no_close);
#if defined(__arm__)
+/**
+ * New code should use __builtin___clear_cache() instead, which works on
+ * all architectures.
+ */
int cacheflush(long __addr, long __nbytes, long __cache);
- /* __attribute__((deprecated("use __builtin___clear_cache instead"))); */
#endif
pid_t tcgetpgrp(int __fd);