1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 01:17:35 +00:00

Kernel+LibC: Add posix_fallocate syscall

This commit is contained in:
Hendiadyoin1 2022-06-18 18:37:54 +02:00 committed by Andreas Kling
parent ad904cdcab
commit d783389877
6 changed files with 70 additions and 0 deletions

View file

@ -104,6 +104,13 @@ int posix_fadvise(int fd, off_t offset, off_t len, int advice)
return 0;
}
// https://pubs.opengroup.org/onlinepubs/9699919799/functions/posix_fallocate.html
int posix_fallocate(int fd, off_t offset, off_t len)
{
// posix_fallocate does not set errno.
return static_cast<int>(syscall(SC_posix_fallocate, fd, &offset, &len));
}
// https://pubs.opengroup.org/onlinepubs/9699919799/functions/utimensat.html
int utimensat(int dirfd, char const* path, struct timespec const times[2], int flag)
{