6#if defined(DART_HOST_OS_LINUX) || defined(DART_HOST_OS_ANDROID)
24 perror(
"fcntl(F_GETFD) failed");
29 perror(
"fcntl(F_SETFD, FD_CLOEXEC) failed");
35static bool SetBlockingHelper(intptr_t fd,
bool blocking) {
39 perror(
"fcntl(F_GETFL) failed");
42 status = blocking ? (status & ~O_NONBLOCK) : (status | O_NONBLOCK);
44 perror(
"fcntl(F_SETFL, O_NONBLOCK) failed");
51 return SetBlockingHelper(fd,
false);
55 return SetBlockingHelper(fd,
true);
64 *is_blocking = (status & O_NONBLOCK) == 0;
75 return static_cast<intptr_t
>(available);
80 bool is_blocking =
false;
84 size_t remaining =
count;
85 char* buffer_pos =
reinterpret_cast<char*
>(
buffer);
86 while (remaining > 0) {
88 if (bytes_read == 0) {
89 return count - remaining;
90 }
else if (bytes_read == -1) {
91 ASSERT(EAGAIN == EWOULDBLOCK);
94 ASSERT(errno != EWOULDBLOCK);
98 remaining -= bytes_read;
99 buffer_pos += bytes_read;
107 bool is_blocking =
false;
111 size_t remaining =
count;
112 char* buffer_pos =
const_cast<char*
>(
reinterpret_cast<const char*
>(
buffer));
113 while (remaining > 0) {
114 ssize_t bytes_written =
116 if (bytes_written == 0) {
117 return count - remaining;
118 }
else if (bytes_written == -1) {
119 ASSERT(EAGAIN == EWOULDBLOCK);
122 ASSERT(errno != EWOULDBLOCK);
125 ASSERT(bytes_written > 0);
126 remaining -= bytes_written;
127 buffer_pos += bytes_written;
static bool read(SkStream *stream, void *buffer, size_t amount)
static intptr_t AvailableBytes(intptr_t fd)
static bool SetCloseOnExec(intptr_t fd)
static bool SetBlocking(intptr_t fd)
static bool IsBlocking(intptr_t fd, bool *is_blocking)
static bool SetNonBlocking(intptr_t fd)
static void SaveErrorAndClose(intptr_t fd)
static ssize_t ReadFromBlocking(int fd, void *buffer, size_t count)
static ssize_t WriteToBlocking(int fd, const void *buffer, size_t count)
DEF_SWITCHES_START aot vmservice shared library Name of the *so containing AOT compiled Dart assets for launching the service isolate vm snapshot The VM snapshot data that will be memory mapped as read only SnapshotAssetPath must be present isolate snapshot The isolate snapshot data that will be memory mapped as read only SnapshotAssetPath must be present cache dir Path to the cache directory This is different from the persistent_cache_path in embedder which is used for Skia shader cache icu native lib Path to the library file that exports the ICU data vm service The hostname IP address on which the Dart VM Service should be served If not defaults to or::depending on whether ipv6 is specified vm service A custom Dart VM Service port The default is to pick a randomly available open port disable vm Disable the Dart VM Service The Dart VM Service is never available in release mode disable vm service Disable mDNS Dart VM Service publication Bind to the IPv6 localhost address for the Dart VM Service Ignored if vm service host is set endless trace buffer
#define NO_RETRY_EXPECTED(expression)
#define TEMP_FAILURE_RETRY(expression)
void write(SkWStream *wStream, const T &text)