Commit 65ed7a81 authored by Wez's avatar Wez Committed by Commit Bot

[Fuchsia] Migrate from __fdio_* to fdio_unsafe_* API names.

We use some unsafe FDIO-internal APIs to implement asynchronous waits
on file-descriptors.  These APIs have been renamed, and the next SDK
roll will remove the old names.

Change-Id: I234931903c579c1ae1b46f082d4e526e65b05714
Reviewed-on: https://chromium-review.googlesource.com/c/1285515
Commit-Queue: Wez <wez@chromium.org>
Reviewed-by: default avatarWez <wez@chromium.org>
Reviewed-by: default avatarFabrice de Gans-Riberi <fdegans@chromium.org>
Cr-Commit-Position: refs/heads/master@{#600558}
parent dda560bf
......@@ -5,7 +5,7 @@
#include "base/message_loop/message_pump_fuchsia.h"
#include <lib/fdio/io.h>
#include <lib/fdio/private.h>
#include <lib/fdio/unsafe.h>
#include <zircon/status.h>
#include <zircon/syscalls.h>
......@@ -112,7 +112,7 @@ void MessagePumpFuchsia::FdWatchController::OnZxHandleSignalled(
zx_handle_t handle,
zx_signals_t signals) {
uint32_t events;
__fdio_wait_end(io_, signals, &events);
fdio_unsafe_wait_end(io_, signals, &events);
// Each |watcher_| callback we invoke may stop or delete |this|. The pump has
// set |was_stopped_| to point to a safe location on the calling stack, so we
......@@ -141,7 +141,7 @@ bool MessagePumpFuchsia::FdWatchController::WaitBegin() {
// Refresh the |handle_| and |desired_signals_| from the mxio for the fd.
// Some types of fdio map read/write events to different signals depending on
// their current state, so we must do this every time we begin to wait.
__fdio_wait_begin(io_, desired_events_, &object, &trigger);
fdio_unsafe_wait_begin(io_, desired_events_, &object, &trigger);
if (async_wait_t::object == ZX_HANDLE_INVALID) {
DLOG(ERROR) << "fdio_wait_begin failed";
return false;
......@@ -153,7 +153,7 @@ bool MessagePumpFuchsia::FdWatchController::WaitBegin() {
bool MessagePumpFuchsia::FdWatchController::StopWatchingFileDescriptor() {
bool success = StopWatchingZxHandle();
if (io_) {
__fdio_release(io_);
fdio_unsafe_release(io_);
io_ = nullptr;
}
return success;
......@@ -179,7 +179,7 @@ bool MessagePumpFuchsia::WatchFileDescriptor(int fd,
controller->watcher_ = delegate;
DCHECK(!controller->io_);
controller->io_ = __fdio_fd_to_io(fd);
controller->io_ = fdio_unsafe_fd_to_io(fd);
if (!controller->io_) {
DLOG(ERROR) << "Failed to get IO for FD";
return false;
......
......@@ -40,10 +40,10 @@ fuchsia_sdk_pkg("fdio") {
"include/lib/fdio/limits.h",
"include/lib/fdio/module.modulemap",
"include/lib/fdio/namespace.h",
"include/lib/fdio/private.h",
"include/lib/fdio/remoteio.h",
"include/lib/fdio/socket.h",
"include/lib/fdio/spawn.h",
"include/lib/fdio/unsafe.h",
"include/lib/fdio/util.h",
"include/lib/fdio/vfs.h",
"include/lib/fdio/watcher.h",
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment