[syscall/zx] always return Error as a pointer

This is the third step in transitioning the error implementation on
Error from the value type to the pointer. It is safer to implement
interfaces on pointer types for the reason evident in this chnage; an
interface implemented by a value type is also implicitly implemented by
that value's pointer type, which requires type assertions to try both
cases. On the other hand, interface implementations by the pointer type
do not imply an implementation by the type's value type.

Change-Id: I834c21d55c9339175ece03b6fa5c18b169a26ad8
diff --git a/src/internal/poll/fd_fuchsia.go b/src/internal/poll/fd_fuchsia.go
index c0333d3..152e6ca 100644
--- a/src/internal/poll/fd_fuchsia.go
+++ b/src/internal/poll/fd_fuchsia.go
@@ -219,7 +219,7 @@
 				return nil, err
 			}
 			if obs&zx.SignalSocketPeerClosed != 0 {
-				return nil, zx.Error{Status: zx.ErrPeerClosed, Text: "zxsocket"}
+				return nil, &zx.Error{Status: zx.ErrPeerClosed, Text: "zxsocket"}
 			}
 			if obs&mxnet.MXSIO_SIGNAL_INCOMING != 0 {
 				code, err = s.Accept(0)
diff --git a/src/net/error_fuchsia_test.go b/src/net/error_fuchsia_test.go
index a72a2b8..2ab6ff6 100644
--- a/src/net/error_fuchsia_test.go
+++ b/src/net/error_fuchsia_test.go
@@ -20,7 +20,7 @@
 )
 
 func isPlatformError(err error) bool {
-	_, ok := err.(zx.Error)
+	_, ok := err.(*zx.Error)
 	return ok
 }
 
