mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-22 15:40:19 +00:00
LibCore: Add Core::System::posix_fallocate()
This commit is contained in:
parent
9249bcb5aa
commit
c8ff2184bd
Notes:
sideshowbarker
2024-07-17 03:58:12 +09:00
Author: https://github.com/awesomekling Commit: https://github.com/SerenityOS/serenity/commit/c8ff2184bd Pull-request: https://github.com/SerenityOS/serenity/pull/16231 Reviewed-by: https://github.com/Hendiadyoin1 Reviewed-by: https://github.com/emanuele6 Reviewed-by: https://github.com/fdellwing Reviewed-by: https://github.com/skyrising Reviewed-by: https://github.com/supercomputer7 Reviewed-by: https://github.com/timschumi ✅
2 changed files with 14 additions and 0 deletions
|
@ -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
|
||||
|
||||
}
|
||||
|
|
|
@ -206,4 +206,8 @@ ErrorOr<void> unlockpt(int fildes);
|
|||
ErrorOr<void> access(StringView pathname, int mode);
|
||||
ErrorOr<String> readlink(StringView pathname);
|
||||
|
||||
#ifdef AK_OS_SERENITY
|
||||
ErrorOr<void> posix_fallocate(int fd, off_t offset, off_t length);
|
||||
#endif
|
||||
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue