Linux-man Archive on lore.kernel.org
 help / color / Atom feed
* Re: [PATCH v2] exit.3: Use hex for the status mask.
       [not found] ` <20180915173848.19733-1-benjamin@python.org>
@ 2020-02-08 11:00   ` Michael Kerrisk (man-pages)
  2020-02-10 11:02     ` AW: " Walter Harms
  0 siblings, 1 reply; 3+ messages in thread
From: Michael Kerrisk (man-pages) @ 2020-02-08 11:00 UTC (permalink / raw)
  To: Benjamin Peterson; +Cc: mtk.manpages, linux-man, jwilk, Mike Frysinger

Hello Ben,

On 9/15/18 7:38 PM, Benjamin Peterson wrote:
> Admittedly, the POSIX specification for exit() also uses octal. However, 0xFF
> immediately indicates the lowest 8 bits to me whereas I had to think a bit about
> the octal mask.

Thanks. Patch applied. (Mike Frysinger provided a similar patch,
so I've noted you both in the commit.)

Cheers,

Michael

> ---
>  man2/_exit.2 | 2 +-
>  man3/exit.3  | 5 ++---
>  2 files changed, 3 insertions(+), 4 deletions(-)
> 
> diff --git a/man2/_exit.2 b/man2/_exit.2
> index c55d2a612..6e656c8f4 100644
> --- a/man2/_exit.2
> +++ b/man2/_exit.2
> @@ -65,7 +65,7 @@ The process's parent is sent a
>  signal.
>  .PP
>  The value
> -.I "status & 0377"
> +.I "status & 0xFF"
>  is returned to the parent process as the process's exit status, and
>  can be collected using one of the
>  .BR wait (2)
> diff --git a/man3/exit.3 b/man3/exit.3
> index 4a30fc39f..b47ba17a1 100644
> --- a/man3/exit.3
> +++ b/man3/exit.3
> @@ -38,9 +38,8 @@ exit \- cause normal process termination
>  .SH DESCRIPTION
>  The
>  .BR exit ()
> -function causes normal process termination and the
> -value of \fIstatus & 0377\fP is returned to the parent
> -(see
> +function causes normal process termination and the value of \fIstatus &
> +0xFF\fP is returned to the parent (see
>  .BR wait (2)).
>  .PP
>  All functions registered with
> 


-- 
Michael Kerrisk
Linux man-pages maintainer; http://www.kernel.org/doc/man-pages/
Linux/UNIX System Programming Training: http://man7.org/training/

^ permalink raw reply	[flat|nested] 3+ messages in thread

* AW: [PATCH v2] exit.3: Use hex for the status mask.
  2020-02-08 11:00   ` [PATCH v2] exit.3: Use hex for the status mask Michael Kerrisk (man-pages)
@ 2020-02-10 11:02     ` " Walter Harms
  2020-02-24  7:59       ` Michael Kerrisk (man-pages)
  0 siblings, 1 reply; 3+ messages in thread
From: Walter Harms @ 2020-02-10 11:02 UTC (permalink / raw)
  To: Michael Kerrisk (man-pages), Benjamin Peterson
  Cc: linux-man, jwilk, Mike Frysinger

Its a bit late but  ... 

we can be more direct here:

