Merge remote-tracking branch 'ianloic/merge-openssh-7.8p1' into merge-i

Change-Id: Iaced1dd4117bfc43a65364c3177a8a09f0babc95
diff --git a/fuchsia/fuchsia-compat.c b/fuchsia/fuchsia-compat.c
index d52b2a8..02635b1 100644
--- a/fuchsia/fuchsia-compat.c
+++ b/fuchsia/fuchsia-compat.c
@@ -13,7 +13,7 @@
 #include <unistd.h>
 
 #include <lib/fdio/io.h>
-#include <lib/fdio/private.h>
+#include <lib/fdio/unsafe.h>
 #include <lib/fdio/spawn.h>
 #include <zircon/status.h>
 #include <zircon/syscalls.h>
@@ -423,7 +423,7 @@
 
 		fdio_t* io;
 		// This acquires a reference to the fdio which is released in the cleanup path below.
-		if ((io = __fdio_fd_to_io(fd)) == NULL) {
+		if ((io = fdio_unsafe_fd_to_io(fd)) == NULL) {
 			errno = EBADF;
 			ret = -1;
 			goto cleanup;
@@ -432,7 +432,7 @@
 		zx_handle_t h;
 		zx_signals_t sigs;
 		// Translate the poll-style events to fdio-specific signal bits to wait on.
-		__fdio_wait_begin(io, events, &h, &sigs);
+		fdio_unsafe_wait_begin(io, events, &h, &sigs);
 		if (h == ZX_HANDLE_INVALID) {
 			errno = EBADF;
 			ret = -1;
@@ -476,8 +476,8 @@
 				ret = -1;
 				goto cleanup;
 			}
-			// __fdio_wait_end translates the signals back to poll-style flags.
-			__fdio_wait_end(io, packet.signal.observed, &events);
+			// fdio_unsafe_wait_end translates the signals back to poll-style flags.
+			fdio_unsafe_wait_end(io, packet.signal.observed, &events);
 			if (readfds_fd_set && FD_ISSET(fd, readfds_fd_set)) {
 				if (events & POLLIN)
 					ret++;
@@ -493,7 +493,7 @@
 			// The read and write sets for this fd are now updated, and our wait has expired, so
 			// remove this fd from the set of things we care about.
 			ios[fd] = NULL;
-			__fdio_release(io);
+			fdio_unsafe_release(io);
 		} else if (st == ZX_ERR_TIMED_OUT) {
 			break;
 		} else {
@@ -524,10 +524,10 @@
 	}
 
 cleanup:
-	// Release reference to any fdio objects we acquired with __fdio_fd_to_io().
+	// Release reference to any fdio objects we acquired with fdio_unsafe_fd_to_io().
 	for (int fd = 0; fd < nfds; ++fd) {
 		if (ios[fd]) {
-			__fdio_release(ios[fd]);
+			fdio_unsafe_release(ios[fd]);
 		}
 	}