mirror of
https://github.com/openjdk/jdk.git
synced 2025-08-27 23:04:50 +02:00
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:
parent
1bcb7f93c0
commit
d8e5d53723
10 changed files with 309 additions and 49 deletions
|
@ -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);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue