6#if defined(DART_HOST_OS_LINUX) || defined(DART_HOST_OS_ANDROID)
24void OSError::Reload() {
25 SetCodeAndMessage(kSystem, errno);
28void OSError::SetCodeAndMessage(SubSystem sub_system,
int code) {
29 set_sub_system(sub_system);
31 if (sub_system == kSystem) {
35 }
else if (sub_system == kGetAddressInfo) {
36 SetMessage(gai_strerror(
code));
42const char* StringUtils::ConsoleStringToUtf8(
const char* str,
44 intptr_t* result_len) {
48const char* StringUtils::Utf8ToConsoleString(
const char*
utf8,
50 intptr_t* result_len) {
54char* StringUtils::ConsoleStringToUtf8(
char* str,
56 intptr_t* result_len) {
60char* StringUtils::Utf8ToConsoleString(
char*
utf8,
62 intptr_t* result_len) {
66bool ShellUtils::GetUtf8Argv(
int argc,
char**
argv) {
72int64_t TimerUtils::GetCurrentMonotonicMillis() {
73 return GetCurrentMonotonicMicros() / 1000;
76int64_t TimerUtils::GetCurrentMonotonicMicros() {
78 if (clock_gettime(CLOCK_MONOTONIC, &ts) != 0) {
83 int64_t
result = ts.tv_sec;
89void TimerUtils::Sleep(int64_t millis) {
99 int r = nanosleep(&req, &rem);
static const size_t kBufferSize
constexpr uint64_t kMicrosecondsPerMillisecond
static constexpr int kMicrosecondsPerSecond
bool InitOnce(char **error)
constexpr intptr_t kNanosecondsPerMicrosecond