Index: runtime/platform/utils_macos.h |
diff --git a/runtime/platform/utils_macos.h b/runtime/platform/utils_macos.h |
index 3fa2984991dbbaa79f25bf36714dd43e60f9cc22..7c2a966db9d99f7ca3587224946e9ee0023c907e 100644 |
--- a/runtime/platform/utils_macos.h |
+++ b/runtime/platform/utils_macos.h |
@@ -60,6 +60,13 @@ inline uint64_t Utils::HostToLittleEndian64(uint64_t value) { |
return OSSwapHostToLittleInt64(value); |
} |
+inline char* Utils::StrError(int err, char* buffer, size_t bufsize) { |
+ if (strerror_r(err, buffer, bufsize) != 0) { |
+ snprintf(buffer, bufsize, "%s", "strerror_r failed"); |
+ } |
+ return buffer; |
+} |
+ |
} // namespace dart |
#endif // PLATFORM_UTILS_MACOS_H_ |