1
0
mirror of https://github.com/janet-lang/janet synced 2025-04-21 02:03:15 +00:00

Clarify wording of docstrings further

This commit is contained in:
Michael Camilleri 2025-03-02 13:25:14 +09:00
parent 1b6437a4f8
commit 39f5c539d7
No known key found for this signature in database
GPG Key ID: 7EB218A48DF8B572

View File

@ -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