1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-28 09:17:45 +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)
{

View file

@ -29,6 +29,7 @@ int inode_watcher_add_watch(int fd, char const* path, size_t path_length, unsign
int inode_watcher_remove_watch(int fd, int wd);
int posix_fadvise(int fd, off_t offset, off_t len, int advice);
int posix_fallocate(int fd, off_t offset, off_t len);
int utimensat(int dirfd, char const* path, struct timespec const times[2], int flag);