Mark Wielaard
77482c4bf6
libelf: Use posix_fallocate instead of ftruncate to extend ELF file.
...
This fixes an obscure SIGBUS error when using ELF_C_WRITE_MMAP on an ELF
file that needs extending when the underlying file system is (nearly) full.
Use posix_fallocate to make sure the file content is really there. Using
ftruncate might mean the file is extended, but space isn't allocated yet.
This might cause a SIGBUS once we write into the mmapped space and the disk
is full.
Using fallocate might fail on some file systems. posix_fallocate is
required to extend the file and allocate enough space even if the
underlying filesystem would normally return EOPNOTSUPP or the kernel
doesn't implement the fallocate syscall. Also posix_fallocate has been in
glibc since 2.1.94, while support for fallocate was only added in 2.10
and kernel 2.6.23.
Signed-off-by: Mark Wielaard <mjw@redhat.com >
2015-05-27 17:10:48 +02:00
..
2012-06-05 23:12:05 +02:00
2015-05-27 17:10:48 +02:00
2012-06-05 23:12:05 +02:00
2012-06-05 23:12:05 +02:00
2012-08-14 16:48:50 +02:00
2012-06-05 23:12:05 +02:00
2012-06-05 23:12:05 +02:00
2014-11-17 00:33:36 +01:00
2014-01-23 11:31:53 +01:00
2012-06-05 23:12:05 +02:00
2015-05-18 15:48:04 +02:00
2012-06-05 23:12:05 +02:00
2014-01-23 11:31:53 +01:00
2015-05-18 15:48:04 +02:00
2012-06-05 23:12:05 +02:00
2012-07-17 16:29:18 +02:00
2012-06-05 23:12:05 +02:00
2012-06-05 23:12:05 +02:00
2012-06-05 23:12:05 +02:00
2012-06-05 23:12:05 +02:00
2012-06-05 23:12:05 +02:00
2012-06-05 23:12:05 +02:00
2012-06-05 23:12:05 +02:00
2012-06-05 23:12:05 +02:00
2012-06-05 23:12:05 +02:00
2012-06-05 23:12:05 +02:00
2012-06-05 23:12:05 +02:00
2012-06-05 23:12:05 +02:00
2015-01-12 22:02:46 +01:00
2012-06-05 23:12:05 +02:00
2012-06-05 23:12:05 +02:00
2012-06-05 23:12:05 +02:00
2012-06-05 23:12:05 +02:00
2012-06-05 23:12:05 +02:00
2012-06-05 23:12:05 +02:00
2012-06-05 23:12:05 +02:00
2012-06-05 23:12:05 +02:00
2012-06-05 23:12:05 +02:00
2012-06-05 23:12:05 +02:00
2012-06-05 23:12:05 +02:00
2012-06-05 23:12:05 +02:00
2012-06-05 23:12:05 +02:00
2014-12-17 16:49:02 +01:00
2012-06-05 23:12:05 +02:00
2014-11-26 20:24:13 +01:00
2015-05-18 15:48:04 +02:00
2012-06-05 23:12:05 +02:00
2015-01-15 14:04:28 +01:00
2012-06-05 23:12:05 +02:00
2012-06-05 23:12:05 +02:00
2014-11-17 00:42:53 +01:00
2012-06-05 23:12:05 +02:00
2012-06-05 23:12:05 +02:00
2012-06-05 23:12:05 +02:00
2012-06-05 23:12:05 +02:00
2012-06-05 23:12:05 +02:00
2015-02-06 22:24:08 +01:00
2014-01-23 11:31:53 +01:00
2012-06-05 23:12:05 +02:00
2012-06-05 23:12:05 +02:00
2012-06-05 23:12:05 +02:00
2012-06-05 23:12:05 +02:00
2012-06-05 23:12:05 +02:00
2012-06-05 23:12:05 +02:00
2012-06-05 23:12:05 +02:00
2015-02-06 22:36:43 +01:00
2015-05-27 17:10:48 +02:00
2012-06-05 23:12:05 +02:00
2014-11-17 23:19:03 +01:00
2015-04-28 14:41:12 +02:00
2012-06-05 23:12:05 +02:00
2012-06-05 23:12:05 +02:00
2012-06-05 23:12:05 +02:00
2013-08-28 11:44:41 +02:00
2012-06-05 23:12:05 +02:00
2014-01-23 11:31:53 +01:00
2012-06-05 23:12:05 +02:00
2014-01-23 11:31:53 +01:00
2014-01-23 11:31:53 +01:00
2014-11-16 11:30:51 +01:00
2015-01-15 14:04:28 +01:00
2014-01-23 11:31:53 +01:00
2014-01-23 11:31:53 +01:00
2012-06-05 23:12:05 +02:00
2014-01-23 11:31:53 +01:00
2014-01-23 11:31:53 +01:00
2014-01-23 11:31:53 +01:00
2012-06-05 23:12:05 +02:00
2012-06-05 23:12:05 +02:00
2012-06-05 23:12:05 +02:00
2012-06-05 23:12:05 +02:00
2014-01-23 11:31:53 +01:00
2012-06-05 23:12:05 +02:00
2012-06-05 23:12:05 +02:00
2012-06-05 23:12:05 +02:00
2012-06-05 23:12:05 +02:00
2014-01-23 11:31:53 +01:00
2012-06-05 23:12:05 +02:00
2014-01-23 11:31:53 +01:00
2014-01-23 11:31:53 +01:00
2012-06-05 23:12:05 +02:00
2014-01-23 11:31:53 +01:00
2014-01-23 11:31:53 +01:00
2012-06-05 23:12:05 +02:00
2014-01-23 11:31:53 +01:00
2014-01-23 11:31:53 +01:00
2014-01-23 11:31:53 +01:00
2012-06-05 23:12:05 +02:00
2012-06-05 23:12:05 +02:00
2012-06-05 23:12:05 +02:00
2012-06-05 23:12:05 +02:00
2014-01-23 11:31:53 +01:00
2012-06-05 23:12:05 +02:00
2012-06-05 23:12:05 +02:00
2012-06-05 23:12:05 +02:00
2012-06-05 23:12:05 +02:00
2013-08-28 18:58:10 +02:00
2012-06-05 23:12:05 +02:00
2012-06-05 23:12:05 +02:00
2012-06-05 23:12:05 +02:00
2012-06-05 23:12:05 +02:00
2010-01-07 19:43:42 -08:00
2015-02-19 22:21:46 +01:00
2014-12-18 23:47:22 +01:00
2015-05-13 16:31:52 +02:00
2012-06-05 23:12:05 +02:00
2014-11-26 20:21:44 +01:00
2015-05-06 13:43:22 +02:00