| Index: runtime/bin/platform_linux.cc
|
| diff --git a/runtime/bin/platform_linux.cc b/runtime/bin/platform_linux.cc
|
| index 4771b665afe8b815dd62d865f22fa9770860ac4c..679f79cf3c242cab7bf5f98f5d05cc3762e564cb 100644
|
| --- a/runtime/bin/platform_linux.cc
|
| +++ b/runtime/bin/platform_linux.cc
|
| @@ -4,6 +4,7 @@
|
|
|
| #include "bin/platform.h"
|
|
|
| +#include <string.h>
|
| #include <unistd.h>
|
|
|
|
|
| @@ -15,3 +16,16 @@ int Platform::NumberOfProcessors() {
|
| const char* Platform::OperatingSystem() {
|
| return "linux";
|
| }
|
| +
|
| +
|
| +char* Platform::StrError(int error_code) {
|
| + static const int kBufferSize = 1024;
|
| + char* error = static_cast<char*>(malloc(kBufferSize));
|
| + error[0] = '\0';
|
| + char* error_str = strerror_r(error_code, error, kBufferSize);
|
| + if (error_str != error) {
|
| + size_t written = snprintf(error, kBufferSize, "%s", error_str);
|
| + ASSERT(written == strlen(error_str));
|
| + }
|
| + return error;
|
| +}
|
|
|