diff --git a/src/net/ipsock_fuchsia.go b/src/net/ipsock_fuchsia.go
index 44d85e0..e2503af 100644
--- a/src/net/ipsock_fuchsia.go
+++ b/src/net/ipsock_fuchsia.go
@@ -162,7 +162,7 @@
 				return nil, err
 			}
 			if obs&zx.SignalSocketPeerClosed != 0 {
-				return nil, zx.Error{Status: zx.ErrPeerClosed, Text: "zxsocket"}
+				return nil, &zx.Error{Status: zx.ErrPeerClosed, Text: "zxsocket"}
 			}
 			if obs&mxnet.MXSIO_SIGNAL_OUTGOING != 0 {
 				// Call connect again to learn the result.
diff --git a/src/os/error_fuchsia.go b/src/os/error_fuchsia.go
index 2572f7e..0b89e7c 100644
--- a/src/os/error_fuchsia.go
+++ b/src/os/error_fuchsia.go
@@ -14,7 +14,7 @@
 func isExist(err error) bool {
 	err = underlyingError(err)
 	switch err := err.(type) {
-	case zx.Error:
+	case *zx.Error:
 		return err.Status == zx.ErrAlreadyExists
 	}
 	return err == syscall.EEXIST || err == syscall.ENOTEMPTY || err == ErrExist
@@ -23,7 +23,7 @@
 func isNotExist(err error) bool {
 	err = underlyingError(err)
 	switch err := err.(type) {
-	case zx.Error:
+	case *zx.Error:
 		return err.Status == zx.ErrNotFound
 	}
 	return err == syscall.ENOENT || err == ErrNotExist
@@ -32,19 +32,19 @@
 func isPermission(err error) bool {
 	err = underlyingError(err)
 	switch err := err.(type) {
-	case zx.Error:
+	case *zx.Error:
 		return err.Status == zx.ErrAccessDenied
 	}
 	return err == syscall.EACCES || err == syscall.EPERM || err == ErrPermission
 }
 
 func wrapSyscallError(name string, err error) error {
-	if zerr, ok := err.(zx.Error); ok {
+	if err, ok := err.(*zx.Error); ok {
 		text := name
-		if zerr.Text != "" {
-			text = text + ": " + zerr.Text
+		if err.Text != "" {
+			text += ": " + err.Text
 		}
-		err = zx.Error{Status: zerr.Status, Text: zerr.Text}
+		return &zx.Error{Status: err.Status, Text: text}
 	}
 	return err
 }
diff --git a/src/syscall/syscall_fuchsia.go b/src/syscall/syscall_fuchsia.go
index 1059673..b087473 100644
--- a/src/syscall/syscall_fuchsia.go
+++ b/src/syscall/syscall_fuchsia.go
@@ -47,9 +47,9 @@
 )
 
 const (
-	O_RDONLY   = 0x0
-	O_WRONLY   = 0x1
-	O_RDWR     = 0x2
+	O_RDONLY = 0x0
+	O_WRONLY = 0x1
+	O_RDWR   = 0x2
 
 	// Flags which align with ZXIO_FS_*
 	O_ADMIN     = FsRightAdmin
@@ -383,7 +383,7 @@
 		case fdio.HandleTypeRemote, fdio.HandleTypeSocket, fdio.HandleTypeLogger, fdio.HandleTypeFileDescriptor:
 			info, err := zx.StdioHandles[i].GetInfoHandleBasic()
 			if err != nil {
-				println("syscall: GetInfoHandleBasic failed", err);
+				println("syscall: GetInfoHandleBasic failed", err)
 				return nil, EINVAL
 			}
 			switch info.Type {
@@ -446,7 +446,7 @@
 	fdsMu.Unlock()
 	off, err = f.Seek(offset, whence)
 	if err != nil {
-		if status, isStatus := err.(zx.Error); isStatus {
+		if status, isStatus := err.(*zx.Error); isStatus {
 			if status.Status == zx.ErrNotSupported {
 				if _, isPipe := f.(*fdio.Pipe); isPipe {
 					return off, ESPIPE
@@ -495,13 +495,13 @@
 }
 
 func preprocessFlags(flags uint32, mode uint32) uint32 {
-	flagsIncompatibleWithDirectory := (flags & FsRightWritable != 0) || (flags & FsFlagCreate != 0)
+	flagsIncompatibleWithDirectory := (flags&FsRightWritable != 0) || (flags&FsFlagCreate != 0)
 	// Special allowance for Mkdir
-	if (flags == FsFlagCreate | FsFlagExclusive | FsRightReadable | FsRightWritable) &&
-			(mode & S_IFDIR != 0) {
+	if (flags == FsFlagCreate|FsFlagExclusive|FsRightReadable|FsRightWritable) &&
+		(mode&S_IFDIR != 0) {
 		flagsIncompatibleWithDirectory = false
 	}
-	if (flags & FsFlagDirectory) == 0 && flagsIncompatibleWithDirectory {
+	if (flags&FsFlagDirectory) == 0 && flagsIncompatibleWithDirectory {
 		flags |= FsFlagNotDirectory
 	}
 	return flags
@@ -595,7 +595,7 @@
 }
 
 func Stat(path string, stat *Stat_t) (err error) {
-	fd, err := Open(path, O_RDONLY | O_PATH, 0)
+	fd, err := Open(path, O_RDONLY|O_PATH, 0)
 	if err != nil {
 		return err
 	}
diff --git a/src/syscall/zx/dispatch/dispatcher.go b/src/syscall/zx/dispatch/dispatcher.go
index df92757..e607ae6 100644
--- a/src/syscall/zx/dispatch/dispatcher.go
+++ b/src/syscall/zx/dispatch/dispatcher.go
@@ -113,7 +113,7 @@
 
 	// If we've shut down, just notify that we're in a bad state.
 	if d.shutdown {
-		return 0, zx.Error{Status: zx.ErrBadState}
+		return 0, &zx.Error{Status: zx.ErrBadState}
 	}
 
 	// Register the wait.
@@ -143,14 +143,14 @@
 	// Look up the wait context.
 	wc := d.objects[id]
 	if wc == nil {
-		return zx.Error{Status: zx.ErrNotFound}
+		return &zx.Error{Status: zx.ErrNotFound}
 	}
 
 	// If we're currently handling it, it's not being waited on, so there's nothing
 	// to cancel.
 	_, ok := d.handling[id]
 	if ok {
-		return zx.Error{Status: zx.ErrNotFound}
+		return &zx.Error{Status: zx.ErrNotFound}
 	}
 
 	// Deregister no matter what here. Due to stack semantics of defer, this will always
@@ -181,7 +181,7 @@
 
 		// If we fail to re-arm, notify the handler of what happened.
 		if err != nil {
-			zxErr := err.(zx.Error)
+			zxErr := err.(*zx.Error)
 			result = wc.callback(d, zxErr.Status, nil)
 			assertWaitResult(result, zxErr.Status)
 		}
diff --git a/src/syscall/zx/fdio/client.go b/src/syscall/zx/fdio/client.go
index 362e512..2efd265 100644
--- a/src/syscall/zx/fdio/client.go
+++ b/src/syscall/zx/fdio/client.go
@@ -15,12 +15,12 @@
 		return ns.Connect(svcpath, h)
 	}
 	h.Close()
-	return zx.Error{Status: zx.ErrNotFound, Text: "fdio.ServiceConnect"}
+	return &zx.Error{Status: zx.ErrNotFound, Text: "fdio.ServiceConnect"}
 }
 
 func ServiceConnectAt(dir zx.Handle, path string, h zx.Handle) error {
 	if !dir.IsValid() || !h.IsValid() {
-		return zx.Error{Status: zx.ErrInvalidArgs, Text: "fdio.ServiceConnectAt"}
+		return &zx.Error{Status: zx.ErrInvalidArgs, Text: "fdio.ServiceConnectAt"}
 	}
 	// Open the path on the remote.
 	iface := (*io.DirectoryInterface)(&fidl.ChannelProxy{Channel: zx.Channel(dir)})
diff --git a/src/syscall/zx/fdio/directory.go b/src/syscall/zx/fdio/directory.go
index 6e9e2b8..8373a9b 100644
--- a/src/syscall/zx/fdio/directory.go
+++ b/src/syscall/zx/fdio/directory.go
@@ -22,7 +22,7 @@
 	if err != nil {
 		return zx.HandleInvalid, err
 	} else if zx.Status(status) != zx.ErrOk {
-		return zx.HandleInvalid, zx.Error{Status: zx.Status(status), Text: "io.directory.getToken"}
+		return zx.HandleInvalid, &zx.Error{Status: zx.Status(status), Text: "io.directory.getToken"}
 	}
 	return token, nil
 }
@@ -40,7 +40,7 @@
 	if status, err := d.Node.NodeInterface.Close(); err != nil {
 		return err
 	} else if zx.Status(status) != zx.ErrOk {
-		return zx.Error{Status: zx.Status(status), Text: "io.directory.Close"}
+		return &zx.Error{Status: zx.Status(status), Text: "io.directory.Close"}
 	}
 	return nil
 }
@@ -63,7 +63,7 @@
 		return nil, err
 	} else if zx.Status(status) != zx.ErrOk {
 		((*fidl.ChannelProxy)(obj)).Close()
-		return nil, zx.Error{Status: zx.Status(status), Text: "io.directory.Open"}
+		return nil, &zx.Error{Status: zx.Status(status), Text: "io.directory.Open"}
 	}
 	return nodeFromInfo(info, obj)
 }
@@ -94,11 +94,11 @@
 	defer newparent.Close()
 	olddir, ok := oldparent.(*Directory)
 	if !ok {
-		return zx.Error{Status: zx.ErrNotSupported, Text: "io.directory.Link"}
+		return &zx.Error{Status: zx.ErrNotSupported, Text: "io.directory.Link"}
 	}
 	newdir, ok := newparent.(*Directory)
 	if !ok {
-		return zx.Error{Status: zx.ErrNotSupported, Text: "io.directory.Link"}
+		return &zx.Error{Status: zx.ErrNotSupported, Text: "io.directory.Link"}
 	}
 	token, err := newdir.getToken()
 	if err != nil {
@@ -108,7 +108,7 @@
 	if err != nil {
 		return err
 	} else if zx.Status(status) != zx.ErrOk {
-		return zx.Error{Status: zx.Status(status), Text: "io.directory.Link"}
+		return &zx.Error{Status: zx.Status(status), Text: "io.directory.Link"}
 	}
 	return nil
 }
@@ -127,11 +127,11 @@
 	defer newf.Close()
 	olddir, ok := oldf.(*Directory)
 	if !ok {
-		return zx.Error{Status: zx.ErrNotSupported, Text: "io.directory.Rename"}
+		return &zx.Error{Status: zx.ErrNotSupported, Text: "io.directory.Rename"}
 	}
 	newdir, ok := newf.(*Directory)
 	if !ok {
-		return zx.Error{Status: zx.ErrNotSupported, Text: "io.directory.Rename"}
+		return &zx.Error{Status: zx.ErrNotSupported, Text: "io.directory.Rename"}
 	}
 	token, err := newdir.getToken()
 	if err != nil {
@@ -141,7 +141,7 @@
 	if err != nil {
 		return err
 	} else if zx.Status(status) != zx.ErrOk {
-		return zx.Error{Status: zx.Status(status), Text: "io.directory.Rename"}
+		return &zx.Error{Status: zx.Status(status), Text: "io.directory.Rename"}
 	}
 	return nil
 }
@@ -155,12 +155,12 @@
 	defer parent.Close()
 	parentdir, ok := parent.(*Directory)
 	if !ok {
-		return zx.Error{Status: zx.ErrNotSupported, Text: "io.directory.Unlink"}
+		return &zx.Error{Status: zx.ErrNotSupported, Text: "io.directory.Unlink"}
 	}
 	if status, err := parentdir.DirectoryInterface().Unlink(name); err != nil {
 		return err
 	} else if zx.Status(status) != zx.ErrOk {
-		return zx.Error{Status: zx.Status(status), Text: "io.directory.Unlink"}
+		return &zx.Error{Status: zx.Status(status), Text: "io.directory.Unlink"}
 	}
 	return nil
 }
@@ -173,7 +173,7 @@
 	if err != nil {
 		return nil, err
 	} else if zx.Status(status) != zx.ErrOk {
-		return nil, zx.Error{Status: zx.Status(status), Text: "io.file"}
+		return nil, &zx.Error{Status: zx.Status(status), Text: "io.file"}
 	}
 	return dirents, nil
 }
@@ -183,7 +183,7 @@
 	if status, err := d.DirectoryInterface().Rewind(); err != nil {
 		return err
 	} else if zx.Status(status) != zx.ErrOk {
-		return zx.Error{Status: zx.Status(status), Text: "io.directory.Unlink"}
+		return &zx.Error{Status: zx.Status(status), Text: "io.directory.Unlink"}
 	}
 	return nil
 }
diff --git a/src/syscall/zx/fdio/file.go b/src/syscall/zx/fdio/file.go
index 217170c..acf4886 100644
--- a/src/syscall/zx/fdio/file.go
+++ b/src/syscall/zx/fdio/file.go
@@ -58,7 +58,7 @@
 		if err != nil {
 			return ptr, err
 		} else if zx.Status(status) != zx.ErrOk {
-			return ptr, zx.Error{Status: zx.Status(status), Text: "io.file"}
+			return ptr, &zx.Error{Status: zx.Status(status), Text: "io.file"}
 		}
 		if len(out) == 0 {
 			return ptr, nil
@@ -108,12 +108,12 @@
 		if err != nil {
 			return ptr, err
 		} else if zx.Status(status) != zx.ErrOk {
-			return ptr, zx.Error{Status: zx.Status(status), Text: "io.file"}
+			return ptr, &zx.Error{Status: zx.Status(status), Text: "io.file"}
 		}
 		ptr += int(written)
 		// Error on a short write.
 		if int(written) < bytesToWrite {
-			return ptr, zx.Error{Status: zx.ErrIO, Text: "io.file"}
+			return ptr, &zx.Error{Status: zx.ErrIO, Text: "io.file"}
 		}
 	}
 	return ptr, nil
@@ -135,7 +135,7 @@
 	if err != nil {
 		return -1, err
 	} else if zx.Status(status) != zx.ErrOk {
-		return -1, zx.Error{Status: zx.Status(status), Text: "io.file"}
+		return -1, &zx.Error{Status: zx.Status(status), Text: "io.file"}
 	}
 	return int64(off), nil
 }
@@ -146,7 +146,7 @@
 	if err != nil {
 		return err
 	} else if zx.Status(status) != zx.ErrOk {
-		return zx.Error{Status: zx.Status(status), Text: "io.file"}
+		return &zx.Error{Status: zx.Status(status), Text: "io.file"}
 	}
 	return nil
 }
diff --git a/src/syscall/zx/fdio/logger.go b/src/syscall/zx/fdio/logger.go
index dab572a..bd54aa9 100644
--- a/src/syscall/zx/fdio/logger.go
+++ b/src/syscall/zx/fdio/logger.go
@@ -46,32 +46,32 @@
 
 // Sync implements FDIO for Logger.
 func (f *Logger) Sync() error {
-	return zx.Error{Status: zx.ErrNotSupported, Text: "fdio.logger"}
+	return &zx.Error{Status: zx.ErrNotSupported, Text: "fdio.logger"}
 }
 
 // GetAttr implements FDIO for Logger.
 func (f *Logger) GetAttr() (io.NodeAttributes, error) {
-	return io.NodeAttributes{}, zx.Error{Status: zx.ErrNotSupported, Text: "fdio.logger"}
+	return io.NodeAttributes{}, &zx.Error{Status: zx.ErrNotSupported, Text: "fdio.logger"}
 }
 
 // SetAttr implements FDIO for Logger.
 func (f *Logger) SetAttr(flags uint32, attr io.NodeAttributes) error {
-	return zx.Error{Status: zx.ErrNotSupported, Text: "fdio.logger"}
+	return &zx.Error{Status: zx.ErrNotSupported, Text: "fdio.logger"}
 }
 
 // Ioctl implements FDIO for Logger.
 func (f *Logger) Ioctl(op uint32, max uint64, in []byte, handles []zx.Handle) ([]byte, []zx.Handle, error) {
-	return nil, nil, zx.Error{Status: zx.ErrNotSupported, Text: "fdio.logger"}
+	return nil, nil, &zx.Error{Status: zx.ErrNotSupported, Text: "fdio.logger"}
 }
 
 // Read implements FDIO for Logger.
 func (f *Logger) Read(data []byte) (int, error) {
-	return 0, zx.Error{Status: zx.ErrNotSupported, Text: "fdio.logger"}
+	return 0, &zx.Error{Status: zx.ErrNotSupported, Text: "fdio.logger"}
 }
 
 // ReadAt implements FDIO for Logger.
 func (f *Logger) ReadAt(data []byte, off int64) (int, error) {
-	return 0, zx.Error{Status: zx.ErrNotSupported, Text: "fdio.logger"}
+	return 0, &zx.Error{Status: zx.ErrNotSupported, Text: "fdio.logger"}
 }
 
 // Write implements FDIO for Logger.
@@ -112,45 +112,45 @@
 
 // WriteAt implements FDIO for Logger.
 func (f *Logger) WriteAt(data []byte, off int64) (int, error) {
-	return 0, zx.Error{Status: zx.ErrNotSupported, Text: "fdio.logger"}
+	return 0, &zx.Error{Status: zx.ErrNotSupported, Text: "fdio.logger"}
 }
 
 // Seek implements FDIO for Logger.
 func (f *Logger) Seek(offset int64, whence int) (int64, error) {
-	return 0, zx.Error{Status: zx.ErrNotSupported, Text: "fdio.logger"}
+	return 0, &zx.Error{Status: zx.ErrNotSupported, Text: "fdio.logger"}
 }
 
 // Truncate implements FDIO for Logger.
 func (f *Logger) Truncate(length uint64) error {
-	return zx.Error{Status: zx.ErrNotSupported, Text: "fdio.logger"}
+	return &zx.Error{Status: zx.ErrNotSupported, Text: "fdio.logger"}
 }
 
 // Open implements FDIO for Logger.
 func (f *Logger) Open(path string, flags uint32, mode uint32) (FDIO, error) {
-	return nil, zx.Error{Status: zx.ErrNotSupported, Text: "fdio.logger"}
+	return nil, &zx.Error{Status: zx.ErrNotSupported, Text: "fdio.logger"}
 }
 
 // Link implements FDIO for Logger.
 func (f *Logger) Link(oldpath, newpath string) error {
-	return zx.Error{Status: zx.ErrNotSupported, Text: "fdio.logger"}
+	return &zx.Error{Status: zx.ErrNotSupported, Text: "fdio.logger"}
 }
 
 // Rename implements FDIO for Logger.
 func (f *Logger) Rename(oldpath, newpath string) error {
-	return zx.Error{Status: zx.ErrNotSupported, Text: "fdio.logger"}
+	return &zx.Error{Status: zx.ErrNotSupported, Text: "fdio.logger"}
 }
 
 // Unlink implements FDIO for Logger.
 func (f *Logger) Unlink(path string) error {
-	return zx.Error{Status: zx.ErrNotSupported, Text: "fdio.logger"}
+	return &zx.Error{Status: zx.ErrNotSupported, Text: "fdio.logger"}
 }
 
 // ReadDirents implements FDIO for Logger.
 func (f *Logger) ReadDirents(max uint64) ([]byte, error) {
-	return nil, zx.Error{Status: zx.ErrNotSupported, Text: "fdio.logger"}
+	return nil, &zx.Error{Status: zx.ErrNotSupported, Text: "fdio.logger"}
 }
 
 // Rewind implements FDIO for Logger.
 func (f *Logger) Rewind() error {
-	return zx.Error{Status: zx.ErrNotSupported, Text: "fdio.logger"}
+	return &zx.Error{Status: zx.ErrNotSupported, Text: "fdio.logger"}
 }
diff --git a/src/syscall/zx/fdio/namespace.go b/src/syscall/zx/fdio/namespace.go
index 7b03918..bbed032 100644
--- a/src/syscall/zx/fdio/namespace.go
+++ b/src/syscall/zx/fdio/namespace.go
@@ -24,7 +24,7 @@
 
 func NewNSFromMap(m map[string]zx.Handle) (*NS, error) {
 	if m == nil {
-		return nil, zx.Error{Status: zx.ErrInvalidArgs, Text: "namespace.NewFromNSMAP"}
+		return nil, &zx.Error{Status: zx.ErrInvalidArgs, Text: "namespace.NewFromNSMAP"}
 	}
 	ns := &NS{m: make(map[string]zx.Handle)}
 	for k, v := range m {
@@ -42,7 +42,7 @@
 func (ns *NS) Connect(p string, h zx.Handle) error {
 	if p[0] != '/' {
 		h.Close()
-		return zx.Error{Status: zx.ErrNotFound, Text: "namespace.Connect"}
+		return &zx.Error{Status: zx.ErrNotFound, Text: "namespace.Connect"}
 	}
 	node := p
 	for {
@@ -60,7 +60,7 @@
 		node = pathDir(node)
 	}
 	h.Close()
-	return zx.Error{Status: zx.ErrNotFound, Text: "namespace.Connect"}
+	return &zx.Error{Status: zx.ErrNotFound, Text: "namespace.Connect"}
 }
 
 func (ns *NS) OpenRoot() (FDIO, error) {
@@ -69,7 +69,7 @@
 	defer ns.mu.Unlock()
 	for path, h := range ns.m {
 		if path == "" || path[0] != '/' {
-			return nil, zx.Error{Status: zx.ErrBadPath, Text: "fdio.OpenRoot"}
+			return nil, &zx.Error{Status: zx.ErrBadPath, Text: "fdio.OpenRoot"}
 		}
 		vn := root
 		path = path[1:]
@@ -79,7 +79,7 @@
 			path = remaining
 		}
 		if vn.remote.IsValid() {
-			return nil, zx.Error{Status: zx.ErrAlreadyExists, Text: "fdio.OpenRoot"}
+			return nil, &zx.Error{Status: zx.ErrAlreadyExists, Text: "fdio.OpenRoot"}
 		}
 		obj := (*io.NodeInterface)(&fidl.ChannelProxy{Channel: zx.Channel(h)})
 		vn.remote = Directory{Node: Node{obj}}
@@ -131,7 +131,7 @@
 // Clone makes a clone of the dir, if possible.
 func (d *dir) Clone() (FDIO, error) {
 	if !d.vn.remote.IsValid() {
-		return nil, zx.Error{Status: zx.ErrNotSupported, Text: "fdio.ns.dir"}
+		return nil, &zx.Error{Status: zx.ErrNotSupported, Text: "fdio.ns.dir"}
 	}
 	return d.vn.remote.Clone()
 }
@@ -146,7 +146,7 @@
 
 // Sync implements FDIO for dir.
 func (d *dir) Sync() error {
-	return zx.Error{Status: zx.ErrNotSupported, Text: "fdio.ns.dir"}
+	return &zx.Error{Status: zx.ErrNotSupported, Text: "fdio.ns.dir"}
 }
 
 // GetAttr implements FDIO for dir.
@@ -160,37 +160,37 @@
 
 // SetAttr implements FDIO for dir.
 func (d *dir) SetAttr(flags uint32, attr io.NodeAttributes) error {
-	return zx.Error{Status: zx.ErrNotSupported, Text: "fdio.ns.dir"}
+	return &zx.Error{Status: zx.ErrNotSupported, Text: "fdio.ns.dir"}
 }
 
 // Ioctl implements FDIO for dir.
 func (d *dir) Ioctl(op uint32, max uint64, in []byte, handles []zx.Handle) ([]byte, []zx.Handle, error) {
-	return nil, nil, zx.Error{Status: zx.ErrNotSupported, Text: "fdio.ns.dir"}
+	return nil, nil, &zx.Error{Status: zx.ErrNotSupported, Text: "fdio.ns.dir"}
 }
 
 func (d *dir) Read(data []byte) (int, error) {
-	return 0, zx.Error{Status: zx.ErrNotSupported, Text: "fdio.dir"}
+	return 0, &zx.Error{Status: zx.ErrNotSupported, Text: "fdio.dir"}
 }
 
 func (d *dir) ReadAt(data []byte, off int64) (int, error) {
-	return 0, zx.Error{Status: zx.ErrNotSupported, Text: "fdio.dir"}
+	return 0, &zx.Error{Status: zx.ErrNotSupported, Text: "fdio.dir"}
 }
 
 func (d *dir) Write(data []byte) (n int, err error) {
-	return 0, zx.Error{Status: zx.ErrNotSupported, Text: "fdio.dir"}
+	return 0, &zx.Error{Status: zx.ErrNotSupported, Text: "fdio.dir"}
 }
 
 func (d *dir) WriteAt(data []byte, off int64) (int, error) {
-	return 0, zx.Error{Status: zx.ErrNotSupported, Text: "fdio.dir"}
+	return 0, &zx.Error{Status: zx.ErrNotSupported, Text: "fdio.dir"}
 }
 
 func (d *dir) Seek(offset int64, whence int) (int64, error) {
-	return 0, zx.Error{Status: zx.ErrNotSupported, Text: "fdio.dir"}
+	return 0, &zx.Error{Status: zx.ErrNotSupported, Text: "fdio.dir"}
 }
 
 // Truncate implements FDIO for dir.
 func (d *dir) Truncate(length uint64) error {
-	return zx.Error{Status: zx.ErrNotSupported, Text: "fdio.ns.dir"}
+	return &zx.Error{Status: zx.ErrNotSupported, Text: "fdio.ns.dir"}
 }
 
 func (d *dir) getVnode(path string) (vn *vnode, rpath string, isRemote bool, err error) {
@@ -212,7 +212,7 @@
 		name, remaining := pathSplitForward(path)
 
 		if name == "" {
-			return nil, "", false, zx.Error{Status: zx.ErrBadPath, Text: path}
+			return nil, "", false, &zx.Error{Status: zx.ErrBadPath, Text: path}
 		}
 
 		child := vn.getChild(name)
@@ -260,7 +260,7 @@
 
 		// There is no remote file system to resolve the path against,
 		// which means we failed to find what we were looking for.
-		return nil, "", false, zx.Error{Status: zx.ErrNotFound, Text: originalPath}
+		return nil, "", false, &zx.Error{Status: zx.ErrNotFound, Text: originalPath}
 	}
 }
 
@@ -302,11 +302,11 @@
 	defer newparent.Close()
 	olddir, ok := oldparent.(*Directory)
 	if !ok {
-		return zx.Error{Status: zx.ErrNotSupported, Text: "fdio.ns.dir"}
+		return &zx.Error{Status: zx.ErrNotSupported, Text: "fdio.ns.dir"}
 	}
 	newdir, ok := newparent.(*Directory)
 	if !ok {
-		return zx.Error{Status: zx.ErrNotSupported, Text: "fdio.ns.dir"}
+		return &zx.Error{Status: zx.ErrNotSupported, Text: "fdio.ns.dir"}
 	}
 	token, err := newdir.getToken()
 	if err != nil {
@@ -316,7 +316,7 @@
 	if err != nil {
 		return err
 	} else if zx.Status(status) != zx.ErrOk {
-		return zx.Error{Status: zx.Status(status), Text: "fdio.ns.dir"}
+		return &zx.Error{Status: zx.Status(status), Text: "fdio.ns.dir"}
 	}
 	return nil
 }
@@ -335,11 +335,11 @@
 	defer newf.Close()
 	olddir, ok := oldf.(*Directory)
 	if !ok {
-		return zx.Error{Status: zx.ErrNotSupported, Text: "fdio.ns.dir"}
+		return &zx.Error{Status: zx.ErrNotSupported, Text: "fdio.ns.dir"}
 	}
 	newdir, ok := newf.(*Directory)
 	if !ok {
-		return zx.Error{Status: zx.ErrNotSupported, Text: "fdio.ns.dir"}
+		return &zx.Error{Status: zx.ErrNotSupported, Text: "fdio.ns.dir"}
 	}
 	token, err := newdir.getToken()
 	if err != nil {
@@ -349,7 +349,7 @@
 	if err != nil {
 		return err
 	} else if zx.Status(status) != zx.ErrOk {
-		return zx.Error{Status: zx.Status(status), Text: "fdio.ns.dir"}
+		return &zx.Error{Status: zx.Status(status), Text: "fdio.ns.dir"}
 	}
 	return nil
 }
@@ -363,22 +363,22 @@
 	defer parent.Close()
 	parentdir, ok := parent.(*Directory)
 	if !ok {
-		return zx.Error{Status: zx.ErrNotSupported, Text: "fdio.ns.dir"}
+		return &zx.Error{Status: zx.ErrNotSupported, Text: "fdio.ns.dir"}
 	}
 	if status, err := parentdir.DirectoryInterface().Unlink(name); err != nil {
 		return err
 	} else if zx.Status(status) != zx.ErrOk {
-		return zx.Error{Status: zx.Status(status), Text: "fdio.ns.dir"}
+		return &zx.Error{Status: zx.Status(status), Text: "fdio.ns.dir"}
 	}
 	return nil
 }
 
 // ReadDirents implements FDIO for dir.
 func (d *dir) ReadDirents(max uint64) ([]byte, error) {
-	return nil, zx.Error{Status: zx.ErrNotSupported, Text: "fdio.ns.dir"}
+	return nil, &zx.Error{Status: zx.ErrNotSupported, Text: "fdio.ns.dir"}
 }
 
 // Rewind implements FDIO for dir.
 func (d *dir) Rewind() error {
-	return zx.Error{Status: zx.ErrNotSupported, Text: "fdio.ns.dir"}
+	return &zx.Error{Status: zx.ErrNotSupported, Text: "fdio.ns.dir"}
 }
diff --git a/src/syscall/zx/fdio/node.go b/src/syscall/zx/fdio/node.go
index a7e26c9..73ee3f3 100644
--- a/src/syscall/zx/fdio/node.go
+++ b/src/syscall/zx/fdio/node.go
@@ -17,7 +17,7 @@
 		if err = ((*fidl.ChannelProxy)(node)).Channel.Close(); err != nil {
 			return nil, err
 		}
-		return nil, zx.Error{Status: zx.ErrNotSupported, Text: "io.node"}
+		return nil, &zx.Error{Status: zx.ErrNotSupported, Text: "io.node"}
 	}
 	switch info.NodeInfoTag {
 	case io.NodeInfoService:
@@ -52,7 +52,7 @@
 		if err = ((*fidl.ChannelProxy)(node)).Channel.Close(); err != nil {
 			return nil, err
 		}
-		return nil, zx.Error{Status: zx.ErrNotSupported, Text: "io.node"}
+		return nil, &zx.Error{Status: zx.ErrNotSupported, Text: "io.node"}
 	}
 	return result, nil
 }
@@ -95,7 +95,7 @@
 		return nil, err
 	} else if zx.Status(status) != zx.ErrOk {
 		((*fidl.ChannelProxy)(newNode)).Close()
-		return nil, zx.Error{Status: zx.Status(status), Text: "io.node"}
+		return nil, &zx.Error{Status: zx.Status(status), Text: "io.node"}
 	}
 	return nodeFromInfo(info, newNode)
 }
