6#if defined(DART_HOST_OS_MACOS)
11#include <mach/mach_time.h>
27void OSError::Reload() {
28 SetCodeAndMessage(kSystem, errno);
31void OSError::SetCodeAndMessage(SubSystem sub_system,
int code) {
32 set_sub_system(sub_system);
34 if (sub_system == kSystem) {
38 SetMessage(error_message);
39 }
else if (sub_system == kGetAddressInfo) {
40 SetMessage(gai_strerror(
code));
46const char* StringUtils::ConsoleStringToUtf8(
const char* str,
48 intptr_t* result_len) {
52const char* StringUtils::Utf8ToConsoleString(
const char*
utf8,
54 intptr_t* result_len) {
58char* StringUtils::ConsoleStringToUtf8(
char* str,
60 intptr_t* result_len) {
64char* StringUtils::Utf8ToConsoleString(
char*
utf8,
66 intptr_t* result_len) {
70bool ShellUtils::GetUtf8Argv(
int argc,
char**
argv) {
76int64_t TimerUtils::GetCurrentMonotonicMillis() {
77 return GetCurrentMonotonicMicros() / 1000;
80int64_t TimerUtils::GetCurrentMonotonicMicros() {
81 return clock_gettime_nsec_np(CLOCK_MONOTONIC_RAW) /
85void TimerUtils::Sleep(int64_t millis) {
95 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