linux-man.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Michael Kerrisk (man-pages)" <mtk.manpages@gmail.com>
To: Christian Brauner <christian@brauner.io>
Cc: mtk.manpages@gmail.com, adrian@lisas.de,
	akpm@linux-foundation.org, arnd@arndb.de, avagin@gmail.com,
	christian.brauner@ubuntu.com, dhowells@redhat.com,
	fweimer@redhat.com, jannh@google.com, keescook@chromium.org,
	linux-api@vger.kernel.org, linux-kernel@vger.kernel.org,
	linux-man@vger.kernel.org, mingo@elte.hu, oleg@redhat.com,
	xemul@virtuozzo.com
Subject: Re: [PATCH 2/3] clone.2: Check for MAP_FAILED not NULL on mmap()
Date: Sun, 17 Nov 2019 19:01:18 +0100	[thread overview]
Message-ID: <e94e46a1-d852-f5df-352c-592d5e0e9c6a@gmail.com> (raw)
In-Reply-To: <20191116114114.7066-2-christian@brauner.io>

On 11/16/19 12:41 PM, Christian Brauner wrote:
> From: Christian Brauner <christian.brauner@ubuntu.com>
> 
> If mmap() fails it will return MAP_FAILED which according to the manpage
> is (void *)-1 not NULL.

Sigh! Bad editing on my part.

Thanks, Christian.

Patch applied.

Cheers,

Michael



> Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
> ---
>  man2/clone.2 | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/man2/clone.2 b/man2/clone.2
> index 57a9eaba7..faff2ada6 100644
> --- a/man2/clone.2
> +++ b/man2/clone.2
> @@ -1628,7 +1628,7 @@ main(int argc, char *argv[])
>  
>      stack = mmap(NULL, STACK_SIZE, PROT_READ | PROT_WRITE,
>                   MAP_PRIVATE | MAP_ANONYMOUS | MAP_STACK, \-1, 0);
> -    if (stack == NULL)
> +    if (stack == MAP_FAILED)
>          errExit("mmap");
>  
>      stackTop = stack + STACK_SIZE;  /* Assume stack grows downward */
> 


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

  reply	other threads:[~2019-11-17 18:01 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-11-16 11:41 [PATCH 1/3] clone.2: Fix typos Christian Brauner
2019-11-16 11:41 ` [PATCH 2/3] clone.2: Check for MAP_FAILED not NULL on mmap() Christian Brauner
2019-11-17 18:01   ` Michael Kerrisk (man-pages) [this message]
2019-11-16 11:41 ` [PATCH 3/3] clone.2: Use pid_t for clone3() {child,parent}_tid Christian Brauner
2019-11-17 18:02   ` Michael Kerrisk (man-pages)
2019-11-17 18:00 ` [PATCH 1/3] clone.2: Fix typos Michael Kerrisk (man-pages)

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=e94e46a1-d852-f5df-352c-592d5e0e9c6a@gmail.com \
    --to=mtk.manpages@gmail.com \
    --cc=adrian@lisas.de \
    --cc=akpm@linux-foundation.org \
    --cc=arnd@arndb.de \
    --cc=avagin@gmail.com \
    --cc=christian.brauner@ubuntu.com \
    --cc=christian@brauner.io \
    --cc=dhowells@redhat.com \
    --cc=fweimer@redhat.com \
    --cc=jannh@google.com \
    --cc=keescook@chromium.org \
    --cc=linux-api@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-man@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=oleg@redhat.com \
    --cc=xemul@virtuozzo.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).