Skip to content

Commit 3eb4033

Browse files
committed
feat: remove Singal in wasm freestanding
1 parent a1ed65a commit 3eb4033

File tree

4 files changed

+9
-5
lines changed

4 files changed

+9
-5
lines changed

src/os/file_other.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,10 @@ func NewFile(fd uintptr, name string) *File {
4242
// Read reads up to len(b) bytes from machine.Serial.
4343
// It returns the number of bytes read and any error encountered.
4444
func (f stdioFileHandle) Read(b []byte) (n int, err error) {
45+
if f != 0 {
46+
return 0, ErrUnsupported
47+
}
48+
4549
if len(b) == 0 {
4650
return 0, nil
4751
}

src/syscall/syscall_nonhosted.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
//go:build baremetal || js || wasm_freestanding
2-
// +build baremetal js wasm_freestanding
1+
//go:build baremetal || js
2+
// +build baremetal js
33

44
package syscall
55

src/syscall/tables_nonhosted.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22
// Use of this source code is governed by a BSD-style
33
// license that can be found in the LICENSE file.
44

5-
//go:build baremetal || nintendoswitch || js || wasm_freestanding
6-
// +build baremetal nintendoswitch js wasm_freestanding
5+
//go:build baremetal || nintendoswitch || js
6+
// +build baremetal nintendoswitch js
77

88
package syscall
99

targets/wasm-freestanding.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"llvm-target": "wasm32-unknown-unknown",
33
"cpu": "generic",
44
"features": "+bulk-memory,+nontrapping-fptoint,+sign-ext",
5-
"build-tags": ["tinygo.wasm", "unknown_wasm", "runtime_memhash_leveldb"],
5+
"build-tags": ["tinygo.wasm", "wasm_freestanding", "runtime_memhash_leveldb"],
66
"goos": "linux",
77
"goarch": "arm",
88
"linker": "wasm-ld",

0 commit comments

Comments
 (0)