diff --git a/src/core/os.c b/src/core/os.c index 1f78be47..9e59de91 100644 --- a/src/core/os.c +++ b/src/core/os.c @@ -629,10 +629,12 @@ os_proc_wait_impl(JanetProc *proc) { JANET_CORE_FN(os_proc_wait, "(os/proc-wait proc)", - "Suspend the current fiber until `proc` completes. Once `proc` is completed, return " - "the exit code of `proc`. This function cannot be called more than once on the same " - "core/process value. When creating subprocesses using `os/spawn`, this function " - "should be called on the returned value to avoid zombie processes.") { + "Suspend the current fiber until the subprocess `proc` completes. Once `proc` " + "completes, return the exit code of `proc`. If called more than once on the same " + "core/process value, will raise an error. Note that an error can occur even if " + "`os/proc-wait` is apparently canceled (e.g. with `ev/with-deadline`) due to the way " + "`os/proc-wait` is implemented. When creating subprocesses using `os/spawn`, this " + "function should be called on the returned value to avoid zombie processes.") { janet_fixarity(argc, 1); JanetProc *proc = janet_getabstract(argv, 0, &ProcAT); #ifdef JANET_EV @@ -741,12 +743,12 @@ static int get_signal_kw(const Janet *argv, int32_t n) { JANET_CORE_FN(os_proc_kill, "(os/proc-kill proc &opt wait signal)", - "Kill `proc` by sending SIGKILL to it on POSIX systems, or by closing the process " - "handle on Windows. If `proc` has already completed, raise an error. If `wait` is " - "truthy, will wait for `proc` to complete and return the exit code (this will raise " - "an error if `proc` is being awaited by another fiber). Otherwise, return `proc`. " - "If `signal` is provided, send it instead of SIGKILL. Signal keywords are named " - "after their C counterparts but in lowercase with the leading SIG stripped. " + "Kill the subprocess `proc` by sending SIGKILL to it on POSIX systems, or by closing " + "the process handle on Windows. If `proc` has already completed, raise an error. If " + "`wait` is truthy, will wait for `proc` to complete and return the exit code (this " + "will raise an error if `proc` is being awaited by another fiber). Otherwise, return " + "`proc`. If `signal` is provided, send it instead of SIGKILL. Signal keywords are " + "named after their C counterparts but in lowercase with the leading SIG stripped. " "`signal` is ignored on Windows.") { janet_arity(argc, 1, 3); JanetProc *proc = janet_getabstract(argv, 0, &ProcAT); @@ -785,9 +787,10 @@ JANET_CORE_FN(os_proc_kill, JANET_CORE_FN(os_proc_close, "(os/proc-close proc)", - "Close pipes created by `os/spawn` if they have not been closed. Then, if `proc` is " - "not being awaited by another fiber, wait. If this function waits, when `proc` " - "completes, return the exit code of `proc`. Otherwise, return nil.") { + "Close pipes created for subprocess `proc` by `os/spawn` if they have not been " + "closed. Then, if `proc` is not being awaited by another fiber, wait. If this " + "function waits, when `proc` completes, return the exit code of `proc`. Otherwise, " + "return nil.") { janet_fixarity(argc, 1); JanetProc *proc = janet_getabstract(argv, 0, &ProcAT); #ifdef JANET_EV