1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-28 12:47:45 +00:00

Kernel+LibC: Implement futimens(3)

Implement futimes() in terms of utimensat(). Now, utimensat() strays
from POSIX compliance because it also accepts a combination of a file
descriptor of a regular file and an empty path. utimensat() then uses
this file descriptor instead of the path to update the last access
and/or modification time of a file. That being said, its prior behavior
remains intact.

With the new behavior of utimensat(), `path` must point to a valid
string; given a null pointer instead of an empty string, utimensat()
sets `errno` to `EFAULT` and returns a failure.
This commit is contained in:
Ariel Don 2022-05-03 14:52:08 -05:00 committed by Andreas Kling
parent 9a6bd85924
commit 8a854ba309
3 changed files with 36 additions and 12 deletions

View file

@ -23,5 +23,6 @@ int fstat(int fd, struct stat* statbuf);
int lstat(char const* path, struct stat* statbuf);
int stat(char const* path, struct stat* statbuf);
int fstatat(int fd, char const* path, struct stat* statbuf, int flags);
int futimens(int fd, struct timespec const times[2]);
__END_DECLS