diff --git a/libs/libc/unistd/lib_futimes.c b/libs/libc/unistd/lib_futimes.c index 1029342a52..30616492f2 100644 --- a/libs/libc/unistd/lib_futimes.c +++ b/libs/libc/unistd/lib_futimes.c @@ -22,10 +22,8 @@ * Included Files ****************************************************************************/ -#include - +#include #include -#include /**************************************************************************** * Public Functions @@ -33,6 +31,17 @@ int futimes(int fd, const struct timeval tv[2]) { - set_errno(ENOTSUP); - return ERROR; + struct timespec times[2]; + + if (tv == NULL) + { + return futimens(fd, NULL); + } + + times[0].tv_sec = tv[0].tv_sec; + times[0].tv_nsec = tv[0].tv_usec * 1000; + times[1].tv_sec = tv[1].tv_sec; + times[1].tv_nsec = tv[1].tv_usec * 1000; + + return futimens(fd, times); }