Rename Magenta to Zircon

Change-Id: Ifc449fdddf067bb041f1aba6820b521320778bbd
diff --git a/fuchsia/README.md b/fuchsia/README.md
index 83e60da..36e19e4 100644
--- a/fuchsia/README.md
+++ b/fuchsia/README.md
@@ -11,7 +11,7 @@
 
 ```
 ssh -F $FUCHSIA_BUILD_DIR/ssh-keys/ssh_config \
-  $($FUCHSIA_OUT_DIR/build-magenta/tools/netaddr --fuchsia)
+  $($FUCHSIA_OUT_DIR/build-zircon/tools/netaddr --fuchsia)
 ```
 
 Similarly you can `scp` or `sftp` using the same config file. Note that
@@ -19,11 +19,11 @@
 
 ```
 sftp -F $FUCHSIA_BUILD_DIR/ssh-keys/ssh_config \
-  [$($FUCHSIA_OUT_DIR/build-magenta/tools/netaddr --fuchsia)]
+  [$($FUCHSIA_OUT_DIR/build-zircon/tools/netaddr --fuchsia)]
 
 scp -F $FUCHSIA_BUILD_DIR/ssh-keys/ssh_config \
   /local/path/file.txt \
-  [$($FUCHSIA_OUT_DIR/build-magenta/tools/netaddr --fuchsia)]:/remote/path
+  [$($FUCHSIA_OUT_DIR/build-zircon/tools/netaddr --fuchsia)]:/remote/path
 ```
 
 *NOTE 1*: Transfers of large files will stall and eventually fail. The cause is
diff --git a/fuchsia/fuchsia-compat.c b/fuchsia/fuchsia-compat.c
index d98dc56..666c219 100644
--- a/fuchsia/fuchsia-compat.c
+++ b/fuchsia/fuchsia-compat.c
@@ -3,8 +3,8 @@
 // found in the LICENSE file.
 
 #include <launchpad/launchpad.h>
-#include <magenta/syscalls.h>
-#include <mxio/io.h>
+#include <zircon/syscalls.h>
+#include <fdio/io.h>
 #include <pthread.h>
 #include <pwd.h>
 #include <assert.h>
