1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-26 10:37:45 +00:00

LibC: Implement posix_fadvise() (as a harmless no-op)

This commit is contained in:
Andreas Kling 2022-04-29 20:54:43 +02:00
parent 910532b8dc
commit a7f702a021
2 changed files with 18 additions and 1 deletions

View file

@ -87,4 +87,19 @@ int openat(int dirfd, char const* path, int options, ...)
int rc = syscall(SC_open, &params);
__RETURN_WITH_ERRNO(rc, rc, -1);
}
// https://pubs.opengroup.org/onlinepubs/9699919799/functions/posix_fadvise.html
int posix_fadvise(int fd, off_t offset, off_t len, int advice)
{
// Per POSIX:
// "The posix_fadvise() function shall have no effect on the semantics of other operations on the specified data,
// although it may affect the performance of other operations."
// For now, we simply ignore posix_fadvise() requests. In the future we may use them to optimize performance.
(void)fd;
(void)offset;
(void)len;
(void)advice;
return 0;
}
}