8168628: (fc) SIGBUS when extending file size to map it

Synchronize file extension and subsequent map0(); on Linux use fallocate64() instead of ftruncate64().

Reviewed-by: rehn, simonis, alanb
This commit is contained in:
Brian Burkhalter 2016-12-02 13:22:16 -08:00
parent 1bcb7f93c0
commit d8e5d53723
10 changed files with 309 additions and 49 deletions

View file

@ -1,5 +1,5 @@
/*
* Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2000, 2016, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -84,6 +84,11 @@ class FileDispatcherImpl extends FileDispatcher {
return truncate0(fd, size);
}
int allocate(FileDescriptor fd, long size) throws IOException {
// truncate0() works for extending and truncating file size
return truncate0(fd, size);
}
long size(FileDescriptor fd) throws IOException {
return size0(fd);
}