@@ -31,7 +31,7 @@
   static struct passwd static_passwd = {
       .pw_name = "fuchsia",
       .pw_passwd = "",
-      .pw_uid = 23,  // matches MX_UID
+      .pw_uid = 23,  // matches ZX_UID
       .pw_gid = 23,
       .pw_gecos = "Fuchsia",
       .pw_dir = "/",
@@ -53,7 +53,7 @@
 
 typedef struct {
   enum { UNUSED, RUNNING, STOPPED } state;
-  mx_handle_t handle;
+  zx_handle_t handle;
   int exit_code;
 } Child;
 
@@ -82,12 +82,12 @@
 static void* wait_thread_func(void* voidp) {
   Child* child = voidp;
 
-  mx_signals_t observed;
-  mx_object_wait_one(child->handle, MX_PROCESS_TERMINATED, MX_TIME_INFINITE, &observed);
+  zx_signals_t observed;
+  zx_object_wait_one(child->handle, ZX_PROCESS_TERMINATED, ZX_TIME_INFINITE, &observed);
 
-  mx_info_process_t info;
+  zx_info_process_t info;
   size_t actual;
-  mx_object_get_info(child->handle, MX_INFO_PROCESS, &info, sizeof(info), &actual, NULL);
+  zx_object_get_info(child->handle, ZX_INFO_PROCESS, &info, sizeof(info), &actual, NULL);
 
   child->state = STOPPED;
   child->exit_code = info.return_code;
@@ -107,7 +107,7 @@
   uint32_t events;
   size_t offset = 0;
   while (offset < length) {
-    if (mxio_wait_fd(fd, MXIO_EVT_WRITABLE, &events, MX_TIME_INFINITE) < 0) {
+    if (fdio_wait_fd(fd, FDIO_EVT_WRITABLE, &events, ZX_TIME_INFINITE) < 0) {
       // Wait failed.
       return false;
     }
@@ -129,7 +129,7 @@
 
   for (;;) {
     uint32_t events;
-    if (mxio_wait_fd(fds[0], MXIO_EVT_READABLE, &events, MX_TIME_INFINITE) < 0) {
+    if (fdio_wait_fd(fds[0], FDIO_EVT_READABLE, &events, ZX_TIME_INFINITE) < 0) {
       // Wait failed.
       break;
     }
@@ -190,7 +190,7 @@
 
   for (;;) {
     uint32_t events;
-    if (mxio_wait_fd(fds[0], MXIO_EVT_READABLE, &events, MX_TIME_INFINITE) < 0) {
+    if (fdio_wait_fd(fds[0], FDIO_EVT_READABLE, &events, ZX_TIME_INFINITE) < 0) {
       // Wait failed.
       break;
     }
@@ -296,7 +296,7 @@
   launchpad_create(0, command, &lp);
   launchpad_load_from_file(lp, argv[0]);
   launchpad_set_args(lp, argc, argv);
-  launchpad_clone(lp, LP_CLONE_MXIO_NAMESPACE | LP_CLONE_MXIO_CWD);
+  launchpad_clone(lp, LP_CLONE_FDIO_NAMESPACE | LP_CLONE_FDIO_CWD);
   // TODO: set up environment
   if (in == out) {
     launchpad_clone_fd(lp, in, STDIN_FILENO);
@@ -310,10 +310,10 @@
   }
   launchpad_transfer_fd(lp, err, STDERR_FILENO);
 
-  mx_handle_t proc = 0;
+  zx_handle_t proc = 0;
   const char* errmsg;
 
-  mx_status_t status = launchpad_go(lp, &proc, &errmsg);
+  zx_status_t status = launchpad_go(lp, &proc, &errmsg);
   if (status < 0) {
     fprintf(stderr, "error from launchpad_go: %s\n", errmsg);
     fprintf(stderr, " status=%d\n", launchpad_get_status(lp));
diff --git a/fuchsia/fuchsia-compat.h b/fuchsia/fuchsia-compat.h
index 135305a..ab4454b 100644
--- a/fuchsia/fuchsia-compat.h
+++ b/fuchsia/fuchsia-compat.h
@@ -3,7 +3,7 @@
 // found in the LICENSE file.
 
 #pragma once
-#include <magenta/types.h>
+#include <zircon/types.h>
 
 int chroot(const char *path);
 int fuchsia_launch_child(const char *command, int in, int out, int err, bool transform);
diff --git a/openbsd-compat/bsd-closefrom.c b/openbsd-compat/bsd-closefrom.c
index a7aa4b3..a05ab87 100644
--- a/openbsd-compat/bsd-closefrom.c
+++ b/openbsd-compat/bsd-closefrom.c
@@ -48,7 +48,7 @@
 #endif
 
 #ifdef __Fuchsia__
-#include <mxio/limits.h>
+#include <fdio/limits.h>
 #endif
 
 #ifndef OPEN_MAX
@@ -100,7 +100,7 @@
 #ifdef HAVE_SYSCONF
 	maxfd = sysconf(_SC_OPEN_MAX);
 #elif __Fuchsia__
-        maxfd = MAX_MXIO_FD;
+        maxfd = MAX_FDIO_FD;
 #else
 	maxfd = getdtablesize();
 #endif /* HAVE_SYSCONF */
diff --git a/sshpty.c b/sshpty.c
index a5f8f34..76efba2 100644
--- a/sshpty.c
+++ b/sshpty.c
@@ -54,7 +54,7 @@
 #endif
 
 #ifdef __Fuchsia__
-#include <magenta/device/pty.h>
+#include <zircon/device/pty.h>
 #endif  // __Fuchsia__
 
 /*