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

LibC: Properly implement the futimens function

Use the new futimens syscall to ensure futimens can actually work.
This change for example allows a user to run "touch non-existing-file"
without getting any error, as expected.
This commit is contained in:
Liav A 2023-04-08 11:39:28 +03:00 committed by Andreas Kling
parent cbf78975f1
commit d05d938e73
3 changed files with 42 additions and 7 deletions

View file

@ -5,6 +5,7 @@
*/
#include <assert.h>
#include <bits/utimens.h>
#include <errno.h>
#include <fcntl.h>
#include <stdio.h>
@ -119,6 +120,6 @@ int fstatat(int fd, char const* path, struct stat* statbuf, int flags)
// https://pubs.opengroup.org/onlinepubs/9699919799/functions/futimens.html
int futimens(int fd, struct timespec const times[2])
{
return utimensat(fd, "", times, 0);
return __utimens(fd, nullptr, times, 0);
}
}