aboutsummaryrefslogtreecommitdiff
path: root/misc/wasm
diff options
context:
space:
mode:
authorRichard Musiol <mail@richard-musiol.de>2018-07-28 13:45:02 +0200
committerBrad Fitzpatrick <bradfitz@golang.org>2018-07-31 17:03:39 +0000
commit9e2a4f4dff9a790a47729b79e857130f83e0ff6d (patch)
tree2133618ce8486c493857ed533ab2cfa3e0e8c2f3 /misc/wasm
parent137f2fba57034b61d70ca8a094d0a9d24d935ef5 (diff)
downloadgo-9e2a4f4dff9a790a47729b79e857130f83e0ff6d.tar.gz
go-9e2a4f4dff9a790a47729b79e857130f83e0ff6d.zip
syscall: remove support for O_NONBLOCK and O_SYNC on js/wasm
This commit removes O_NONBLOCK on js/wasm. O_SYNC can't be removed, because it is referenced by the os package, so instead its use returns an error. On Windows, the options O_NONBLOCK and O_SYNC are not available when opening a file with Node.js. This caused the initialization of the syscall package to panic. The simplest solution is to not support these two options on js/wasm at all. Code written for js/wasm is supposed to be portable, so platform-specific options should not be used. Fixes #26524. Change-Id: I366aa3cdcfa59dfa9dc513368259f363ca090f00 Reviewed-on: https://go-review.googlesource.com/126600 Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org> Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org>
Diffstat (limited to 'misc/wasm')
-rw-r--r--misc/wasm/wasm_exec.js2
1 files changed, 1 insertions, 1 deletions
diff --git a/misc/wasm/wasm_exec.js b/misc/wasm/wasm_exec.js
index 02a753c823..f3772652da 100644
--- a/misc/wasm/wasm_exec.js
+++ b/misc/wasm/wasm_exec.js
@@ -37,7 +37,7 @@
let outputBuf = "";
global.fs = {
- constants: { O_WRONLY: -1, O_RDWR: -1, O_CREAT: -1, O_TRUNC: -1, O_APPEND: -1, O_EXCL: -1, O_NONBLOCK: -1, O_SYNC: -1 }, // unused
+ constants: { O_WRONLY: -1, O_RDWR: -1, O_CREAT: -1, O_TRUNC: -1, O_APPEND: -1, O_EXCL: -1 }, // unused
writeSync(fd, buf) {
outputBuf += decoder.decode(buf);
const nl = outputBuf.lastIndexOf("\n");