1
0
mirror of https://github.com/janet-lang/janet synced 2024-09-29 15:30:41 +00:00

Make some changes for WASM build.

This commit is contained in:
Calvin Rose 2020-09-07 16:08:43 -05:00
parent 93602ad9ea
commit b53890ddae
3 changed files with 15 additions and 13 deletions

View File

@ -1567,6 +1567,18 @@ static const JanetReg os_cfuns[] = {
JDOC("(os/shell str)\n\n" JDOC("(os/shell str)\n\n"
"Pass a command string str directly to the system shell.") "Pass a command string str directly to the system shell.")
}, },
{
"os/proc-wait", os_proc_wait,
JDOC("(os/proc-wait proc)\n\n"
"Block until the subprocess completes. Returns the subprocess return code.")
},
{
"os/proc-kill", os_proc_kill,
JDOC("(os/proc-kill proc &opt wait)\n\n"
"Kill a subprocess by sending SIGKILL to it on posix systems, or by closing the process "
"handle on windows. If wait is truthy, will wait for the process to finsih and "
"returns the exit code. Otherwise, returns proc.")
},
#endif #endif
{ {
"os/setenv", os_setenv, "os/setenv", os_setenv,
@ -1652,18 +1664,6 @@ static const JanetReg os_cfuns[] = {
JDOC("(os/perm-int bytes)\n\n" JDOC("(os/perm-int bytes)\n\n"
"Parse a 9 character permission string and return an integer that can be used by chmod.") "Parse a 9 character permission string and return an integer that can be used by chmod.")
}, },
{
"os/proc-wait", os_proc_wait,
JDOC("(os/proc-wait proc)\n\n"
"Block until the subprocess completes. Returns the subprocess return code.")
},
{
"os/proc-kill", os_proc_kill,
JDOC("(os/proc-kill proc &opt wait)\n\n"
"Kill a subprocess by sending SIGKILL to it on posix systems, or by closing the process "
"handle on windows. If wait is truthy, will wait for the process to finsih and "
"returns the exit code. Otherwise, returns proc.")
},
#endif #endif
{NULL, NULL, NULL} {NULL, NULL, NULL}
}; };

View File

@ -454,7 +454,7 @@ static const char *janet_pretty_colors[] = {
"\x1B[36m", "\x1B[36m",
"\x1B[36m", "\x1B[36m",
"\x1B[36m", "\x1B[36m",
"\x1B[36m" "\x1B[36m",
"\x1B[35m", "\x1B[35m",
"\x1B[36m", "\x1B[36m",
"\x1B[36m", "\x1B[36m",

View File

@ -680,6 +680,8 @@ int janet_cryptorand(uint8_t *out, size_t n) {
arc4random_buf(out, n); arc4random_buf(out, n);
return 0; return 0;
#else #else
(void) n;
(void) out;
return -1; return -1;
#endif #endif
} }