Files
sdk/runtime/bin/stdio_fuchsia.cc
T
Zach Anderson 3ad0571cf9 [fuchsia] Fixes for the Fuchsia build
Makes public some include paths needed for the dart_runner to depend on
dart_io.

Also updates some dart:io implementations to give and OSError
instead of crashing when something is unimplemented.

Change-Id: I862fc7cc43f56e74de791ecc021b88238b54a8e5
Reviewed-on: https://dart-review.googlesource.com/c/84920
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Commit-Queue: Zach Anderson <zra@google.com>
2018-11-26 16:30:33 +00:00

66 lines
1.3 KiB
C++

// Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
#include "platform/globals.h"
#if defined(HOST_OS_FUCHSIA)
#include "bin/stdio.h"
#include <errno.h>
#include "platform/signal_blocker.h"
namespace dart {
namespace bin {
bool Stdin::ReadByte(intptr_t fd, int* byte) {
unsigned char b;
ssize_t s = TEMP_FAILURE_RETRY(read(fd, &b, 1));
if (s < 0) {
return false;
}
*byte = (s == 0) ? -1 : b;
return true;
}
bool Stdin::GetEchoMode(intptr_t fd, bool* enabled) {
errno = ENOSYS;
return false;
}
bool Stdin::SetEchoMode(intptr_t fd, bool enabled) {
errno = ENOSYS;
return false;
}
bool Stdin::GetLineMode(intptr_t fd, bool* enabled) {
errno = ENOSYS;
return false;
}
bool Stdin::SetLineMode(intptr_t fd, bool enabled) {
errno = ENOSYS;
return false;
}
bool Stdin::AnsiSupported(intptr_t fd, bool* supported) {
*supported = false;
return true;
}
bool Stdout::GetTerminalSize(intptr_t fd, int size[2]) {
errno = ENOSYS;
return false;
}
bool Stdout::AnsiSupported(intptr_t fd, bool* supported) {
*supported = false;
return true;
}
} // namespace bin
} // namespace dart
#endif // defined(HOST_OS_FUCHSIA)