This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: gold patch committed: Check IOV_MAX
- From: Ian Lance Taylor <iant at google dot com>
- To: Andreas Schwab <schwab at redhat dot com>
- Cc: binutils at sourceware dot org
- Date: Wed, 09 Mar 2011 07:34:50 -0800
- Subject: Re: gold patch committed: Check IOV_MAX
- References: <mcrfwqxqcqv.fsf@google.com> <m3mxl4y6rt.fsf@redhat.com>
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