aboutsummaryrefslogtreecommitdiff
path: root/src/os/exec
diff options
context:
space:
mode:
authorJohan Brandhorst-Satzkorn <johan.brandhorst@gmail.com>2023-03-25 10:18:26 -0700
committerGopher Robot <gobot@golang.org>2023-04-07 23:34:21 +0000
commit66cac9e1e4877ac7e66f888b0599a7a4a5787b76 (patch)
treeb9fdd04c774f04886e6852abc5a098c46e057f12 /src/os/exec
parentdd21a77bfae041eefe7b02ab5a40a7c4d3403f8d (diff)
downloadgo-66cac9e1e4877ac7e66f888b0599a7a4a5787b76.tar.xz
os: add wasip1 support
For #58141 Co-authored-by: Richard Musiol <neelance@gmail.com> Co-authored-by: Achille Roussel <achille.roussel@gmail.com> Co-authored-by: Julien Fabre <ju.pryz@gmail.com> Co-authored-by: Evan Phoenix <evan@phx.io> Change-Id: I52e3e161f81dcbe8605570e47d732992979c4d34 Reviewed-on: https://go-review.googlesource.com/c/go/+/479623 Run-TryBot: Johan Brandhorst-Satzkorn <johan.brandhorst@gmail.com> TryBot-Result: Gopher Robot <gobot@golang.org> Reviewed-by: Ian Lance Taylor <iant@google.com> Auto-Submit: Ian Lance Taylor <iant@google.com> Reviewed-by: Cherry Mui <cherryyz@google.com> Run-TryBot: Ian Lance Taylor <iant@google.com>
Diffstat (limited to 'src/os/exec')
-rw-r--r--src/os/exec/internal/fdtest/exists_js.go18
-rw-r--r--src/os/exec/internal/fdtest/exists_unix.go2
-rw-r--r--src/os/exec/lp_wasm.go (renamed from src/os/exec/lp_js.go)2
3 files changed, 2 insertions, 20 deletions
diff --git a/src/os/exec/internal/fdtest/exists_js.go b/src/os/exec/internal/fdtest/exists_js.go
deleted file mode 100644
index a7ce33c74f..0000000000
--- a/src/os/exec/internal/fdtest/exists_js.go
+++ /dev/null
@@ -1,18 +0,0 @@
-// Copyright 2021 The Go Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style
-// license that can be found in the LICENSE file.
-
-//go:build js
-
-package fdtest
-
-import (
- "syscall"
-)
-
-// Exists returns true if fd is a valid file descriptor.
-func Exists(fd uintptr) bool {
- var s syscall.Stat_t
- err := syscall.Fstat(int(fd), &s)
- return err != syscall.EBADF
-}
diff --git a/src/os/exec/internal/fdtest/exists_unix.go b/src/os/exec/internal/fdtest/exists_unix.go
index 265cb69822..472a802d7b 100644
--- a/src/os/exec/internal/fdtest/exists_unix.go
+++ b/src/os/exec/internal/fdtest/exists_unix.go
@@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
-//go:build unix
+//go:build unix || wasm
// Package fdtest provides test helpers for working with file descriptors across exec.
package fdtest
diff --git a/src/os/exec/lp_js.go b/src/os/exec/lp_wasm.go
index 54ddc4d5b4..f2c8e9c5de 100644
--- a/src/os/exec/lp_js.go
+++ b/src/os/exec/lp_wasm.go
@@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
-//go:build js && wasm
+//go:build wasm
package exec