MCPcopy Index your code
hub / github.com/sql-js/sql.js / ___syscall183

Function ___syscall183

js/sql-debug.js:4651–4665  ·  view source on GitHub ↗
(which, varargs)

Source from the content-addressed store, hash-verified

4649 }
4650
4651 function ___syscall183(which, varargs) {SYSCALLS.varargs = varargs;
4652 try {
4653 // getcwd
4654 var buf = SYSCALLS.get(), size = SYSCALLS.get();
4655 if (size === 0) return -ERRNO_CODES.EINVAL;
4656 var cwd = FS.cwd();
4657 var cwdLengthInBytes = lengthBytesUTF8(cwd);
4658 if (size < cwdLengthInBytes + 1) return -ERRNO_CODES.ERANGE;
4659 stringToUTF8(cwd, buf, size);
4660 return buf;
4661 } catch (e) {
4662 if (typeof FS === 'undefined' || !(e instanceof FS.ErrnoError)) abort(e);
4663 return -e.errno;
4664 }
4665 }
4666
4667 function ___syscall192(which, varargs) {SYSCALLS.varargs = varargs;
4668 try {

Callers 1

_getcwdFunction · 0.70

Calls 3

lengthBytesUTF8Function · 0.70
stringToUTF8Function · 0.70
abortFunction · 0.70

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…