@@ -106,7 +106,7 @@
 	if status, err := n.NodeInterface.Close(); err != nil {
 		return err
 	} else if zx.Status(status) != zx.ErrOk {
-		return zx.Error{Status: zx.Status(status), Text: "io.node"}
+		return &zx.Error{Status: zx.Status(status), Text: "io.node"}
 	}
 	return nil
 }
@@ -116,7 +116,7 @@
 	if status, err := n.NodeInterface.Sync(); err != nil {
 		return err
 	} else if zx.Status(status) != zx.ErrOk {
-		return zx.Error{Status: zx.Status(status), Text: "io.node"}
+		return &zx.Error{Status: zx.Status(status), Text: "io.node"}
 	}
 	return nil
 }
@@ -127,7 +127,7 @@
 	if err != nil {
 		return io.NodeAttributes{}, err
 	} else if zx.Status(status) != zx.ErrOk {
-		return io.NodeAttributes{}, zx.Error{Status: zx.Status(status), Text: "io.node"}
+		return io.NodeAttributes{}, &zx.Error{Status: zx.Status(status), Text: "io.node"}
 	}
 	return attrs, nil
 }
@@ -137,7 +137,7 @@
 	if status, err := n.NodeInterface.SetAttr(flags, attr); err != nil {
 		return err
 	} else if zx.Status(status) != zx.ErrOk {
-		return zx.Error{Status: zx.Status(status), Text: "io.node"}
+		return &zx.Error{Status: zx.Status(status), Text: "io.node"}
 	}
 	return nil
 }
