mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 05:47:35 +00:00
LibC: Negate kernel errors before returning them in posix_fallocate()
Since posix_fallocate() doesn't set errno, it has to make sure to manually "unwrap" any error from the kernel.
This commit is contained in:
parent
f274f04e35
commit
361897192c
1 changed files with 1 additions and 1 deletions
|
@ -117,7 +117,7 @@ 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 posix_fallocate(int fd, off_t offset, off_t len)
|
||||||
{
|
{
|
||||||
// posix_fallocate does not set errno.
|
// posix_fallocate does not set errno.
|
||||||
return static_cast<int>(syscall(SC_posix_fallocate, fd, &offset, &len));
|
return -static_cast<int>(syscall(SC_posix_fallocate, fd, &offset, &len));
|
||||||
}
|
}
|
||||||
|
|
||||||
// https://pubs.opengroup.org/onlinepubs/9699919799/functions/utimensat.html
|
// https://pubs.opengroup.org/onlinepubs/9699919799/functions/utimensat.html
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue