--- nono/host/hostwindrv.cpp 2026/04/29 17:05:55 1.1.1.4 +++ nono/host/hostwindrv.cpp 2026/04/29 17:06:02 1.1.1.5 @@ -10,6 +10,7 @@ #include "hostwindrv.h" #include "ascii_ctype.h" +#include "mytime.h" #include #include #include @@ -834,9 +835,11 @@ HostWindrv::SetFileTime(Windrv::FCB *fcb // [0] が atime、[1] が mtime。 struct timeval times[2]; - times[1].tv_sec = Human68k::DateTime2Unixtime(datetime); + uint64 now = get_hosttime_usec(); + times[0].tv_sec = now / 1000'000U; + times[0].tv_usec = now % 1000'000U; + times[1].tv_sec = Human68k::DateTime2Unixtime(datetime); times[1].tv_usec = 0; - gettimeofday(×[0], NULL); int r = futimes(fcb->fd, times); if (r < 0) { putmsg(1, "%s: futimes: %s", __func__, strerror(errno)); @@ -849,6 +852,6 @@ HostWindrv::SetFileTime(Windrv::FCB *fcb /*static*/ uint64 HostWindrv::timespec2nsec(const struct timespec& ts) { - return (uint64)ts.tv_sec * 1000'000'000 + (uint64)ts.tv_nsec; + return sec_to_nsec(ts.tv_sec) + ts.tv_nsec; } #endif