@@ -148,67 +148,67 @@
 	if err != nil {
 		return nil, nil, err
 	} else if zx.Status(status) != zx.ErrOk {
-		return nil, nil, zx.Error{Status: zx.Status(status), Text: "io.node"}
+		return nil, nil, &zx.Error{Status: zx.Status(status), Text: "io.node"}
 	}
 	return b, h, nil
 }
 
 // Read implements FDIO for Node.
 func (n *Node) Read(data []byte) (int, error) {
-	return 0, zx.Error{Status: zx.ErrNotSupported, Text: "io.node"}
+	return 0, &zx.Error{Status: zx.ErrNotSupported, Text: "io.node"}
 }
 
 // ReadAt implements FDIO for Node.
 func (n *Node) ReadAt(data []byte, off int64) (int, error) {
-	return 0, zx.Error{Status: zx.ErrNotSupported, Text: "io.node"}
+	return 0, &zx.Error{Status: zx.ErrNotSupported, Text: "io.node"}
 }
 
 // Write implements FDIO for Node.
 func (n *Node) Write(data []byte) (int, error) {
-	return 0, zx.Error{Status: zx.ErrNotSupported, Text: "io.node"}
+	return 0, &zx.Error{Status: zx.ErrNotSupported, Text: "io.node"}
 }
 
 // WriteAt implements FDIO for Node.
 func (n *Node) WriteAt(data []byte, off int64) (int, error) {
-	return 0, zx.Error{Status: zx.ErrNotSupported, Text: "io.node"}
+	return 0, &zx.Error{Status: zx.ErrNotSupported, Text: "io.node"}
 }
 
 // Seek implements FDIO for Node.
 func (n *Node) Seek(offset int64, whence int) (int64, error) {
-	return 0, zx.Error{Status: zx.ErrNotSupported, Text: "io.node"}
+	return 0, &zx.Error{Status: zx.ErrNotSupported, Text: "io.node"}
 }
 
 // Truncate implements FDIO for Node.
 func (n *Node) Truncate(length uint64) error {
-	return zx.Error{Status: zx.ErrNotSupported, Text: "io.node"}
+	return &zx.Error{Status: zx.ErrNotSupported, Text: "io.node"}
 }
 
 // Open implements FDIO for Node.
 func (n *Node) Open(path string, flags uint32, mode uint32) (FDIO, error) {
-	return nil, zx.Error{Status: zx.ErrNotSupported, Text: "io.node"}
+	return nil, &zx.Error{Status: zx.ErrNotSupported, Text: "io.node"}
 }
 
 // Link implements FDIO for Node.
 func (n *Node) Link(oldpath, newpath string) error {
-	return zx.Error{Status: zx.ErrNotSupported, Text: "io.node"}
+	return &zx.Error{Status: zx.ErrNotSupported, Text: "io.node"}
 }
 
 // Rename implements FDIO for Node.
 func (n *Node) Rename(oldpath, newpath string) error {
-	return zx.Error{Status: zx.ErrNotSupported, Text: "io.node"}
+	return &zx.Error{Status: zx.ErrNotSupported, Text: "io.node"}
 }
 
 // Unlink implements FDIO for Node.
 func (n *Node) Unlink(path string) error {
-	return zx.Error{Status: zx.ErrNotSupported, Text: "io.node"}
+	return &zx.Error{Status: zx.ErrNotSupported, Text: "io.node"}
 }
 
 // ReadDirents implements FDIO for Node.
 func (n *Node) ReadDirents(max uint64) ([]byte, error) {
-	return nil, zx.Error{Status: zx.ErrNotSupported, Text: "io.node"}
+	return nil, &zx.Error{Status: zx.ErrNotSupported, Text: "io.node"}
 }
 
 // Rewind implements FDIO for Node.
 func (n *Node) Rewind() error {
-	return zx.Error{Status: zx.ErrNotSupported, Text: "io.node"}
+	return &zx.Error{Status: zx.ErrNotSupported, Text: "io.node"}
 }
diff --git a/src/syscall/zx/fdio/pipe.go b/src/syscall/zx/fdio/pipe.go
index 1fd2bea..03724b1 100644
--- a/src/syscall/zx/fdio/pipe.go
+++ b/src/syscall/zx/fdio/pipe.go
@@ -53,19 +53,19 @@
 }
 
 func (f *Pipe) Sync() error {
-	return zx.Error{Status: zx.ErrNotSupported, Text: "fdio.Pipe"}
+	return &zx.Error{Status: zx.ErrNotSupported, Text: "fdio.Pipe"}
 }
 
 func (f *Pipe) GetAttr() (io.NodeAttributes, error) {
-	return io.NodeAttributes{}, zx.Error{Status: zx.ErrNotSupported, Text: "fdio.Pipe"}
+	return io.NodeAttributes{}, &zx.Error{Status: zx.ErrNotSupported, Text: "fdio.Pipe"}
 }
 
 func (f *Pipe) SetAttr(flags uint32, attr io.NodeAttributes) error {
-	return zx.Error{Status: zx.ErrNotSupported, Text: "fdio.Pipe"}
+	return &zx.Error{Status: zx.ErrNotSupported, Text: "fdio.Pipe"}
 }
 
 func (f *Pipe) Ioctl(op uint32, max uint64, in []byte, handles []zx.Handle) ([]byte, []zx.Handle, error) {
-	return nil, nil, zx.Error{Status: zx.ErrNotSupported, Text: "fdio.Pipe"}
+	return nil, nil, &zx.Error{Status: zx.ErrNotSupported, Text: "fdio.Pipe"}
 }
 
 func (f *Pipe) Read(data []byte) (n int, err error) {
@@ -74,7 +74,7 @@
 		if err == nil {
 			return n, nil
 		}
-		mxerr, ok := err.(zx.Error)
+		mxerr, ok := err.(*zx.Error)
 		if !ok {
 			return n, err
 		}
@@ -93,14 +93,14 @@
 				return 0, zx.EOF
 			}
 			// impossible
