public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
From: Ian Lance Taylor <iant@google.com>
To: Andreas Schwab <schwab@redhat.com>
Cc: binutils@sourceware.org
Subject: Re: gold patch committed: Check IOV_MAX
Date: Wed, 09 Mar 2011 15:35:00 -0000	[thread overview]
Message-ID: <mcr4o7cpasl.fsf@google.com> (raw)
In-Reply-To: <m3mxl4y6rt.fsf@redhat.com> (Andreas Schwab's message of "Wed, 09	Mar 2011 10:36:54 +0100")

Andreas Schwab <schwab@redhat.com> writes:

> Ian Lance Taylor <iant@google.com> writes:
>
>> @@ -605,11 +606,22 @@ File_read::do_readv(off_t base, const Re
>>  	       got, want, static_cast<long long>(base + first_offset));
>>  }
>>  
>> +// Portable IOV_MAX.
>> +
>> +#if !defined(HAVE_READV)
>> +#define GOLD_IOV_MAX 1
>> +#elif defined(IOV_MAX)
>> +#define GOLD_IOV_MAX IOV_MAX
>> +#else
>> +#define GOLD_IOV_MAX (File_read::max_readv_entries * 2)
>> +#endif
>> +
>>  // Read several pieces of data from the file.
>>  
>>  void
>>  File_read::read_multiple(off_t base, const Read_multiple& rm)
>>  {
>> +  static size_t iov_max = GOLD_IOV_MAX;
>
> const?

I've written the code this way because IOV_MAX need not be a constant.
It may be a call to sysconf.

Ian

  reply	other threads:[~2011-03-09 15:35 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-03-09  1:55 Ian Lance Taylor
2011-03-09  9:37 ` Andreas Schwab
2011-03-09 15:35   ` Ian Lance Taylor [this message]
2011-03-09 16:12     ` John Reiser
2011-03-09 16:20       ` Ian Lance Taylor
2011-03-09 16:15     ` Andreas Schwab

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=mcr4o7cpasl.fsf@google.com \
    --to=iant@google.com \
    --cc=binutils@sourceware.org \
    --cc=schwab@redhat.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 read-only IMAP folder(s) and NNTP newsgroup(s).