MCPcopy
hub / github.com/jvilk/BrowserFS / ___syscall5

Function ___syscall5

test/tests/emscripten/readdir_empty.js:4733–4743  ·  view source on GitHub ↗
(which, varargs)

Source from the content-addressed store, hash-verified

4731 },getZero:function () {
4732 assert(SYSCALLS.get() === 0);
4733 }};function ___syscall5(which, varargs) {SYSCALLS.varargs = varargs;
4734 try {
4735 // open
4736 var pathname = SYSCALLS.getStr(), flags = SYSCALLS.get(), mode = SYSCALLS.get() // optional TODO
4737 var stream = FS.open(pathname, flags, mode);
4738 return stream.fd;
4739 } catch (e) {
4740 if (typeof FS === 'undefined' || !(e instanceof FS.ErrnoError)) abort(e);
4741 return -e.errno;
4742 }
4743 }
4744
4745 function ___lock() {}
4746

Callers 1

_openFunction · 0.70

Calls 3

abortFunction · 0.70
getMethod · 0.65
openMethod · 0.65

Tested by

no test coverage detected