Skip to content

Commit d10a4d5

Browse files
authored
Merge pull request #215 from babsingh/v0.48.0-release
(0.48) Use fallocate instead of ftruncate
2 parents 56cbcb6 + f440e51 commit d10a4d5

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

port/linux/omrvmem.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1164,8 +1164,8 @@ reserve_memory_with_mmap(struct OMRPortLibrary *portLibrary, void *address, uint
11641164
fd = mkostemp(filename, 0);
11651165
if (OMRPORT_INVALID_FD != fd) {
11661166
unlink(filename);
1167-
/* Set the file size with ftruncate. */
1168-
if (OMRPORT_INVALID_FD == ftruncate(fd, byteAmount)) {
1167+
/* Set the file size with fallocate . */
1168+
if (OMRPORT_INVALID_FD == fallocate(fd, 0, 0, byteAmount)) {
11691169
close(fd);
11701170
fd = OMRPORT_INVALID_FD;
11711171
}

0 commit comments

Comments
 (0)