1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 18:57:45 +00:00

LibCore: Add Core::System::posix_fallocate()

This commit is contained in:
Andreas Kling 2022-11-27 19:46:03 +01:00
parent 9249bcb5aa
commit c8ff2184bd
2 changed files with 14 additions and 0 deletions

View file

@ -1400,4 +1400,14 @@ ErrorOr<String> readlink(StringView pathname)
#endif
}
#ifdef AK_OS_SERENITY
ErrorOr<void> posix_fallocate(int fd, off_t offset, off_t length)
{
int rc = ::posix_fallocate(fd, offset, length);
if (rc != 0)
return Error::from_syscall("posix_fallocate"sv, -rc);
return {};
}
#endif
}