[PATCH] libelf: Use possix_fallocate instead of ftruncate to extend ELF file.

Mark Wielaard mjw at redhat.com
Wed May 27 15:13:37 UTC 2015


On Fri, 2015-05-15 at 12:08 +0200, Mark Wielaard wrote:
> Fixed it everywhere and updated the mjw/pending branch. Not pushing yet.
> I would like to know what others think about using posix_fallocate
> instead of ftruncate. There is some discussion on the glibc mailinglist
> about whether or not posix_fallocate actually guarantees to extend the
> file or not. I think it does, that is the main difference with fallocate
> (and ftruncate). But lets see what glibc ends up deciding.
> https://sourceware.org/ml/libc-alpha/2015-04/msg00309.html

Pushed now to master. It does look like using posix_fallocate in this
particular case over ftruncate is always better. Even if it
theoretically doesn't prevent the SIGBUS issue in all corner cases. In
practice it should.

Cheers,

Mark


More information about the elfutils-devel mailing list