[gold] RFC: Add options for controlling mmap and fallocate of output file

Ian Lance Taylor iant@google.com
Wed Jun 6 04:45:00 GMT 2012


Cary Coutant <ccoutant@google.com> writes:

>> I don't understand why you are bothering with <linux/falloc.h> and
>> FALLOC_FL_KEEP_SIZE.  Why not just pass 0 as the mode argument to
>> fallocate?
>
> Careless reading of the man page :-). For some reason, I read it to
> mean I *had* to pass that flag. I'll fix it.
>
> Don't I still need to include <linux/falloc.h> and then call
> ::fallocate under an #ifdef HAVE_LINUX_FALLOC_H? The only declaration
> for fallocate() I found in the Linux headers is in that header file.
> Since the man page said it's highly non-portable, I figured I needed
> the configure test.

At least on my system <linux/falloc.h> doesn't declare fallocate
anyhow.  It is declared by <fcntl.h>, though.

Ian



More information about the Binutils mailing list