Hi Mark!

Mark H Weaver <m...@netris.org> writes:

> When the manual says "exit status as returned by ‘waitpid’", it's
> referring to the "status value" portion of what 'waitpid' returns,
> i.e. the CDR of 'waitpid's return value.

Thank you for the clarification!  It makes more sense now.

>>     scheme@(guile-user)> (status:exit-val $1)
>>     $5 = 0
>>     scheme@(guile-user)> (status:exit-val $3)
>>     $6 = 0
>
> Right, these procedures are meant to operate on the status value.

I see.  Then what's the intended use of status:exit-val?  I've read its
documentation and viewed its source a few times, and it seems like this
procedure basically behaves like the identity function.  I'm having
trouble thinking of a case where one would use status:exit-val instead
of simply using the integer status value directly.

>> Is the documentation incorrect?
>
> I'm not sure I'd call it "incorrect", but I agree that it's somewhat
> confusing and could use clarification.  Would you like to propose a
> patch?

I'm still a little confused about the intended use of status:exit-val,
but how does the attached patch look to you?  It's a small change, but I
think this would have been enough to dispel my confusion.

-- 
Chris
From 4acd5ec212415efff6b9f847d1a7b9c6c9e7a526 Mon Sep 17 00:00:00 2001
From: Chris Marusich <cmmarus...@gmail.com>
Date: Sun, 14 Oct 2018 00:47:23 -0700
Subject: [PATCH] Clarify the manual's "Processes" section.

* doc/ref/posix.texi (Processes): Explicitly state that status:exit-val,
status:term-sig, and status:stop-sig take an integer as input.
---
 doc/ref/posix.texi | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/doc/ref/posix.texi b/doc/ref/posix.texi
index 5cb68a292..e39ea119c 100644
--- a/doc/ref/posix.texi
+++ b/doc/ref/posix.texi
@@ -1749,8 +1749,8 @@ The integer status value.
 @end deffn
 
 The following three
-functions can be used to decode the process status code returned
-by @code{waitpid}.
+functions take an integer as input and can be used to decode the integer
+status value returned by @code{waitpid}.
 
 @deffn {Scheme Procedure} status:exit-val status
 @deffnx {C Function} scm_status_exit_val (status)
-- 
2.18.0

Attachment: signature.asc
Description: PGP signature

Reply via email to