> +function causes normal process termination and the value of \fIstatus &
> +0xFF\fP is returned to the parent (see

function causes normal process termination and  only lowest 8 bits  
(\fIstatus & 0xFF\fP) is returned to the parent (see

JM2C
re,
 wh

________________________________________
Von: linux-man-owner@vger.kernel.org <linux-man-owner@vger.kernel.org> im Auftrag von Michael Kerrisk (man-pages) <mtk.manpages@gmail.com>
Gesendet: Samstag, 8. Februar 2020 12:00
An: Benjamin Peterson
Cc: mtk.manpages@gmail.com; linux-man@vger.kernel.org; jwilk@jwilk.net; Mike Frysinger
Betreff: Re: [PATCH v2] exit.3: Use hex for the status mask.

Hello Ben,

On 9/15/18 7:38 PM, Benjamin Peterson wrote:
> Admittedly, the POSIX specification for exit() also uses octal. However, 0xFF
> immediately indicates the lowest 8 bits to me whereas I had to think a bit about
> the octal mask.

Thanks. Patch applied. (Mike Frysinger provided a similar patch,
so I've noted you both in the commit.)

Cheers,

Michael

> ---
>  man2/_exit.2 | 2 +-
>  man3/exit.3  | 5 ++---
>  2 files changed, 3 insertions(+), 4 deletions(-)
>
> diff --git a/man2/_exit.2 b/man2/_exit.2
> index c55d2a612..6e656c8f4 100644
> --- a/man2/_exit.2
> +++ b/man2/_exit.2
> @@ -65,7 +65,7 @@ The process's parent is sent a
>  signal.
>  .PP
>  The value
> -.I "status & 0377"
> +.I "status & 0xFF"
>  is returned to the parent process as the process's exit status, and
>  can be collected using one of the
>  .BR wait (2)
> diff --git a/man3/exit.3 b/man3/exit.3
> index 4a30fc39f..b47ba17a1 100644
> --- a/man3/exit.3
> +++ b/man3/exit.3
> @@ -38,9 +38,8 @@ exit \- cause normal process termination
>  .SH DESCRIPTION
>  The
>  .BR exit ()
> -function causes normal process termination and the
> -value of \fIstatus & 0377\fP is returned to the parent
> -(see
> +function causes normal process termination and the value of \fIstatus &
> +0xFF\fP is returned to the parent (see
>  .BR wait (2)).
>  .PP
>  All functions registered with
>


--
Michael Kerrisk
Linux man-pages maintainer; http://www.kernel.org/doc/man-pages/
Linux/UNIX System Programming Training: http://man7.org/training/

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: AW: [PATCH v2] exit.3: Use hex for the status mask.
  2020-02-10 11:02     ` AW: " Walter Harms
@ 2020-02-24  7:59       ` Michael Kerrisk (man-pages)
  0 siblings, 0 replies; 3+ messages in thread
From: Michael Kerrisk (man-pages) @ 2020-02-24  7:59 UTC (permalink / raw)
  To: Walter Harms, Benjamin Peterson
  Cc: mtk.manpages, linux-man, jwilk, Mike Frysinger

On 2/10/20 12:02 PM, Walter Harms wrote:
> Its a bit late but  ... 
> 
> we can be more direct here:
> 
>> +function causes normal process termination and the value of \fIstatus &
>> +0xFF\fP is returned to the parent (see
> 
> function causes normal process termination and  only lowest 8 bits  
> (\fIstatus & 0xFF\fP) is returned to the parent (see

Thanks, Walter. I agree that it would not hurt to use a bit more
natural language in the description. I made the text:

       The  exit()  function  causes  normal  process termination and the
       least significant byte of status (i.e., status & 0xFF) is returned
       to the parent (see wait(2)).

Thanks for the suggestion.

Michael

-- 
Michael Kerrisk
Linux man-pages maintainer; http://www.kernel.org/doc/man-pages/
Linux/UNIX System Programming Training: http://man7.org/training/

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, back to index

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <1537033056.1989189.1509225696.4324DB3A@webmail.messagingengine.com>
     [not found] ` <20180915173848.19733-1-benjamin@python.org>
2020-02-08 11:00   ` [PATCH v2] exit.3: Use hex for the status mask Michael Kerrisk (man-pages)
2020-02-10 11:02     ` AW: " Walter Harms
2020-02-24  7:59       ` Michael Kerrisk (man-pages)

Linux-man Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/linux-man/0 linux-man/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 linux-man linux-man/ https://lore.kernel.org/linux-man \
		linux-man@vger.kernel.org
	public-inbox-index linux-man

Example config snippet for mirrors

Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.kernel.vger.linux-man


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git