From 8c4198fbb037357347c81d91596ef8ffa670a553 Mon Sep 17 00:00:00 2001 From: AyushCodes160 Date: Mon, 1 Dec 2025 12:14:58 +0530 Subject: [PATCH] fs: preserve nanosecond resolution in uv__fs_to_timespec Remove microsecond truncation to utilize full nanosecond resolution supported by utimesat(). --- src/unix/fs.c | 7 ------- 1 file changed, 7 deletions(-) diff --git a/src/unix/fs.c b/src/unix/fs.c index bd3f59628..e66c9d299 100644 --- a/src/unix/fs.c +++ b/src/unix/fs.c @@ -224,13 +224,6 @@ static struct timespec uv__fs_to_timespec(double time) { ts.tv_sec = time; ts.tv_nsec = (time - ts.tv_sec) * 1e9; - /* TODO(bnoordhuis) Remove this. utimesat() has nanosecond resolution but we - * stick to microsecond resolution for the sake of consistency with other - * platforms. I'm the original author of this compatibility hack but I'm - * less convinced it's useful nowadays. - */ - ts.tv_nsec -= ts.tv_nsec % 1000; - if (ts.tv_nsec < 0) { ts.tv_nsec += 1e9; ts.tv_sec -= 1;