Skip to content

Commit

Permalink
fallocate sets errno on error, posix_fallocate did not (#60185)
Browse files Browse the repository at this point in the history
  • Loading branch information
adamsitnik authored Oct 11, 2021
1 parent 6c09f34 commit 4a42b37
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/libraries/Native/Unix/System.Native/pal_io.c
Original file line number Diff line number Diff line change
Expand Up @@ -1015,7 +1015,7 @@ int32_t SystemNative_FAllocate(intptr_t fd, int64_t offset, int64_t length)
int fileDescriptor = ToFileDescriptor(fd);
int32_t result;
#if HAVE_FALLOCATE // Linux
while ((result = fallocate(fileDescriptor, FALLOC_FL_KEEP_SIZE, (off_t)offset, (off_t)length)) == EINTR);
while ((result = fallocate(fileDescriptor, FALLOC_FL_KEEP_SIZE, (off_t)offset, (off_t)length)) == -1 && errno == EINTR);
#elif defined(F_PREALLOCATE) // macOS
fstore_t fstore;
fstore.fst_flags = F_ALLOCATEALL; // Allocate all requested space or no space at all.
Expand Down

0 comments on commit 4a42b37

Please sign in to comment.