-			return 0, zx.Error{Status: zx.ErrInternal, Text: "fdio.Pipe"}
+			return 0, &zx.Error{Status: zx.ErrInternal, Text: "fdio.Pipe"}
 		}
 		return 0, err
 	}
 }
 
 func (f *Pipe) ReadAt(data []byte, off int64) (int, error) {
-	return 0, zx.Error{Status: zx.ErrNotSupported, Text: "fdio.Pipe"}
+	return 0, &zx.Error{Status: zx.ErrNotSupported, Text: "fdio.Pipe"}
 }
 
 func (f *Pipe) Write(data []byte) (n int, err error) {
@@ -109,7 +109,7 @@
 		if err == nil {
 			return n, nil
 		}
-		mxerr, ok := err.(zx.Error)
+		mxerr, ok := err.(*zx.Error)
 		if !ok {
 			return n, err
 		}
@@ -128,44 +128,44 @@
 				return 0, zx.EPIPE
 			}
 			// impossible
-			return 0, zx.Error{Status: zx.ErrInternal, Text: "fdio.Pipe"}
+			return 0, &zx.Error{Status: zx.ErrInternal, Text: "fdio.Pipe"}
 		}
 		return 0, err
 	}
 }
 
 func (f *Pipe) WriteAt(data []byte, off int64) (int, error) {
-	return 0, zx.Error{Status: zx.ErrNotSupported, Text: "fdio.Pipe"}
+	return 0, &zx.Error{Status: zx.ErrNotSupported, Text: "fdio.Pipe"}
 }
 
 func (f *Pipe) Seek(offset int64, whence int) (int64, error) {
-	return 0, zx.Error{Status: zx.ErrNotSupported, Text: "fdio.Pipe"}
+	return 0, &zx.Error{Status: zx.ErrNotSupported, Text: "fdio.Pipe"}
 }
 
 func (f *Pipe) Truncate(length uint64) error {
-	return zx.Error{Status: zx.ErrNotSupported, Text: "fdio.Pipe"}
+	return &zx.Error{Status: zx.ErrNotSupported, Text: "fdio.Pipe"}
 }
 
 func (f *Pipe) Open(path string, flags uint32, mode uint32) (FDIO, error) {
-	return nil, zx.Error{Status: zx.ErrNotSupported, Text: "fdio.Pipe"}
+	return nil, &zx.Error{Status: zx.ErrNotSupported, Text: "fdio.Pipe"}
 }
 
 func (f *Pipe) Link(oldpath, newpath string) error {
-	return zx.Error{Status: zx.ErrNotSupported, Text: "fdio.Pipe"}
+	return &zx.Error{Status: zx.ErrNotSupported, Text: "fdio.Pipe"}
 }
 
 func (f *Pipe) Rename(oldpath, newpath string) error {
-	return zx.Error{Status: zx.ErrNotSupported, Text: "fdio.Pipe"}
+	return &zx.Error{Status: zx.ErrNotSupported, Text: "fdio.Pipe"}
 }
 
 func (f *Pipe) Unlink(path string) error {
-	return zx.Error{Status: zx.ErrNotSupported, Text: "fdio.Pipe"}
+	return &zx.Error{Status: zx.ErrNotSupported, Text: "fdio.Pipe"}
 }
 
 func (f *Pipe) ReadDirents(max uint64) ([]byte, error) {
-	return nil, zx.Error{Status: zx.ErrNotSupported, Text: "fdio.Pipe"}
+	return nil, &zx.Error{Status: zx.ErrNotSupported, Text: "fdio.Pipe"}
 }
 
 func (f *Pipe) Rewind() error {
-	return zx.Error{Status: zx.ErrNotSupported, Text: "fdio.Pipe"}
+	return &zx.Error{Status: zx.ErrNotSupported, Text: "fdio.Pipe"}
 }
diff --git a/src/syscall/zx/fdio/vmo.go b/src/syscall/zx/fdio/vmo.go
index 511d89f..b3c2a6a 100644
--- a/src/syscall/zx/fdio/vmo.go
+++ b/src/syscall/zx/fdio/vmo.go
@@ -36,7 +36,7 @@
 }
 
 func (f *VMOFile) Clone() (FDIO, error) {
-	return nil, zx.Error{Status: zx.ErrNotSupported, Text: "fdio.VMOFile"}
+	return nil, &zx.Error{Status: zx.ErrNotSupported, Text: "fdio.VMOFile"}
 }
 
 func (f *VMOFile) Close() error {
@@ -48,7 +48,7 @@
 }
 
 func (f *VMOFile) Sync() error {
-	return zx.Error{Status: zx.ErrNotSupported, Text: "fdio.VMOFile"}
+	return &zx.Error{Status: zx.ErrNotSupported, Text: "fdio.VMOFile"}
 }
 
 func (f *VMOFile) GetAttr() (io.NodeAttributes, error) {
@@ -60,11 +60,11 @@
 }
 
 func (f *VMOFile) SetAttr(flags uint32, attr io.NodeAttributes) error {
-	return zx.Error{Status: zx.ErrNotSupported, Text: "fdio.VMOFile"}
+	return &zx.Error{Status: zx.ErrNotSupported, Text: "fdio.VMOFile"}
 }
 
 func (f *VMOFile) Ioctl(op uint32, max uint64, in []byte, handles []zx.Handle) ([]byte, []zx.Handle, error) {
-	return nil, nil, zx.Error{Status: zx.ErrNotSupported, Text: "fdio.VMOFile"}
+	return nil, nil, &zx.Error{Status: zx.ErrNotSupported, Text: "fdio.VMOFile"}
 }
 
 func (f *VMOFile) Read(data []byte) (n int, err error) {
@@ -85,7 +85,7 @@
 
 func (f *VMOFile) ReadAt(data []byte, off int64) (n int, err error) {
 	if off < 0 {
-		return 0, zx.Error{Status: zx.ErrInvalidArgs, Text: "fdio.VMOFile.ReadAt"}
+		return 0, &zx.Error{Status: zx.ErrInvalidArgs, Text: "fdio.VMOFile.ReadAt"}
 	}
 	if off >= f.end {
 		return 0, zx.EOF
@@ -107,11 +107,11 @@
 }
 
 func (f *VMOFile) Write(data []byte) (int, error) {
-	return 0, zx.Error{Status: zx.ErrNotSupported, Text: "fdio.VMOFile"}
+	return 0, &zx.Error{Status: zx.ErrNotSupported, Text: "fdio.VMOFile"}
 }
 
 func (f *VMOFile) WriteAt(data []byte, off int64) (int, error) {
-	return 0, zx.Error{Status: zx.ErrNotSupported, Text: "fdio.VMOFile"}
+	return 0, &zx.Error{Status: zx.ErrNotSupported, Text: "fdio.VMOFile"}
 }
 
 func (f *VMOFile) Seek(offset int64, whence int) (int64, error) {
@@ -126,36 +126,36 @@
 	}
 
 	if at > f.end-f.off {
-		return 0, zx.Error{Status: zx.ErrOutOfRange, Text: "fdio.VMOFile"}
+		return 0, &zx.Error{Status: zx.ErrOutOfRange, Text: "fdio.VMOFile"}
 	}
 	f.at = f.off + at
 	return at, nil
 }
 
 func (f *VMOFile) Truncate(length uint64) error {
-	return zx.Error{Status: zx.ErrNotSupported, Text: "fdio.VMOFile"}
+	return &zx.Error{Status: zx.ErrNotSupported, Text: "fdio.VMOFile"}
 }
 
 func (f *VMOFile) Open(path string, flags uint32, mode uint32) (FDIO, error) {
-	return nil, zx.Error{Status: zx.ErrNotSupported, Text: "fdio.VMOFile"}
+	return nil, &zx.Error{Status: zx.ErrNotSupported, Text: "fdio.VMOFile"}
 }
 
 func (f *VMOFile) Link(oldpath, newpath string) error {
-	return zx.Error{Status: zx.ErrNotSupported, Text: "fdio.VMOFile"}
+	return &zx.Error{Status: zx.ErrNotSupported, Text: "fdio.VMOFile"}
 }
 
 func (f *VMOFile) Rename(oldpath, newpath string) error {
-	return zx.Error{Status: zx.ErrNotSupported, Text: "fdio.VMOFile"}
+	return &zx.Error{Status: zx.ErrNotSupported, Text: "fdio.VMOFile"}
 }
 
 func (f *VMOFile) Unlink(path string) error {
-	return zx.Error{Status: zx.ErrNotSupported, Text: "fdio.VMOFile"}
+	return &zx.Error{Status: zx.ErrNotSupported, Text: "fdio.VMOFile"}
 }
 
 func (f *VMOFile) ReadDirents(max uint64) ([]byte, error) {
-	return nil, zx.Error{Status: zx.ErrNotSupported, Text: "fdio.VMOFile"}
+	return nil, &zx.Error{Status: zx.ErrNotSupported, Text: "fdio.VMOFile"}
 }
 
 func (f *VMOFile) Rewind() error {
-	return zx.Error{Status: zx.ErrNotSupported, Text: "fdio.VMOFile"}
+	return &zx.Error{Status: zx.ErrNotSupported, Text: "fdio.VMOFile"}
 }
diff --git a/src/syscall/zx/fidl/bindings.go b/src/syscall/zx/fidl/bindings.go
index 4e9e56b..978e3ed 100644
--- a/src/syscall/zx/fidl/bindings.go
+++ b/src/syscall/zx/fidl/bindings.go
@@ -86,7 +86,7 @@
 			b.state = idle
 		}()
 		if s != zx.ErrOk {
-			b.errHandler(zx.Error{Status: s})
+			b.errHandler(&zx.Error{Status: s})
 			return dispatch.WaitFinished
 		}
 		if sigs.Observed&zx.SignalChannelReadable != 0 {
@@ -102,7 +102,7 @@
 			}
 			return dispatch.WaitAgain
 		}
