test-sigbus: use posix_fallocate rather than fallocate

Some filesystems do not support fallocate, so we need to fall back on
something like posix_fallocate.

Closes #5833
This commit is contained in:
Evgeny Vereshchagin
2017-05-10 08:47:39 +00:00
parent 554a080674
commit aab7037de4
+1 -1
View File
@@ -38,7 +38,7 @@ int main(int argc, char *argv[]) {
assert_se((fd = mkostemp(template, O_RDWR|O_CREAT|O_EXCL)) >= 0);
assert_se(unlink(template) >= 0);
assert_se(fallocate(fd, 0, 0, page_size() * 8) >= 0);
assert_se(posix_fallocate(fd, 0, page_size() * 8) >= 0);
p = mmap(NULL, page_size() * 16, PROT_READ|PROT_WRITE, MAP_SHARED, fd, 0);
assert_se(p != MAP_FAILED);