Skip to content

Commit

Permalink
Merge pull request #215 from babsingh/v0.48.0-release
Browse files Browse the repository at this point in the history
(0.48) Use fallocate instead of ftruncate
  • Loading branch information
pshipton authored Oct 22, 2024
2 parents 56cbcb6 + f440e51 commit d10a4d5
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions port/linux/omrvmem.c
Original file line number Diff line number Diff line change
Expand Up @@ -1164,8 +1164,8 @@ reserve_memory_with_mmap(struct OMRPortLibrary *portLibrary, void *address, uint
fd = mkostemp(filename, 0);
if (OMRPORT_INVALID_FD != fd) {
unlink(filename);
/* Set the file size with ftruncate. */
if (OMRPORT_INVALID_FD == ftruncate(fd, byteAmount)) {
/* Set the file size with fallocate . */
if (OMRPORT_INVALID_FD == fallocate(fd, 0, 0, byteAmount)) {
close(fd);
fd = OMRPORT_INVALID_FD;
}
Expand Down

0 comments on commit d10a4d5

Please sign in to comment.