-		b.errHandler(zx.Error{Status: zx.ErrPeerClosed})
+		b.errHandler(&zx.Error{Status: zx.ErrPeerClosed})
 		return dispatch.WaitFinished
 	}
 
@@ -138,7 +138,7 @@
 
 	nb, nh, err := b.Channel.Read(respb, resph, 0)
 	if err != nil {
-		zxErr, ok := err.(zx.Error)
+		zxErr, ok := err.(*zx.Error)
 		if ok && zxErr.Status == zx.ErrShouldWait {
 			return true, nil
 		}
@@ -198,7 +198,7 @@
 // called with the binding's mutex set.
 func (b *Binding) close() error {
 	if err := d.CancelWait(*b.id); err != nil {
-		zxErr, ok := err.(zx.Error)
+		zxErr, ok := err.(*zx.Error)
 		// If it just says that the ID isn't found, there are cases where this is
 		// a reasonable error (particularly when we're in the middle of handling
 		// a signal from the dispatcher).
diff --git a/src/syscall/zx/fidl/interface.go b/src/syscall/zx/fidl/interface.go
index 9ad96b0..7941061 100644
--- a/src/syscall/zx/fidl/interface.go
+++ b/src/syscall/zx/fidl/interface.go
@@ -127,7 +127,7 @@
 	}
 	// If it is closed and not readable, let's just report that and stop here.
 	if (sigs&zx.SignalChannelPeerClosed) != 0 && (sigs&zx.SignalChannelReadable) == 0 {
-		return zx.Error{Status: zx.ErrPeerClosed}
+		return &zx.Error{Status: zx.ErrPeerClosed}
 	}
 	// Otherwise, now we can read!
 	nb, nh, err := p.Channel.Read(respb[:], resph[:], 0)
@@ -242,7 +242,7 @@
 	}
 	// If it is closed and not readable, let's just report that and stop here.
 	if (sigs&zx.SignalSocketPeerClosed) != 0 && (sigs&zx.SignalSocketControlReadable) == 0 {
-		return zx.Error{Status: zx.ErrPeerClosed}
+		return &zx.Error{Status: zx.ErrPeerClosed}
 	}
 	// Otherwise, now we can read!
 	nb, err := p.Socket.Read(respb[:], zx.SocketControl)
diff --git a/src/syscall/zx/handle.go b/src/syscall/zx/handle.go
index b5ce5d6..040f6e0 100644
--- a/src/syscall/zx/handle.go
+++ b/src/syscall/zx/handle.go
@@ -51,7 +51,7 @@
 	}
 	status := sys_socket_read(Handle(*s), flags, p, uint(len(data)), &actual)
 	if status != ErrOk {
-		return int(actual), Error{Status: status, Text: "zx.Socket.Read"}
+		return int(actual), &Error{Status: status, Text: "zx.Socket.Read"}
 	}
 	return int(actual), nil
 }
@@ -64,21 +64,21 @@
 	var actual uint
 	status := sys_socket_write(Handle(*s), flags, p, uint(len(data)), &actual)
 	if status != ErrOk {
-		return int(actual), Error{Status: status, Text: "zx.Socket.Write"}
+		return int(actual), &Error{Status: status, Text: "zx.Socket.Write"}
 	}
 	return int(actual), nil
 }
 
 func (s *Socket) Share(h Handle) error {
 	if status := sys_socket_share(Handle(*s), h); status != ErrOk {
-		return Error{Status: status, Text: "zx.Socket.Share"}
+		return &Error{Status: status, Text: "zx.Socket.Share"}
 	}
 	return nil
 }
 
 func (s *Socket) Accept(h *Handle) error {
 	if status := sys_socket_accept(Handle(*s), h); status != ErrOk {
-		return Error{Status: status, Text: "zx.Socket.Accept"}
+		return &Error{Status: status, Text: "zx.Socket.Accept"}
 	}
 	return nil
 }
@@ -93,7 +93,7 @@
 func (s *Socket) Shutdown(flags uint32) (err error) {
 	status := Sys_socket_shutdown(Handle(*s), flags)
 	if status != ErrOk {
-		return Error{Status: status, Text: "zx.Socket.Shutdown"}
+		return &Error{Status: status, Text: "zx.Socket.Shutdown"}
 	}
 	return nil
 }
@@ -101,7 +101,7 @@
 func NewSocket(flags uint32) (s0, s1 Socket, err error) {
 	var h0, h1 Handle
 	if status := sys_socket_create(flags, &h0, &h1); status != ErrOk {
-		return Socket(HandleInvalid), Socket(HandleInvalid), Error{Status: status, Text: "zx.Socket"}
+		return Socket(HandleInvalid), Socket(HandleInvalid), &Error{Status: status, Text: "zx.Socket"}
 	}
 	return Socket(h0), Socket(h1), nil
 }
@@ -111,7 +111,7 @@
 func NewEvent(options uint32) (e Event, err error) {
 	var h Handle
 	if status := Sys_event_create(options, &h); status != ErrOk {
-		return Event(HandleInvalid), Error{Status: status, Text: "zx.Event"}
+		return Event(HandleInvalid), &Error{Status: status, Text: "zx.Event"}
 	}
 	return Event(h), nil
 }
@@ -139,7 +139,7 @@
 func (h *Handle) Close() error {
 	handle := Handle(atomic.SwapUint32((*uint32)(h), uint32(HandleInvalid)))
 	if status := Sys_handle_close(handle); status != ErrOk {
-		return Error{Status: status, Text: "zx.Handle.Close"}
+		return &Error{Status: status, Text: "zx.Handle.Close"}
 	}
 	return nil
 }
@@ -147,21 +147,21 @@
 func (h *Handle) Duplicate(rights Rights) (Handle, error) {
 	var dup Handle
 	if status := sys_handle_duplicate(*h, rights, &dup); status != ErrOk {
-		return HandleInvalid, Error{Status: status, Text: "zx.Handle.Duplicate"}
+		return HandleInvalid, &Error{Status: status, Text: "zx.Handle.Duplicate"}
 	}
 	return dup, nil
 }
 
 func (h *Handle) Signal(clearMask, setMask Signals) error {
 	if status := Sys_object_signal(*h, uint32(clearMask), uint32(setMask)); status != ErrOk {
-		return Error{Status: status, Text: "zx.Handle.Signal"}
+		return &Error{Status: status, Text: "zx.Handle.Signal"}
 	}
 	return nil
 }
 
 func (h *Handle) SignalPeer(clearMask, setMask Signals) error {
 	if status := Sys_object_signal_peer(*h, uint32(clearMask), uint32(setMask)); status != ErrOk {
-		return Error{Status: status, Text: "zx.Handle.SignalPeer"}
+		return &Error{Status: status, Text: "zx.Handle.SignalPeer"}
 	}
 	return nil
 }
@@ -173,7 +173,7 @@
 		dataPtr = unsafe.Pointer(&data[0])
 	}
 	if status := Sys_object_get_info(*h, topic, dataPtr, dataBytes, &actual, &avail); status != ErrOk {
-		err = Error{Status: status, Text: "zx.Handle.GetInfo"}
+		err = &Error{Status: status, Text: "zx.Handle.GetInfo"}
 	}
 	return
 }
@@ -182,7 +182,7 @@
 	dataBytes := uint(unsafe.Sizeof(info))
 	dataPtr := unsafe.Pointer(&info)
 	if status := Sys_object_get_info(*h, ObjectInfoHandleBasic, dataPtr, dataBytes, nil, nil); status != ErrOk {
-		err = Error{Status: status, Text: "zx.Handle.GetInfoHandleBasic"}
+		err = &Error{Status: status, Text: "zx.Handle.GetInfoHandleBasic"}
 	}
 	return
 }
@@ -194,7 +194,7 @@
 		dataPtr = unsafe.Pointer(&data[0])
 	}
 	if status := Sys_object_get_property(*h, property, dataPtr, numBytes); status != ErrOk {
-		return Error{Status: status, Text: "zx.Handle.GetProperty"}
+		return &Error{Status: status, Text: "zx.Handle.GetProperty"}
 	}
 	return nil
 }
@@ -206,7 +206,7 @@
 		dataPtr = unsafe.Pointer(&data[0])
 	}
 	if status := Sys_object_set_property(*h, property, dataPtr, numBytes); status != ErrOk {
-		return Error{Status: status, Text: "zx.Handle.SetProperty"}
+		return &Error{Status: status, Text: "zx.Handle.SetProperty"}
 	}
 	return nil
 }
@@ -217,7 +217,7 @@
 
 func WaitMany(items []WaitItem, timeout Time) error {
 	if status := sys_object_wait_many(&items[0], uint(len(items)), timeout); status != ErrOk {
-		return Error{Status: status, Text: "zx.Handle.WaitMany"}
+		return &Error{Status: status, Text: "zx.Handle.WaitMany"}
 	}
 	return nil
 }
@@ -252,7 +252,7 @@
 		handlePtr = &handles[0]
 	}
 	if status := sys_channel_read(Handle(*c), flags, dataPtr, handlePtr, numBytes, numHandles, &numBytes, &numHandles); status != ErrOk {
-		err = Error{Status: status, Text: "zx.Channel.Read"}
+		err = &Error{Status: status, Text: "zx.Channel.Read"}
 	}
 	return numBytes, numHandles, err
 }
