public inbox for libc-alpha@sourceware.org
 help / color / mirror / Atom feed
From: Florian Weimer <fweimer@redhat.com>
To: Siddhesh Poyarekar <siddhesh@sourceware.org>, libc-alpha@sourceware.org
Cc: carlos@redhat.com
Subject: Re: [PATCH 2/4] Initialize tunable list with the GLIBC_TUNABLES environment variable
Date: Fri, 30 Dec 2016 09:50:00 -0000	[thread overview]
Message-ID: <3abae843-c36e-171a-b412-2fe1b76685e9@redhat.com> (raw)
In-Reply-To: <1483070938-2308-3-git-send-email-siddhesh@sourceware.org>

On 12/30/2016 05:08 AM, Siddhesh Poyarekar wrote:
> +  /* Bare mmap system call to avoid setting errno which may not be available
> +     yet.  */
> +  INTERNAL_SYSCALL_DECL (err);
> +  char *out = (char *) INTERNAL_SYSCALL_CALL (mmap, err, NULL, i, PROT_READ | PROT_WRITE,
> +				     MAP_ANONYMOUS | MAP_PRIVATE, -1, 0);
> +  if (INTERNAL_SYSCALL_ERROR_P (out, err))
> +    return NULL;

INTERNAL_SYSCALL is not available in generic code.

You should use sbrk (like the TCB allocation in the startup code; it 
would also reduce wasted memory), or mmap with a comment indicating that 
this will crash if mmap updates errno.  (I believe the comment in the 
startup code about mmap is wrong.)

Thanks,
Florian

  reply	other threads:[~2016-12-30  9:50 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-12-30  4:09 [PATCH v7 0/4] glibc tunables Siddhesh Poyarekar
2016-12-30  4:09 ` [PATCH 1/4] Add framework for tunables Siddhesh Poyarekar
2017-02-06 22:36   ` Andreas Schwab
2017-02-07  6:49     ` Siddhesh Poyarekar
2017-02-07 16:06       ` Andreas Schwab
2017-02-08  8:48         ` Siddhesh Poyarekar
2017-02-06 22:59   ` Andreas Schwab
2016-12-30  4:09 ` [PATCH 4/4] User manual documentation " Siddhesh Poyarekar
2016-12-30  9:50   ` Florian Weimer
2016-12-31 12:40     ` Siddhesh Poyarekar
2016-12-30  4:09 ` [PATCH 2/4] Initialize tunable list with the GLIBC_TUNABLES environment variable Siddhesh Poyarekar
2016-12-30  9:50   ` Florian Weimer [this message]
2016-12-30  4:09 ` [PATCH 3/4] Enhance --enable-tunables to select tunables frontend at build time Siddhesh Poyarekar
2016-12-30 14:55   ` Joseph Myers
  -- strict thread matches above, loose matches on Subject: below --
2016-12-31 15:41 [PATCH v8 0/4] glibc tunables Siddhesh Poyarekar
2016-12-31 15:41 ` [PATCH 2/4] Initialize tunable list with the GLIBC_TUNABLES environment variable Siddhesh Poyarekar
2016-12-31 15:45   ` Florian Weimer
2016-12-31 15:50     ` Siddhesh Poyarekar
2016-12-31 15:55       ` Siddhesh Poyarekar
2016-12-31 16:41         ` Florian Weimer
2016-11-16  8:35 [PATCHv6 0/4] glibc tunables Siddhesh Poyarekar
2016-11-16  8:35 ` [PATCH 2/4] Initialize tunable list with the GLIBC_TUNABLES environment variable Siddhesh Poyarekar
2016-12-27 11:41   ` Florian Weimer
2016-12-27 21:35     ` Siddhesh Poyarekar

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=3abae843-c36e-171a-b412-2fe1b76685e9@redhat.com \
    --to=fweimer@redhat.com \
    --cc=carlos@redhat.com \
    --cc=libc-alpha@sourceware.org \
    --cc=siddhesh@sourceware.org \
    /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 read-only IMAP folder(s) and NNTP newsgroup(s).