]> Cypherpunks repositories - gostls13.git/commit
syscall: remove support for O_NONBLOCK and O_SYNC on js/wasm
authorRichard Musiol <mail@richard-musiol.de>
Sat, 28 Jul 2018 11:45:02 +0000 (13:45 +0200)
committerBrad Fitzpatrick <bradfitz@golang.org>
Tue, 31 Jul 2018 17:03:39 +0000 (17:03 +0000)
commit9e2a4f4dff9a790a47729b79e857130f83e0ff6d
tree2133618ce8486c493857ed533ab2cfa3e0e8c2f3
parent137f2fba57034b61d70ca8a094d0a9d24d935ef5
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>
misc/wasm/wasm_exec.js
src/syscall/fs_js.go
src/syscall/syscall_js.go