@@ -268,7 +268,7 @@
 	}
 	status := sys_channel_write(Handle(*c), flags, dataPtr, uint32(len(data)), handlePtr, uint32(len(handles)))
 	if status != ErrOk {
-		return Error{Status: status, Text: "zx.Channel.Write"}
+		return &Error{Status: status, Text: "zx.Channel.Write"}
 	}
 	return nil
 }
@@ -303,7 +303,7 @@
 
 	status := Sys_channel_call(Handle(*c), flags, deadline, args, &actualBytes, &actualHandles)
 	if status != ErrOk {
-		err = Error{Status: status, Text: "zx.Channel.Call"}
+		err = &Error{Status: status, Text: "zx.Channel.Call"}
 	}
 	return actualBytes, actualHandles, err
 }
@@ -311,7 +311,7 @@
 func NewChannel(flags uint32) (c0, c1 Channel, err error) {
 	var h0, h1 Handle
 	if status := sys_channel_create(flags, &h0, &h1); status != ErrOk {
-		return Channel(HandleInvalid), Channel(HandleInvalid), Error{Status: status, Text: "zx.Channel"}
+		return Channel(HandleInvalid), Channel(HandleInvalid), &Error{Status: status, Text: "zx.Channel"}
 	}
 	return Channel(h0), Channel(h1), nil
 }
@@ -385,7 +385,7 @@
 // Queue a PortPacket, which may have a varying size.
 func (p *Port) Queue(packet PortPacket) error {
 	if status := Sys_port_queue(Handle(*p), (*int)(unsafe.Pointer(packet.Header()))); status != ErrOk {
-		return Error{Status: status, Text: "zx.Port.Queue"}
+		return &Error{Status: status, Text: "zx.Port.Queue"}
 	}
 	return nil
 }
@@ -394,21 +394,21 @@
 // possible packet that may be received.
 func (p *Port) Wait(packet *Packet, deadline Time) error {
 	if status := Sys_port_wait(Handle(*p), deadline, (*int)(unsafe.Pointer(packet))); status != ErrOk {
-		return Error{Status: status, Text: "zx.Port.Wait"}
+		return &Error{Status: status, Text: "zx.Port.Wait"}
 	}
 	return nil
 }
 
 func (p *Port) Cancel(source Handle, key uint64) error {
 	if status := Sys_port_cancel(Handle(*p), source, key); status != ErrOk {
-		return Error{Status: status, Text: "zx.Port.Cancel"}
+		return &Error{Status: status, Text: "zx.Port.Cancel"}
 	}
 	return nil
 }
 
 func (p *Port) WaitAsync(handle Handle, key uint64, signals Signals, options uint32) error {
 	if status := Sys_object_wait_async(handle, Handle(*p), key, signals, options); status != ErrOk {
-		return Error{Status: status, Text: "fdio.Port.WaitAsync"}
+		return &Error{Status: status, Text: "fdio.Port.WaitAsync"}
 	}
 	return nil
 }
@@ -416,7 +416,7 @@
 func NewPort(options uint32) (Port, error) {
 	var h Handle
 	if status := Sys_port_create(options, &h); status != ErrOk {
-		return Port(HandleInvalid), Error{Status: status, Text: "zx.Port"}
+		return Port(HandleInvalid), &Error{Status: status, Text: "zx.Port"}
 	}
 	return Port(h), nil
 }
@@ -430,21 +430,21 @@
 func (vmo *VMO) Clone(options uint32, offset, size uint64) (VMO, error) {
 	var h Handle
 	if status := Sys_vmo_clone(Handle(*vmo), options, offset, size, &h); status != ErrOk {
-		return VMO(HandleInvalid), Error{Status: status, Text: "zx.VMO.Clone"}
+		return VMO(HandleInvalid), &Error{Status: status, Text: "zx.VMO.Clone"}
 	}
 	return VMO(h), nil
 }
 
 func (vmo *VMO) Read(b []byte, offset uint64) error {
 	if status := sys_vmo_read(Handle(*vmo), unsafe.Pointer(&b[0]), offset, uint(len(b))); status != ErrOk {
-		return Error{Status: status, Text: "zx.VMO.Read"}
+		return &Error{Status: status, Text: "zx.VMO.Read"}
 	}
 	return nil
 }
 
 func (vmo *VMO) Write(b []byte, offset uint64) error {
 	if status := sys_vmo_write(Handle(*vmo), unsafe.Pointer(&b[0]), offset, uint(len(b))); status != ErrOk {
-		return Error{Status: status, Text: "zx.VMO.Write"}
+		return &Error{Status: status, Text: "zx.VMO.Write"}
 	}
 	return nil
 }
@@ -452,21 +452,21 @@
 func (vmo *VMO) Size() (uint64, error) {
 	var size uint64
 	if status := sys_vmo_get_size(Handle(*vmo), &size); status != ErrOk {
-		return size, Error{Status: status, Text: "zx.VMO.Size"}
+		return size, &Error{Status: status, Text: "zx.VMO.Size"}
 	}
 	return size, nil
 }
 
 func (vmo *VMO) SetSize(size uint64) error {
 	if status := sys_vmo_set_size(Handle(*vmo), size); status != ErrOk {
-		return Error{Status: status, Text: "zx.VMO.SetSize"}
+		return &Error{Status: status, Text: "zx.VMO.SetSize"}
 	}
 	return nil
 }
 
 func (vmo *VMO) OpRange(op uint32, offset, size uint64, b []byte) error {
 	if status := sys_vmo_op_range(Handle(*vmo), op, offset, size, unsafe.Pointer(&b[0]), uint(len(b))); status != ErrOk {
-		return Error{Status: status, Text: "zx.VMO.OpRange"}
+		return &Error{Status: status, Text: "zx.VMO.OpRange"}
 	}
 	return nil
 }
@@ -481,7 +481,7 @@
 func NewVMO(size uint64, options VMOOption) (VMO, error) {
 	var h Handle
 	if status := Sys_vmo_create(size, uint32(options), &h); status != ErrOk {
-		return VMO(HandleInvalid), Error{Status: status, Text: "zx.VMO"}
+		return VMO(HandleInvalid), &Error{Status: status, Text: "zx.VMO"}
 	}
 	return VMO(h), nil
 }
@@ -490,12 +490,12 @@
 
 func (v VMAR) Destroy() error {
 	if status := sys_vmar_destroy(Handle(v)); status != ErrOk {
-		return Error{Status: status, Text: "zx.VMAR.Destroy"}
+		return &Error{Status: status, Text: "zx.VMAR.Destroy"}
 	}
 	return nil
 }
 
-var mapErr error = Error{Status: 1, Text: "zx.VMAR.Map"}
+var mapErr error = &Error{Status: 1, Text: "zx.VMAR.Map"}
 
 func (v VMAR) Map(vmarOffset uint64, vmo VMO, vmoOffset, len uint64, flags VMFlag) (addr uintptr, err error) {
 	status := Sys_vmar_map(Handle(v), flags, uint64(vmarOffset), Handle(vmo), vmoOffset, uint64(len), (*Vaddr)(&addr))
@@ -506,7 +506,7 @@
 	return addr, nil
 }
 
-var unmapErr error = Error{Status: 1, Text: "zx.VMAR.Unmap"}
+var unmapErr error = &Error{Status: 1, Text: "zx.VMAR.Unmap"}
 
 func (v VMAR) Unmap(addr uintptr, len uint64) error {
 	status := Sys_vmar_unmap(Handle(v), Vaddr(addr), uint64(len))
@@ -520,7 +520,7 @@
 func (v VMAR) Protect(addr uintptr, len uint64, flags VMFlag) error {
 	status := Sys_vmar_protect(Handle(v), flags, Vaddr(addr), uint64(len))
 	if status != ErrOk {
-		return Error{Status: status, Text: "zx.VMAR.Protect"}
+		return &Error{Status: status, Text: "zx.VMAR.Protect"}
 	}
 	return nil
 }
@@ -529,7 +529,7 @@
 	var childHandle Handle
 	status := sys_vmar_allocate(Handle(parent), flags, uint64(offset), uint64(size), &childHandle, (*Vaddr)(&addr))
 	if status != ErrOk {
-		return 0, 0, Error{Status: status, Text: "zx.NewVMAR"}
+		return 0, 0, &Error{Status: status, Text: "zx.NewVMAR"}
 	}
 	return VMAR(childHandle), addr, nil
 }
@@ -557,7 +557,7 @@
 
 	status := Sys_debuglog_write(Handle(l), 0, p, uint(len(b)))
 	if status != ErrOk {
-		return 0, Error{Status: status, Text: "zx.Log.Write"}
+		return 0, &Error{Status: status, Text: "zx.Log.Write"}
 	}
 	return len(b), nil
 }
@@ -565,7 +565,7 @@
 func (l Log) Read(b []byte) (n int, err error) {
 	status := Sys_debuglog_read(Handle(l), 0, unsafe.Pointer(&b[0]), uint(len(b)))
 	if status != ErrOk {
-		return 0, Error{Status: status, Text: "zx.Log.Read"}
+		return 0, &Error{Status: status, Text: "zx.Log.Read"}
 	}
 	return len(b), nil
 }
diff --git a/src/syscall/zx/mxerror/mxerror.go b/src/syscall/zx/mxerror/mxerror.go
index d59269c..64422c0 100644
--- a/src/syscall/zx/mxerror/mxerror.go
+++ b/src/syscall/zx/mxerror/mxerror.go
@@ -16,8 +16,6 @@
 		return zx.ErrOk
 	}
 	switch err := err.(type) {
-	case zx.Error:
-		return err.Status
 	case *zx.Error:
 		return err.Status
 	}
diff --git a/src/syscall/zx/zxsocket/socket.go b/src/syscall/zx/zxsocket/socket.go
index fc5e4f6..f9d5345 100644
--- a/src/syscall/zx/zxsocket/socket.go
+++ b/src/syscall/zx/zxsocket/socket.go
@@ -45,7 +45,7 @@
 
 // Clone makes a clone of the object.
 func (s *Socket) Clone() (fdio.FDIO, error) {
-	return nil, zx.Error{Status: zx.ErrNotSupported, Text: "zxsocket.Socket.Clone"}
+	return nil, &zx.Error{Status: zx.ErrNotSupported, Text: "zxsocket.Socket.Clone"}
 }
 
 // Close closes the object.
@@ -67,17 +67,17 @@
 
 // Sync implements fdio.FDIO for Socket.
 func (s *Socket) Sync() error {
-	return zx.Error{Status: zx.ErrNotSupported, Text: "zxsocket.Socket"}
+	return &zx.Error{Status: zx.ErrNotSupported, Text: "zxsocket.Socket"}
 }
 
 // GetAttr implements fdio.FDIO for Socket.
 func (s *Socket) GetAttr() (fidlIo.NodeAttributes, error) {
-	return fidlIo.NodeAttributes{}, zx.Error{Status: zx.ErrNotSupported, Text: "zxsocket.Socket"}
+	return fidlIo.NodeAttributes{}, &zx.Error{Status: zx.ErrNotSupported, Text: "zxsocket.Socket"}
 }
 
 // SetAttr implements fdio.FDIO for Socket.
 func (s *Socket) SetAttr(flags uint32, attr fidlIo.NodeAttributes) error {
-	return zx.Error{Status: zx.ErrNotSupported, Text: "zxsocket.Socket"}
+	return &zx.Error{Status: zx.ErrNotSupported, Text: "zxsocket.Socket"}
 }
 
 // Ioctl implements fdio.FDIO for Socket.
@@ -130,7 +130,7 @@
 
 // ReadAt implements fdio.FDIO for Socket.
 func (s *Socket) ReadAt(data []byte, off int64) (int, error) {
-	return 0, zx.Error{Status: zx.ErrNotSupported, Text: "zxsocket.Socket"}
+	return 0, &zx.Error{Status: zx.ErrNotSupported, Text: "zxsocket.Socket"}
 }
 
 // Write implements fdio.FDIO for Socket.
@@ -155,14 +155,14 @@
 				return total, err
 			}
 			if obs&zx.SignalSocketPeerClosed != 0 || obs&zx.SignalSocketWriteDisabled != 0 {
-				return total, zx.Error{Status: zx.ErrPeerClosed, Text: "zxsocket.Socket.Write"}
+				return total, &zx.Error{Status: zx.ErrPeerClosed, Text: "zxsocket.Socket.Write"}
 			}
 			if obs&zx.SignalSocketWritable != 0 {
 				data = data[n:]
 				continue
 			}
 			// This case should be impossible:
-			return total, zx.Error{Status: zx.ErrInternal, Text: "zxsocket.Socket.Write(impossible state)"}
+			return total, &zx.Error{Status: zx.ErrInternal, Text: "zxsocket.Socket.Write(impossible state)"}
 		default:
 			return total, err
 		}
@@ -171,47 +171,47 @@
 
 // WriteAt implements fdio.FDIO for Socket.
 func (s *Socket) WriteAt(data []byte, off int64) (int, error) {
-	return 0, zx.Error{Status: zx.ErrNotSupported, Text: "zxsocket.Socket"}
+	return 0, &zx.Error{Status: zx.ErrNotSupported, Text: "zxsocket.Socket"}
 }
 
 // Seek implements fdio.FDIO for Socket.
 func (s *Socket) Seek(offset int64, whence int) (int64, error) {
-	return 0, zx.Error{Status: zx.ErrNotSupported, Text: "zxsocket.Socket"}
+	return 0, &zx.Error{Status: zx.ErrNotSupported, Text: "zxsocket.Socket"}
 }
 
 // Truncate implements fdio.FDIO for Socket.
 func (s *Socket) Truncate(length uint64) error {
-	return zx.Error{Status: zx.ErrNotSupported, Text: "zxsocket.Socket"}
+	return &zx.Error{Status: zx.ErrNotSupported, Text: "zxsocket.Socket"}
 }
 
 // Open implements fdio.FDIO for Socket.
 func (s *Socket) Open(path string, flags uint32, mode uint32) (fdio.FDIO, error) {
-	return nil, zx.Error{Status: zx.ErrNotSupported, Text: "zxsocket.Socket"}
+	return nil, &zx.Error{Status: zx.ErrNotSupported, Text: "zxsocket.Socket"}
 }
 
 // Link implements fdio.FDIO for Socket.
 func (s *Socket) Link(oldpath, newpath string) error {
-	return zx.Error{Status: zx.ErrNotSupported, Text: "zxsocket.Socket"}
+	return &zx.Error{Status: zx.ErrNotSupported, Text: "zxsocket.Socket"}
 }
 
 // Rename implements fdio.FDIO for Socket.
 func (s *Socket) Rename(oldpath, newpath string) error {
-	return zx.Error{Status: zx.ErrNotSupported, Text: "zxsocket.Socket"}
+	return &zx.Error{Status: zx.ErrNotSupported, Text: "zxsocket.Socket"}
 }
 
 // Unlink implements fdio.FDIO for Socket.
 func (s *Socket) Unlink(path string) error {
-	return zx.Error{Status: zx.ErrNotSupported, Text: "zxsocket.Socket"}
+	return &zx.Error{Status: zx.ErrNotSupported, Text: "zxsocket.Socket"}
 }
 
 // ReadDirents implements fdio.FDIO for Socket.
 func (s *Socket) ReadDirents(max uint64) ([]byte, error) {
-	return nil, zx.Error{Status: zx.ErrNotSupported, Text: "zxsocket.Socket"}
+	return nil, &zx.Error{Status: zx.ErrNotSupported, Text: "zxsocket.Socket"}
 }
 
 // Rewind implements fdio.FDIO for Socket.
 func (s *Socket) Rewind() error {
-	return zx.Error{Status: zx.ErrNotSupported, Text: "zxsocket.Socket"}
+	return &zx.Error{Status: zx.ErrNotSupported, Text: "zxsocket.Socket"}
 }
 
 func (s *Socket) RecvMsg(maxLen int) (b []byte, flags int, addr string, port uint16, err error) {
@@ -237,7 +237,7 @@
 			return n, err
 		case zx.ErrShouldWait:
 			if n != 0 {
-				return n, zx.Error{Status: zx.ErrInternal, Text: "zsocket.Socket.recvMsg(datagram short-read)"}
+				return n, &zx.Error{Status: zx.ErrInternal, Text: "zsocket.Socket.recvMsg(datagram short-read)"}
 			}
 
 			obs, err := s.Wait(zx.SignalSocketReadable|zx.SignalSocketPeerClosed|zx.SignalSocketReadDisabled, zx.TimensecInfinite)
@@ -248,9 +248,9 @@
 				continue
 			}
 			if obs&zx.SignalSocketPeerClosed != 0 || obs&zx.SignalSocketReadDisabled != 0 {
-				return n, zx.Error{Status: zx.ErrPeerClosed, Text: "zxsocket.Socket.recvMsg"}
+				return n, &zx.Error{Status: zx.ErrPeerClosed, Text: "zxsocket.Socket.recvMsg"}
 			}
-			return n, zx.Error{Status: zx.ErrInternal, Text: "zxsocket.Socket.recvMsg"}
+			return n, &zx.Error{Status: zx.ErrInternal, Text: "zxsocket.Socket.recvMsg"}
 		default:
 			return n, err
 		}
@@ -272,7 +272,7 @@
 			return len(b), nil
 		case zx.ErrShouldWait:
 			if n != 0 {
-				return n, zx.Error{Status: zx.ErrInternal, Text: "zxsocket.Socket.SendMsg(datagram short-write)"}
+				return n, &zx.Error{Status: zx.ErrInternal, Text: "zxsocket.Socket.SendMsg(datagram short-write)"}
 			}
 
 			obs, err := s.Wait(zx.SignalSocketWritable|zx.SignalSocketPeerClosed|zx.SignalSocketWriteDisabled, zx.TimensecInfinite)
@@ -283,12 +283,12 @@
 				continue
 			}
 			if obs&zx.SignalSocketPeerClosed != 0 || obs&zx.SignalSocketWriteDisabled != 0 {
-				return 0, zx.Error{Status: zx.ErrPeerClosed, Text: "zxsocket.Socket.SendMsg"}
+				return 0, &zx.Error{Status: zx.ErrPeerClosed, Text: "zxsocket.Socket.SendMsg"}
 			}
-			return 0, zx.Error{Status: zx.ErrInternal, Text: "zxsocket.Socket.SendMsg(impossible state)"}
+			return 0, &zx.Error{Status: zx.ErrInternal, Text: "zxsocket.Socket.SendMsg(impossible state)"}
 		default:
 			if n != 0 {
-				return n, zx.Error{Status: zx.ErrInternal, Text: "zxsocket.Socket.SendMsg(datagram short-write)"}
+				return n, &zx.Error{Status: zx.ErrInternal, Text: "zxsocket.Socket.SendMsg(datagram short-write)"}
 			}
 			return 0, err
 		}
diff --git a/src/syscall/zx/zxwait/zxwait.go b/src/syscall/zx/zxwait/zxwait.go
index f96b941..de286eb 100644
--- a/src/syscall/zx/zxwait/zxwait.go
+++ b/src/syscall/zx/zxwait/zxwait.go
@@ -30,7 +30,7 @@
 	// TODO: support finite timeouts.
 	if timeout != zx.TimensecInfinite {
 		if status := zx.Sys_object_wait_one(handle, signals, timeout, &observed); status != zx.ErrOk {
-			return observed, zx.Error{Status: status, Text: "zxwait.Wait"}
+			return observed, &zx.Error{Status: status, Text: "zxwait.Wait"}
 		}
 		return observed, nil
 	}