From f49fcaae400ffe92d652b18dba4244b618915396 Mon Sep 17 00:00:00 2001 From: Huo Yaoyuan Date: Wed, 10 Sep 2025 23:39:35 +0800 Subject: [PATCH 1/8] Implement GetSystemTimeAsFileTime in minipal --- src/coreclr/inc/stresslog.h | 2 +- .../nativeaot/Runtime/eventpipe/ep-rt-aot.cpp | 5 +---- src/coreclr/nativeaot/Runtime/inc/stressLog.h | 2 +- src/coreclr/nativeaot/Runtime/stressLog.cpp | 2 +- src/coreclr/utilcode/stresslog.cpp | 2 +- .../vm/eventing/eventpipe/ep-rt-coreclr.h | 5 +---- src/native/minipal/time.c | 20 +++++++++++++++++++ src/native/minipal/time.h | 3 +++ 8 files changed, 29 insertions(+), 12 deletions(-) diff --git a/src/coreclr/inc/stresslog.h b/src/coreclr/inc/stresslog.h index ed32b1fd28874e..57a7dc60c2590a 100644 --- a/src/coreclr/inc/stresslog.h +++ b/src/coreclr/inc/stresslog.h @@ -225,7 +225,7 @@ class StressLog { CRITSEC_COOKIE lock; // lock uint64_t tickFrequency; // number of ticks per second uint64_t startTimeStamp; // start time from when tick counter started - FILETIME startTime; // time the application started + int64_t startTime; // time the application started SIZE_T moduleOffset; // Used to compute format strings. struct ModuleDesc { diff --git a/src/coreclr/nativeaot/Runtime/eventpipe/ep-rt-aot.cpp b/src/coreclr/nativeaot/Runtime/eventpipe/ep-rt-aot.cpp index 5d5e539e0c1b90..ec4c1031d4fe47 100644 --- a/src/coreclr/nativeaot/Runtime/eventpipe/ep-rt-aot.cpp +++ b/src/coreclr/nativeaot/Runtime/eventpipe/ep-rt-aot.cpp @@ -519,10 +519,7 @@ int64_t ep_rt_aot_system_timestamp_get (void) { STATIC_CONTRACT_NOTHROW; - - FILETIME value; - PalGetSystemTimeAsFileTime (&value); - return static_cast(((static_cast(value.dwHighDateTime)) << 32) | static_cast(value.dwLowDateTime)); + return minipal_get_system_time(); } int32_t diff --git a/src/coreclr/nativeaot/Runtime/inc/stressLog.h b/src/coreclr/nativeaot/Runtime/inc/stressLog.h index d3184d7056fb19..690afcc6c77d46 100644 --- a/src/coreclr/nativeaot/Runtime/inc/stressLog.h +++ b/src/coreclr/nativeaot/Runtime/inc/stressLog.h @@ -236,7 +236,7 @@ class StressLog { CrstStatic *pLock; // lock uint64_t tickFrequency; // number of ticks per second uint64_t startTimeStamp; // start time from when tick counter started - FILETIME startTime; // time the application started + int64_t startTime; // time the application started size_t moduleOffset; // Used to compute format strings. #ifndef DACCESS_COMPILE diff --git a/src/coreclr/nativeaot/Runtime/stressLog.cpp b/src/coreclr/nativeaot/Runtime/stressLog.cpp index 9253a9eb0e8709..e3a5f8d8efe6f6 100644 --- a/src/coreclr/nativeaot/Runtime/stressLog.cpp +++ b/src/coreclr/nativeaot/Runtime/stressLog.cpp @@ -118,7 +118,7 @@ void StressLog::Initialize(unsigned facilities, unsigned level, unsigned maxByt theLog.tickFrequency = getTickFrequency(); - PalGetSystemTimeAsFileTime (&theLog.startTime); + theLog.startTime = minipal_get_system_time(); theLog.startTimeStamp = getTimeStamp(); theLog.moduleOffset = (size_t)hMod; // HMODULES are base addresses. diff --git a/src/coreclr/utilcode/stresslog.cpp b/src/coreclr/utilcode/stresslog.cpp index 3fd772c41e92b5..5446ceb80dc3df 100644 --- a/src/coreclr/utilcode/stresslog.cpp +++ b/src/coreclr/utilcode/stresslog.cpp @@ -251,7 +251,7 @@ void StressLog::Initialize(unsigned facilities, unsigned level, unsigned maxByte theLog.tickFrequency = getTickFrequency(); - GetSystemTimeAsFileTime(&theLog.startTime); + theLog.startTime = minipal_get_system_time(); theLog.startTimeStamp = getTimeStamp(); theLog.moduleOffset = (SIZE_T)moduleBase; diff --git a/src/coreclr/vm/eventing/eventpipe/ep-rt-coreclr.h b/src/coreclr/vm/eventing/eventpipe/ep-rt-coreclr.h index 5ac80179fc5e0a..8e89a1bf9fd4ba 100644 --- a/src/coreclr/vm/eventing/eventpipe/ep-rt-coreclr.h +++ b/src/coreclr/vm/eventing/eventpipe/ep-rt-coreclr.h @@ -1042,10 +1042,7 @@ int64_t ep_rt_system_timestamp_get (void) { STATIC_CONTRACT_NOTHROW; - - FILETIME value; - GetSystemTimeAsFileTime (&value); - return static_cast(((static_cast(value.dwHighDateTime)) << 32) | static_cast(value.dwLowDateTime)); + return minipal_get_system_time(); } static diff --git a/src/native/minipal/time.c b/src/native/minipal/time.c index 844e10287f4144..d6c9550989e5b0 100644 --- a/src/native/minipal/time.c +++ b/src/native/minipal/time.c @@ -32,6 +32,13 @@ int64_t minipal_lowres_ticks() return GetTickCount64(); } +uint64_t minipal_get_system_time() +{ + FILETIME filetime; + GetSystemTimeAsFileTime(&filetime); + return ((uint64_t)filetime.dwHighDateTime << 32) | filetime.dwLowDateTime; +} + #else // HOST_WINDOWS #include "minipalconfig.h" @@ -68,6 +75,7 @@ inline static void YieldProcessor(void) #define tccSecondsToNanoSeconds 1000000000 // 10^9 #define tccSecondsToMilliSeconds 1000 // 10^3 #define tccMilliSecondsToNanoSeconds 1000000 // 10^6 +#define tccSecondsTo100NS 10000000 // 10^7 int64_t minipal_hires_tick_frequency(void) { return tccSecondsToNanoSeconds; @@ -125,6 +133,18 @@ int64_t minipal_lowres_ticks(void) #endif } +uint64_t minipal_get_system_time() +{ + struct timespec ts; + if (clock_gettime(CLOCK_REALTIME, &ts) != 0) + { + assert(!"clock_gettime(CLOCK_REALTIME) failed"); + } + + const int64_t SECS_BETWEEN_1601_AND_1970_EPOCHS = 11644473600LL; + return ((int64_t)(ts.tv_sec) + SECS_BETWEEN_1601_AND_1970_EPOCHS) * tccSecondsTo100NS + (ts.tv_nsec / 100); +} + #endif // HOST_WINDOWS void minipal_microdelay(uint32_t usecs, uint32_t* usecsSinceYield) diff --git a/src/native/minipal/time.h b/src/native/minipal/time.h index f0ada2f7f507ce..eb618dd8b79d48 100644 --- a/src/native/minipal/time.h +++ b/src/native/minipal/time.h @@ -28,6 +28,9 @@ extern "C" // the containing algorithm could handle cases when busy-waiting time is too high. void minipal_microdelay(uint32_t usecs, uint32_t* usecsSinceYield); + // Return system time in Windows FILETIME precision (100ns since 01 January 1601). + uint64_t minipal_get_system_time(void); + #ifdef __cplusplus } #endif // __cplusplus From 718bafae7ddef220dfae2e162c7d9da1beec1342 Mon Sep 17 00:00:00 2001 From: Huo Yaoyuan Date: Wed, 10 Sep 2025 23:46:40 +0800 Subject: [PATCH 2/8] Cleanup FILETIME manipulation routines --- .../dlls/mscordac/mscordac_unixexports.src | 2 - src/coreclr/nativeaot/Runtime/Pal.h | 2 - .../nativeaot/Runtime/unix/PalUnix.cpp | 15 - .../nativeaot/Runtime/windows/PalMinWin.cpp | 5 - src/coreclr/pal/inc/pal.h | 15 - src/coreclr/pal/inc/palprivate.h | 7 - src/coreclr/pal/src/CMakeLists.txt | 1 - src/coreclr/pal/src/file/file.cpp | 1 - src/coreclr/pal/src/file/filetime.cpp | 293 ------------------ src/coreclr/pal/src/include/pal/filetime.h | 47 --- src/coreclr/pal/tests/palsuite/CMakeLists.txt | 1 - .../pal/tests/palsuite/compilableTests.txt | 1 - .../test1/GetSystemTimeAsFileTime.cpp | 88 ------ .../pal/tests/palsuite/paltestlist.txt | 1 - 14 files changed, 479 deletions(-) delete mode 100644 src/coreclr/pal/src/file/filetime.cpp delete mode 100644 src/coreclr/pal/src/include/pal/filetime.h delete mode 100644 src/coreclr/pal/tests/palsuite/file_io/GetSystemTimeAsFileTime/test1/GetSystemTimeAsFileTime.cpp diff --git a/src/coreclr/dlls/mscordac/mscordac_unixexports.src b/src/coreclr/dlls/mscordac/mscordac_unixexports.src index 0b53a46fbb72a6..4b55a5dee021f8 100644 --- a/src/coreclr/dlls/mscordac/mscordac_unixexports.src +++ b/src/coreclr/dlls/mscordac/mscordac_unixexports.src @@ -79,7 +79,6 @@ nativeStringResourceTable_mscorrc #FormatMessageW #FreeEnvironmentStringsW #FreeLibrary -#FileTimeToSystemTime #GetCurrentProcess #GetCurrentProcessId #GetCurrentThreadId @@ -94,7 +93,6 @@ nativeStringResourceTable_mscorrc #GetStdHandle #GetSystemInfo #GetSystemTime -#GetSystemTimeAsFileTime #GetTempPathA #GetTempPathW #LoadLibraryExA diff --git a/src/coreclr/nativeaot/Runtime/Pal.h b/src/coreclr/nativeaot/Runtime/Pal.h index 0a9f9c2ea45599..b33da9157650d6 100644 --- a/src/coreclr/nativeaot/Runtime/Pal.h +++ b/src/coreclr/nativeaot/Runtime/Pal.h @@ -303,8 +303,6 @@ UInt32_BOOL PalResetEvent(HANDLE arg1); UInt32_BOOL PalSetEvent(HANDLE arg1); uint32_t PalWaitForSingleObjectEx(HANDLE arg1, uint32_t arg2, UInt32_BOOL arg3); -void PalGetSystemTimeAsFileTime(FILETIME * arg1); - void RuntimeThreadShutdown(void* thread); typedef void (*ThreadExitCallback)(); diff --git a/src/coreclr/nativeaot/Runtime/unix/PalUnix.cpp b/src/coreclr/nativeaot/Runtime/unix/PalUnix.cpp index 8cb78884a37d0a..873ae69c28ddf5 100644 --- a/src/coreclr/nativeaot/Runtime/unix/PalUnix.cpp +++ b/src/coreclr/nativeaot/Runtime/unix/PalUnix.cpp @@ -1234,21 +1234,6 @@ int32_t PalGetModuleFileName(_Out_ const TCHAR** pModuleNameOut, HANDLE moduleBa #endif // defined(HOST_WASM) } -static const int64_t SECS_BETWEEN_1601_AND_1970_EPOCHS = 11644473600LL; -static const int64_t SECS_TO_100NS = 10000000; /* 10^7 */ - -void PalGetSystemTimeAsFileTime(FILETIME *lpSystemTimeAsFileTime) -{ - struct timeval time = { 0 }; - gettimeofday(&time, NULL); - - int64_t result = ((int64_t)time.tv_sec + SECS_BETWEEN_1601_AND_1970_EPOCHS) * SECS_TO_100NS + - (time.tv_usec * 10); - - lpSystemTimeAsFileTime->dwLowDateTime = (uint32_t)result; - lpSystemTimeAsFileTime->dwHighDateTime = (uint32_t)(result >> 32); -} - uint64_t PalGetCurrentOSThreadId() { return (uint64_t)minipal_get_current_thread_id(); diff --git a/src/coreclr/nativeaot/Runtime/windows/PalMinWin.cpp b/src/coreclr/nativeaot/Runtime/windows/PalMinWin.cpp index a8cad826d4c82e..e311a2bb02d1ec 100644 --- a/src/coreclr/nativeaot/Runtime/windows/PalMinWin.cpp +++ b/src/coreclr/nativeaot/Runtime/windows/PalMinWin.cpp @@ -1063,8 +1063,3 @@ uint32_t PalWaitForSingleObjectEx(HANDLE arg1, uint32_t arg2, UInt32_BOOL arg3) { return ::WaitForSingleObjectEx(arg1, arg2, arg3); } - -void PalGetSystemTimeAsFileTime(FILETIME * arg1) -{ - ::GetSystemTimeAsFileTime(arg1); -} diff --git a/src/coreclr/pal/inc/pal.h b/src/coreclr/pal/inc/pal.h index 766d4cdc9f7c8c..1999c2c42b43f1 100644 --- a/src/coreclr/pal/inc/pal.h +++ b/src/coreclr/pal/inc/pal.h @@ -586,12 +586,6 @@ PALAPI GetFileSizeEx( IN HANDLE hFile, OUT PLARGE_INTEGER lpFileSize); -PALIMPORT -VOID -PALAPI -GetSystemTimeAsFileTime( - OUT LPFILETIME lpSystemTimeAsFileTime); - typedef struct _SYSTEMTIME { WORD wYear; WORD wMonth; @@ -609,15 +603,6 @@ PALAPI GetSystemTime( OUT LPSYSTEMTIME lpSystemTime); -PALIMPORT -BOOL -PALAPI -FileTimeToSystemTime( - IN CONST FILETIME *lpFileTime, - OUT LPSYSTEMTIME lpSystemTime); - - - PALIMPORT BOOL PALAPI diff --git a/src/coreclr/pal/inc/palprivate.h b/src/coreclr/pal/inc/palprivate.h index 17c5a045eff6ce..0fe566b7cc17d8 100644 --- a/src/coreclr/pal/inc/palprivate.h +++ b/src/coreclr/pal/inc/palprivate.h @@ -113,13 +113,6 @@ PALAPI RemoveDirectoryW( IN LPCWSTR lpPathName); -PALIMPORT -LONG -PALAPI -CompareFileTime( - IN CONST FILETIME *lpFileTime1, - IN CONST FILETIME *lpFileTime2); - #ifdef __cplusplus } #endif diff --git a/src/coreclr/pal/src/CMakeLists.txt b/src/coreclr/pal/src/CMakeLists.txt index 1395013eb59601..ac17e9a6c885e9 100644 --- a/src/coreclr/pal/src/CMakeLists.txt +++ b/src/coreclr/pal/src/CMakeLists.txt @@ -152,7 +152,6 @@ set(SOURCES exception/signal.cpp file/directory.cpp file/file.cpp - file/filetime.cpp file/path.cpp handlemgr/handleapi.cpp handlemgr/handlemgr.cpp diff --git a/src/coreclr/pal/src/file/file.cpp b/src/coreclr/pal/src/file/file.cpp index 8d0cfa99f789d3..fab78b1299467b 100644 --- a/src/coreclr/pal/src/file/file.cpp +++ b/src/coreclr/pal/src/file/file.cpp @@ -22,7 +22,6 @@ SET_DEFAULT_DEBUG_CHANNEL(FILE); // some headers have code with asserts, so do t #include "pal/palinternal.h" #include "pal/file.h" -#include "pal/filetime.h" #include "pal/utils.h" #include diff --git a/src/coreclr/pal/src/file/filetime.cpp b/src/coreclr/pal/src/file/filetime.cpp deleted file mode 100644 index edff44949d6af8..00000000000000 --- a/src/coreclr/pal/src/file/filetime.cpp +++ /dev/null @@ -1,293 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -/*++ - - - -Module Name: - - filetime.cpp - -Abstract: - - Implementation of the file WIN API related to file time. - -Notes: - -One very important thing to note is that on BSD systems, the stat structure -stores nanoseconds for the time-related fields. This is implemented by -replacing the time_t fields st_atime, st_mtime, and st_ctime by timespec -structures, instead named st_atimespec, st_mtimespec, and st_ctimespec. - -However, if _POSIX_SOURCE is defined, the fields are time_t values and use -their POSIX names. For compatibility purposes, when _POSIX_SOURCE is NOT -defined, the time-related fields are defined in sys/stat.h as: - -#ifndef _POSIX_SOURCE -#define st_atime st_atimespec.tv_sec -#define st_mtime st_mtimespec.tv_sec -#define st_ctime st_ctimespec.tv_sec -#endif - -Furthermore, if _POSIX_SOURCE is defined, the structure still has -additional fields for nanoseconds, named st_atimensec, st_mtimensec, and -st_ctimensec. - -In the PAL, there is a configure check to see if the system supports -nanoseconds for the time-related fields. This source file also sets macros -so that STAT_ATIME_NSEC etc. will always refer to the appropriate field -if it exists, and are defined as 0 otherwise. - --- - -Also note that there is no analog to "creation time" on Linux systems. -Instead, we use the inode change time, which is set to the current time -whenever mtime changes or when chmod, chown, etc. syscalls modify the -file status; or mtime if older. Ideally we would use birthtime when -available. - - ---*/ - -#include "pal/corunix.hpp" -#include "pal/dbgmsg.h" -#include "pal/filetime.h" -#include "pal/thread.hpp" -#include "pal/file.hpp" - -#include -#include -#include -#include - -#if HAVE_SYS_TIME_H -#include -#endif // HAVE_SYS_TIME_H - -using namespace CorUnix; - -SET_DEFAULT_DEBUG_CHANNEL(FILE); - -// In safemath.h, Template SafeInt uses macro _ASSERTE, which need to use variable -// defdbgchan defined by SET_DEFAULT_DEBUG_CHANNEL. Therefore, the include statement -// should be placed after the SET_DEFAULT_DEBUG_CHANNEL(FILE) -#include - -/* Magic number explanation: - - To 1970: - Both epochs are Gregorian. 1970 - 1601 = 369. Assuming a leap - year every four years, 369 / 4 = 92. However, 1700, 1800, and 1900 - were NOT leap years, so 89 leap years, 280 non-leap years. - 89 * 366 + 280 * 365 = 134774 days between epochs. Of course - 60 * 60 * 24 = 86400 seconds per day, so 134774 * 86400 = - 11644473600 = SECS_BETWEEN_1601_AND_1970_EPOCHS. - - To 2001: - Again, both epochs are Gregorian. 2001 - 1601 = 400. Assuming a leap - year every four years, 400 / 4 = 100. However, 1700, 1800, and 1900 - were NOT leap years (2000 was because it was divisible by 400), so - 97 leap years, 303 non-leap years. - 97 * 366 + 303 * 365 = 146097 days between epochs. 146097 * 86400 = - 12622780800 = SECS_BETWEEN_1601_AND_2001_EPOCHS. - - This result is also confirmed in the MSDN documentation on how - to convert a time_t value to a win32 FILETIME. -*/ -static const int64_t SECS_BETWEEN_1601_AND_1970_EPOCHS = 11644473600LL; -static const int64_t SECS_TO_100NS = 10000000; /* 10^7 */ - -#ifdef __APPLE__ -static const int64_t SECS_BETWEEN_1601_AND_2001_EPOCHS = 12622780800LL; -#endif // __APPLE__ - -/*++ -Function: - CompareFileTime - -See MSDN doc. ---*/ -LONG -PALAPI -CompareFileTime( - IN CONST FILETIME *lpFileTime1, - IN CONST FILETIME *lpFileTime2) -{ - int64_t First; - int64_t Second; - - long Ret; - - PERF_ENTRY(CompareFileTime); - ENTRY("CompareFileTime(lpFileTime1=%p lpFileTime2=%p)\n", - lpFileTime1, lpFileTime2); - - First = ((int64_t)lpFileTime1->dwHighDateTime << 32) + - lpFileTime1->dwLowDateTime; - Second = ((int64_t)lpFileTime2->dwHighDateTime << 32) + - lpFileTime2->dwLowDateTime; - - if ( First < Second ) - { - Ret = -1; - } - else if ( First > Second ) - { - Ret = 1; - } - else - { - Ret = 0; - } - - LOGEXIT("CompareFileTime returns LONG %ld\n", Ret); - PERF_EXIT(CompareFileTime); - return Ret; -} - - -/*++ -Function: - GetSystemTimeAsFileTime - -See MSDN doc. ---*/ -VOID -PALAPI -GetSystemTimeAsFileTime( - OUT LPFILETIME lpSystemTimeAsFileTime) -{ - PERF_ENTRY(GetSystemTimeAsFileTime); - ENTRY("GetSystemTimeAsFileTime(lpSystemTimeAsFileTime=%p)\n", - lpSystemTimeAsFileTime); - -#if HAVE_WORKING_CLOCK_GETTIME - struct timespec Time; - if (clock_gettime(CLOCK_REALTIME, &Time) == 0) - { - *lpSystemTimeAsFileTime = FILEUnixTimeToFileTime( Time.tv_sec, Time.tv_nsec ); - } -#else - struct timeval Time; - if (gettimeofday(&Time, NULL) == 0) - { - /* use (tv_usec * 1000) because 2nd arg is in nanoseconds */ - *lpSystemTimeAsFileTime = FILEUnixTimeToFileTime( Time.tv_sec, Time.tv_usec * 1000); - } -#endif - else - { - /* no way to indicate failure, so set time to zero */ - ASSERT("clock_gettime or gettimeofday failed"); - *lpSystemTimeAsFileTime = FILEUnixTimeToFileTime( 0, 0 ); - } - - LOGEXIT("GetSystemTimeAsFileTime returns.\n"); - PERF_EXIT(GetSystemTimeAsFileTime); -} - - -/*++ -Function: - FILEUnixTimeToFileTime - -Convert a time_t value to a win32 FILETIME structure, as described in -MSDN documentation. time_t is the number of seconds elapsed since -00:00 01 January 1970 UTC (Unix epoch), while FILETIME represents a -64-bit number of 100-nanosecond intervals that have passed since 00:00 -01 January 1601 UTC (win32 epoch). ---*/ -FILETIME FILEUnixTimeToFileTime( time_t sec, long nsec ) -{ - int64_t Result; - FILETIME Ret; - - Result = ((int64_t)sec + SECS_BETWEEN_1601_AND_1970_EPOCHS) * SECS_TO_100NS + - (nsec / 100); - - Ret.dwLowDateTime = (DWORD)Result; - Ret.dwHighDateTime = (DWORD)(Result >> 32); - - TRACE("Unix time = [%ld.%09ld] converts to Win32 FILETIME = [%#x:%#x]\n", - sec, nsec, Ret.dwHighDateTime, Ret.dwLowDateTime); - - return Ret; -} - - -/** -Function - - FileTimeToSystemTime() - - Helper function for FileTimeToDosTime. - Converts the necessary file time attributes to system time, for - easier manipulation in FileTimeToDosTime. - ---*/ -BOOL PALAPI FileTimeToSystemTime( CONST FILETIME * lpFileTime, - LPSYSTEMTIME lpSystemTime ) -{ - UINT64 FileTime = 0; - time_t UnixFileTime = 0; - struct tm * UnixSystemTime = 0; - - /* Combine the file time. */ - FileTime = lpFileTime->dwHighDateTime; - FileTime <<= 32; - FileTime |= (UINT)lpFileTime->dwLowDateTime; - bool isSafe = ClrSafeInt::subtraction( - FileTime, - SECS_BETWEEN_1601_AND_1970_EPOCHS * SECS_TO_100NS, - FileTime); - - if (isSafe == true) - { -#if HAVE_GMTIME_R - struct tm timeBuf; -#endif /* HAVE_GMTIME_R */ - /* Convert file time to unix time. */ - if (((INT64)FileTime) < 0) - { - UnixFileTime = -1 - ( ( -FileTime - 1 ) / 10000000 ); - } - else - { - UnixFileTime = FileTime / 10000000; - } - - /* Convert unix file time to Unix System time. */ -#if HAVE_GMTIME_R - UnixSystemTime = gmtime_r( &UnixFileTime, &timeBuf ); -#else /* HAVE_GMTIME_R */ - UnixSystemTime = gmtime( &UnixFileTime ); -#endif /* HAVE_GMTIME_R */ - if (!UnixSystemTime) - { - ERROR( "gmtime failed.\n" ); - SetLastError(ERROR_INVALID_PARAMETER); - return FALSE; - } - - /* Convert unix system time to Windows system time. */ - lpSystemTime->wDay = (WORD)UnixSystemTime->tm_mday; - - /* Unix time counts January as a 0, under Windows it is 1*/ - lpSystemTime->wMonth = (WORD)UnixSystemTime->tm_mon + 1; - /* Unix time returns the year - 1900, Windows returns the current year*/ - lpSystemTime->wYear = (WORD)UnixSystemTime->tm_year + 1900; - - lpSystemTime->wSecond = (WORD)UnixSystemTime->tm_sec; - lpSystemTime->wMinute = (WORD)UnixSystemTime->tm_min; - lpSystemTime->wHour = (WORD)UnixSystemTime->tm_hour; - return TRUE; - } - else - { - ERROR( "The file time is to large.\n" ); - SetLastError(ERROR_INVALID_PARAMETER); - return FALSE; - } -} - diff --git a/src/coreclr/pal/src/include/pal/filetime.h b/src/coreclr/pal/src/include/pal/filetime.h deleted file mode 100644 index efbe99828d2312..00000000000000 --- a/src/coreclr/pal/src/include/pal/filetime.h +++ /dev/null @@ -1,47 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -/*++ - - - -Module Name: - - include/pal/filetime.h - -Abstract: - - Header file for utility functions having to do with file times. - -Revision History: - - - ---*/ - -#ifndef _PAL_FILETIME_H_ -#define _PAL_FILETIME_H_ - -#ifdef __cplusplus -extern "C" -{ -#endif // __cplusplus - -FILETIME FILEUnixTimeToFileTime( time_t sec, long nsec ); - -#ifdef __cplusplus -} -#endif // __cplusplus - -#endif /* _PAL_FILE_H_ */ - - - - - - - - - - - diff --git a/src/coreclr/pal/tests/palsuite/CMakeLists.txt b/src/coreclr/pal/tests/palsuite/CMakeLists.txt index a6338791711233..2c599cc0aa18f3 100644 --- a/src/coreclr/pal/tests/palsuite/CMakeLists.txt +++ b/src/coreclr/pal/tests/palsuite/CMakeLists.txt @@ -266,7 +266,6 @@ add_executable_clr(paltests file_io/GetStdHandle/test1/GetStdHandle.cpp file_io/GetStdHandle/test2/GetStdHandle.cpp file_io/GetSystemTime/test1/test.cpp - file_io/GetSystemTimeAsFileTime/test1/GetSystemTimeAsFileTime.cpp file_io/gettemppatha/test1/gettemppatha.cpp file_io/GetTempPathW/test1/GetTempPathW.cpp file_io/ReadFile/test1/ReadFile.cpp diff --git a/src/coreclr/pal/tests/palsuite/compilableTests.txt b/src/coreclr/pal/tests/palsuite/compilableTests.txt index ee5ba036ce7a31..cb377540a0a027 100644 --- a/src/coreclr/pal/tests/palsuite/compilableTests.txt +++ b/src/coreclr/pal/tests/palsuite/compilableTests.txt @@ -181,7 +181,6 @@ file_io/GetFullPathNameW/test4/paltest_getfullpathnamew_test4 file_io/GetStdHandle/test1/paltest_getstdhandle_test1 file_io/GetStdHandle/test2/paltest_getstdhandle_test2 file_io/GetSystemTime/test1/paltest_getsystemtime_test1 -file_io/GetSystemTimeAsFileTime/test1/paltest_getsystemtimeasfiletime_test1 file_io/gettemppatha/test1/paltest_gettemppatha_test1 file_io/GetTempPathW/test1/paltest_gettemppathw_test1 file_io/ReadFile/test1/paltest_readfile_test1 diff --git a/src/coreclr/pal/tests/palsuite/file_io/GetSystemTimeAsFileTime/test1/GetSystemTimeAsFileTime.cpp b/src/coreclr/pal/tests/palsuite/file_io/GetSystemTimeAsFileTime/test1/GetSystemTimeAsFileTime.cpp deleted file mode 100644 index 7658abb4c9454e..00000000000000 --- a/src/coreclr/pal/tests/palsuite/file_io/GetSystemTimeAsFileTime/test1/GetSystemTimeAsFileTime.cpp +++ /dev/null @@ -1,88 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -/*===================================================================== -** -** Source: GetSystemTimeAsFileTime.c -** -** Purpose: Tests the PAL implementation of GetSystemTimeAsFileTime -** Take two times, three seconds apart, and ensure that the time is -** increasing, and that it has increased at least 3 seconds. -** -** -** -**===================================================================*/ - -#include - - -PALTEST(file_io_GetSystemTimeAsFileTime_test1_paltest_getsystemtimeasfiletime_test1, "file_io/GetSystemTimeAsFileTime/test1/paltest_getsystemtimeasfiletime_test1") -{ - - FILETIME TheFirstTime, TheSecondTime; - ULONG64 FullFirstTime, FullSecondTime; - - if (0 != PAL_Initialize(argc,argv)) - { - return FAIL; - } - - /* Get two times, 3 seconds apart */ - - GetSystemTimeAsFileTime( &TheFirstTime ); - - Sleep( 3000 ); - - GetSystemTimeAsFileTime( &TheSecondTime ); - - /* Convert them to ULONG64 to work with */ - - FullFirstTime = ((( (ULONG64)TheFirstTime.dwHighDateTime )<<32) | - ( (ULONG64)TheFirstTime.dwLowDateTime )); - - FullSecondTime = ((( (ULONG64)TheSecondTime.dwHighDateTime )<<32) | - ( (ULONG64)TheSecondTime.dwLowDateTime )); - - /* Test to ensure the second value is larger than the first */ - - if( FullSecondTime <= FullFirstTime ) - { - Fail("ERROR: The system time didn't increase in the last " - "three seconds. The second time tested was less than " - "or equal to the first."); - } - - /* Note: The 30000000 magic number is 3 seconds in hundreds of nano - seconds. This test checks to ensure at least 3 seconds passed - between the readings. - */ - - if( ( (LONG64)( FullSecondTime - FullFirstTime ) - 30000000 ) < 0 ) - { - ULONG64 TimeError; - - /* Note: This test used to compare the difference between full times - in terms of hundreds of nanoseconds. But the x86 clock seems to be - precise only to the level of about 10000 nanoseconds, so we would - fail the comparison depending on when we took time slices. - - To fix this, we just check that we're within 10 milliseconds of - sleeping 3000 milliseconds. We're not currently ensuring that we - haven't slept much more than 3000 ms. We may want to do that. - */ - TimeError = 30000000 - ( FullSecondTime - FullFirstTime ); - if ( TimeError > 100000) - { - Fail("ERROR: Two system times were tested, with a sleep of 3 " - "seconds between. The time passed should have been at least " - "3 seconds. But, it was less according to the function. " - "Actual time difference: %llu hundred-nanoseconds, " - "Expected: 30000000, Tolerance: 100000", - (unsigned long long)(FullSecondTime - FullFirstTime)); - } - } - - PAL_Terminate(); - return PASS; -} - diff --git a/src/coreclr/pal/tests/palsuite/paltestlist.txt b/src/coreclr/pal/tests/palsuite/paltestlist.txt index b55a93735f16f2..e2d2453f3b5aaa 100644 --- a/src/coreclr/pal/tests/palsuite/paltestlist.txt +++ b/src/coreclr/pal/tests/palsuite/paltestlist.txt @@ -164,7 +164,6 @@ file_io/GetFullPathNameW/test3/paltest_getfullpathnamew_test3 file_io/GetFullPathNameW/test4/paltest_getfullpathnamew_test4 file_io/GetStdHandle/test2/paltest_getstdhandle_test2 file_io/GetSystemTime/test1/paltest_getsystemtime_test1 -file_io/GetSystemTimeAsFileTime/test1/paltest_getsystemtimeasfiletime_test1 file_io/gettemppatha/test1/paltest_gettemppatha_test1 file_io/GetTempPathW/test1/paltest_gettemppathw_test1 file_io/ReadFile/test2/paltest_readfile_test2 From e384264e5021a03c419a7152b04aa33a64d52010 Mon Sep 17 00:00:00 2001 From: Huo Yaoyuan Date: Thu, 11 Sep 2025 00:16:38 +0800 Subject: [PATCH 3/8] Update unnecessary usages of GetSystemTime --- src/coreclr/jit/compiler.cpp | 9 --- src/coreclr/utilcode/debug.cpp | 26 ++++--- .../vm/eventing/eventpipe/ep-rt-coreclr.h | 72 +++++++++++++++---- 3 files changed, 74 insertions(+), 33 deletions(-) diff --git a/src/coreclr/jit/compiler.cpp b/src/coreclr/jit/compiler.cpp index 713dbb190a071e..c0158343115d39 100644 --- a/src/coreclr/jit/compiler.cpp +++ b/src/coreclr/jit/compiler.cpp @@ -132,15 +132,6 @@ const BYTE genActualTypes[] = { }; #endif // FEATURE_JIT_METHOD_PERF -/*****************************************************************************/ -inline unsigned getCurTime() -{ - SYSTEMTIME tim; - - GetSystemTime(&tim); - - return (((tim.wHour * 60) + tim.wMinute) * 60 + tim.wSecond) * 1000 + tim.wMilliseconds; -} /*****************************************************************************/ #ifdef DEBUG diff --git a/src/coreclr/utilcode/debug.cpp b/src/coreclr/utilcode/debug.cpp index 7d54630cdd9fda..6cb1e3299a97d9 100644 --- a/src/coreclr/utilcode/debug.cpp +++ b/src/coreclr/utilcode/debug.cpp @@ -11,6 +11,7 @@ #include "utilcode.h" #include "ex.h" #include "corexcep.h" +#include #include @@ -158,11 +159,14 @@ VOID LogAssert( // may not be a string literal (particularly for formatt-able asserts). STRESS_LOG2(LF_ASSERT, LL_ALWAYS, "ASSERT:%s:%d\n", szFile, iLine); - SYSTEMTIME st; -#ifndef TARGET_UNIX - GetLocalTime(&st); + struct timespec ts; + int ret = timespec_get(&ts, TIME_UTC); + + struct tm local; +#ifdef HOST_WINDOWS + localtime_s(&local, &ts.tv_sec); #else - GetSystemTime(&st); + localtime_r(&ts.tv_sec, &local); #endif SString exename; @@ -175,13 +179,13 @@ VOID LogAssert( GetCurrentProcessId(), GetCurrentThreadId(), GetCurrentThreadId(), - (ULONG)st.wMonth, - (ULONG)st.wDay, - (ULONG)st.wYear, - 1 + (( (ULONG)st.wHour + 11 ) % 12), - (ULONG)st.wMinute, - (ULONG)st.wSecond, - (st.wHour < 12) ? "am" : "pm", + (ULONG)local.tm_mon, + (ULONG)local.tm_mday, + (ULONG)local.tm_year, + 1 + (( (ULONG)local.tm_hour + 11 ) % 12), + (ULONG)local.tm_min, + (ULONG)local.tm_sec, + (local.tm_hour < 12) ? "am" : "pm", szFile, iLine, szExpr)); diff --git a/src/coreclr/vm/eventing/eventpipe/ep-rt-coreclr.h b/src/coreclr/vm/eventing/eventpipe/ep-rt-coreclr.h index 8e89a1bf9fd4ba..9b30b3123c47e6 100644 --- a/src/coreclr/vm/eventing/eventpipe/ep-rt-coreclr.h +++ b/src/coreclr/vm/eventing/eventpipe/ep-rt-coreclr.h @@ -21,6 +21,10 @@ #include #include +#ifdef TARGET_UNIX +#include +#endif + #undef EP_INFINITE_WAIT #define EP_INFINITE_WAIT INFINITE @@ -1019,21 +1023,63 @@ void ep_rt_system_time_get (EventPipeSystemTime *system_time) { STATIC_CONTRACT_NOTHROW; + +#ifdef HOST_WINDOWS + SYSTEMTIME value; + GetSystemTime (&value); + + EP_ASSERT(system_time != NULL); + ep_system_time_set ( + system_time, + value.wYear, + value.wMonth, + value.wDayOfWeek, + value.wDay, + value.wHour, + value.wMinute, + value.wSecond, + value.wMilliseconds); +#else + time_t tt; + struct tm *ut_ptr; + struct timeval time_val; + int timeofday_retval; + + EP_ASSERT (system_time != NULL); + + tt = time (NULL); - SYSTEMTIME value; - GetSystemTime (&value); + timeofday_retval = gettimeofday (&time_val, NULL); + + ut_ptr = gmtime (&tt); + + uint16_t milliseconds = 0; + if (timeofday_retval != -1) { + int old_seconds; + int new_seconds; + + milliseconds = (uint16_t)(time_val.tv_usec / 1000); + + old_seconds = ut_ptr->tm_sec; + new_seconds = time_val.tv_sec % 60; + + /* just in case we reached the next second in the interval between time () and gettimeofday () */ + if (old_seconds != new_seconds) + milliseconds = 999; + } + + ep_system_time_set ( + system_time, + (uint16_t)(1900 + ut_ptr->tm_year), + (uint16_t)ut_ptr->tm_mon + 1, + (uint16_t)ut_ptr->tm_wday, + (uint16_t)ut_ptr->tm_mday, + (uint16_t)ut_ptr->tm_hour, + (uint16_t)ut_ptr->tm_min, + (uint16_t)ut_ptr->tm_sec, + milliseconds); +#endif - EP_ASSERT(system_time != NULL); - ep_system_time_set ( - system_time, - value.wYear, - value.wMonth, - value.wDayOfWeek, - value.wDay, - value.wHour, - value.wMinute, - value.wSecond, - value.wMilliseconds); } static From fc9e93fea7e7333fce065fd147d8eceb8d9df5d1 Mon Sep 17 00:00:00 2001 From: Huo Yaoyuan Date: Thu, 11 Sep 2025 00:16:53 +0800 Subject: [PATCH 4/8] Remove GetSystemTime --- .../dlls/mscordac/mscordac_unixexports.src | 1 - src/coreclr/pal/inc/pal.h | 17 --- src/coreclr/pal/src/misc/time.cpp | 88 ------------- src/coreclr/pal/tests/palsuite/CMakeLists.txt | 1 - .../pal/tests/palsuite/compilableTests.txt | 1 - .../file_io/GetSystemTime/test1/test.cpp | 118 ------------------ .../pal/tests/palsuite/paltestlist.txt | 1 - .../palsuite/threading/Sleep/test1/Sleep.cpp | 3 +- .../pal/tests/palsuite/wasm/index.html | 1 - 9 files changed, 1 insertion(+), 230 deletions(-) delete mode 100644 src/coreclr/pal/tests/palsuite/file_io/GetSystemTime/test1/test.cpp diff --git a/src/coreclr/dlls/mscordac/mscordac_unixexports.src b/src/coreclr/dlls/mscordac/mscordac_unixexports.src index 4b55a5dee021f8..8e613dd0a3a05a 100644 --- a/src/coreclr/dlls/mscordac/mscordac_unixexports.src +++ b/src/coreclr/dlls/mscordac/mscordac_unixexports.src @@ -92,7 +92,6 @@ nativeStringResourceTable_mscorrc #GetProcAddress #GetStdHandle #GetSystemInfo -#GetSystemTime #GetTempPathA #GetTempPathW #LoadLibraryExA diff --git a/src/coreclr/pal/inc/pal.h b/src/coreclr/pal/inc/pal.h index 1999c2c42b43f1..28f410a20fe6d5 100644 --- a/src/coreclr/pal/inc/pal.h +++ b/src/coreclr/pal/inc/pal.h @@ -586,23 +586,6 @@ PALAPI GetFileSizeEx( IN HANDLE hFile, OUT PLARGE_INTEGER lpFileSize); -typedef struct _SYSTEMTIME { - WORD wYear; - WORD wMonth; - WORD wDayOfWeek; - WORD wDay; - WORD wHour; - WORD wMinute; - WORD wSecond; - WORD wMilliseconds; -} SYSTEMTIME, *PSYSTEMTIME, *LPSYSTEMTIME; - -PALIMPORT -VOID -PALAPI -GetSystemTime( - OUT LPSYSTEMTIME lpSystemTime); - PALIMPORT BOOL PALAPI diff --git a/src/coreclr/pal/src/misc/time.cpp b/src/coreclr/pal/src/misc/time.cpp index 22f0c83871ebb1..92def38ccd565f 100644 --- a/src/coreclr/pal/src/misc/time.cpp +++ b/src/coreclr/pal/src/misc/time.cpp @@ -30,94 +30,6 @@ using namespace CorUnix; SET_DEFAULT_DEBUG_CHANNEL(MISC); -/*++ -Function: - GetSystemTime - -The GetSystemTime function retrieves the current system date and -time. The system time is expressed in Coordinated Universal Time -(UTC). - -Parameters - -lpSystemTime - [out] Pointer to a SYSTEMTIME structure to receive the current system date and time. - -Return Values - -This function does not return a value. - ---*/ -VOID -PALAPI -GetSystemTime( - OUT LPSYSTEMTIME lpSystemTime) -{ - time_t tt; -#if HAVE_GMTIME_R - struct tm ut; -#endif /* HAVE_GMTIME_R */ - struct tm *utPtr; - struct timeval timeval; - int timeofday_retval; - - PERF_ENTRY(GetSystemTime); - ENTRY("GetSystemTime (lpSystemTime=%p)\n", lpSystemTime); - - tt = time(NULL); - - /* We can't get millisecond resolution from time(), so we get it from - gettimeofday() */ - timeofday_retval = gettimeofday(&timeval,NULL); - -#if HAVE_GMTIME_R - utPtr = &ut; - if (gmtime_r(&tt, utPtr) == NULL) -#else /* HAVE_GMTIME_R */ - if ((utPtr = gmtime(&tt)) == NULL) -#endif /* HAVE_GMTIME_R */ - { - ASSERT("gmtime() failed; errno is %d (%s)\n", errno, strerror(errno)); - goto EXIT; - } - - lpSystemTime->wYear = (WORD)(1900 + utPtr->tm_year); - lpSystemTime->wMonth = (WORD)(utPtr->tm_mon + 1); - lpSystemTime->wDayOfWeek = (WORD)utPtr->tm_wday; - lpSystemTime->wDay = (WORD)utPtr->tm_mday; - lpSystemTime->wHour = (WORD)utPtr->tm_hour; - lpSystemTime->wMinute = (WORD)utPtr->tm_min; - lpSystemTime->wSecond = (WORD)utPtr->tm_sec; - - if(-1 == timeofday_retval) - { - ASSERT("gettimeofday() failed; errno is %d (%s)\n", - errno, strerror(errno)); - lpSystemTime->wMilliseconds = 0; - } - else - { - int old_seconds; - int new_seconds; - - lpSystemTime->wMilliseconds = (WORD)(timeval.tv_usec/tccMilliSecondsToMicroSeconds); - - old_seconds = utPtr->tm_sec; - new_seconds = timeval.tv_sec%60; - - /* just in case we reached the next second in the interval between - time() and gettimeofday() */ - if( old_seconds!=new_seconds ) - { - TRACE("crossed seconds boundary; setting milliseconds to 999\n"); - lpSystemTime->wMilliseconds = 999; - } - } -EXIT: - LOGEXIT("GetSystemTime returns void\n"); - PERF_EXIT(GetSystemTime); -} - /*++ Function: QueryThreadCycleTime diff --git a/src/coreclr/pal/tests/palsuite/CMakeLists.txt b/src/coreclr/pal/tests/palsuite/CMakeLists.txt index 2c599cc0aa18f3..c61121186f831c 100644 --- a/src/coreclr/pal/tests/palsuite/CMakeLists.txt +++ b/src/coreclr/pal/tests/palsuite/CMakeLists.txt @@ -265,7 +265,6 @@ add_executable_clr(paltests file_io/GetFullPathNameW/test4/test4.cpp file_io/GetStdHandle/test1/GetStdHandle.cpp file_io/GetStdHandle/test2/GetStdHandle.cpp - file_io/GetSystemTime/test1/test.cpp file_io/gettemppatha/test1/gettemppatha.cpp file_io/GetTempPathW/test1/GetTempPathW.cpp file_io/ReadFile/test1/ReadFile.cpp diff --git a/src/coreclr/pal/tests/palsuite/compilableTests.txt b/src/coreclr/pal/tests/palsuite/compilableTests.txt index cb377540a0a027..c9de088fd78892 100644 --- a/src/coreclr/pal/tests/palsuite/compilableTests.txt +++ b/src/coreclr/pal/tests/palsuite/compilableTests.txt @@ -180,7 +180,6 @@ file_io/GetFullPathNameW/test3/paltest_getfullpathnamew_test3 file_io/GetFullPathNameW/test4/paltest_getfullpathnamew_test4 file_io/GetStdHandle/test1/paltest_getstdhandle_test1 file_io/GetStdHandle/test2/paltest_getstdhandle_test2 -file_io/GetSystemTime/test1/paltest_getsystemtime_test1 file_io/gettemppatha/test1/paltest_gettemppatha_test1 file_io/GetTempPathW/test1/paltest_gettemppathw_test1 file_io/ReadFile/test1/paltest_readfile_test1 diff --git a/src/coreclr/pal/tests/palsuite/file_io/GetSystemTime/test1/test.cpp b/src/coreclr/pal/tests/palsuite/file_io/GetSystemTime/test1/test.cpp deleted file mode 100644 index b0a3b32ca2b93a..00000000000000 --- a/src/coreclr/pal/tests/palsuite/file_io/GetSystemTime/test1/test.cpp +++ /dev/null @@ -1,118 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -/*============================================================ -** -** Source: test.c -** -** Purpose: Test for GetSystemTime() function -** -** -**=========================================================*/ - -/* Note: Some of the range comparisons only check - * the high end of the range. Since the structure - * contains WORDs, negative values can never be included, - * so there is no reason to check and see if the lower - * end of the spectrum is <0 -*/ - -#include - - -PALTEST(file_io_GetSystemTime_test1_paltest_getsystemtime_test1, "file_io/GetSystemTime/test1/paltest_getsystemtime_test1") -{ - SYSTEMTIME TheTime; - SYSTEMTIME firstTime; - SYSTEMTIME secondTime; - - if (0 != PAL_Initialize(argc,argv)) - { - return FAIL; - } - - GetSystemTime(&TheTime); - - /* Go through each item in the structure and ensure it is a valid value. - We can't ensure they have the exact values of the current time, but - at least that they have been set to a valid range of values for that - item. - */ - - /* Year */ - if(TheTime.wYear < (WORD)2001) - { - Fail("ERROR: The year is %d, when it should be at least 2001.", - TheTime.wYear); - } - - /* Month */ - if(TheTime.wMonth > (WORD)12 || TheTime.wMonth < (WORD)1) - { - Fail("ERROR: The month should be between 1 and 12, and it is " - "showing up as %d.",TheTime.wMonth); - } - - /* Weekday */ - if(TheTime.wDayOfWeek > 6) - { - Fail("ERROR: The day of the week should be between 0 and 6, " - "and it is showing up as %d.",TheTime.wDayOfWeek); - } - - /* Day of the Month */ - if(TheTime.wDay > 31 || TheTime.wDay < 1) - { - Fail("ERROR: The day of the month should be between 1 and " - "31, and it is showing up as %d.",TheTime.wDay); - } - - /* Hour */ - if(TheTime.wHour > 23) - { - Fail("ERROR: The hour should be between 0 and 23, and it is " - "showing up as %d.",TheTime.wHour); - } - - /* Minute */ - if(TheTime.wMinute > 59) - { - Fail("ERROR: The minute should be between 0 and 59 and it is " - "showing up as %d.",TheTime.wMinute); - } - - /* Second */ - if(TheTime.wSecond > 59) - { - Fail("ERROR: The second should be between 0 and 59 and it is" - " showing up as %d.",TheTime.wSecond); - } - - /* Millisecond */ - if(TheTime.wMilliseconds > 999) - { - Fail("ERROR: The milliseconds should be between 0 and 999 " - "and it is currently showing %d.",TheTime.wMilliseconds); - } - - /* verify that two consecutive calls to system time return */ - /* different values of seconds across sleep() call. */ - /* do this 5 times in case we are super unlucky. */ - float avgDeltaFileTime = 0; - for (int i = 0; i < 5; i++) - { - GetSystemTime(&firstTime); - Sleep(1000); - GetSystemTime(&secondTime); - avgDeltaFileTime += abs(firstTime.wSecond - secondTime.wSecond); - } - - if( (avgDeltaFileTime / 5) == 0) - { - Fail("ERROR: GetSystemTime always returning same value of seconds Value[%f]", avgDeltaFileTime / 5); - } - - PAL_Terminate(); - return PASS; -} - diff --git a/src/coreclr/pal/tests/palsuite/paltestlist.txt b/src/coreclr/pal/tests/palsuite/paltestlist.txt index e2d2453f3b5aaa..035f8b33a14875 100644 --- a/src/coreclr/pal/tests/palsuite/paltestlist.txt +++ b/src/coreclr/pal/tests/palsuite/paltestlist.txt @@ -163,7 +163,6 @@ file_io/GetFullPathNameW/test1/paltest_getfullpathnamew_test1 file_io/GetFullPathNameW/test3/paltest_getfullpathnamew_test3 file_io/GetFullPathNameW/test4/paltest_getfullpathnamew_test4 file_io/GetStdHandle/test2/paltest_getstdhandle_test2 -file_io/GetSystemTime/test1/paltest_getsystemtime_test1 file_io/gettemppatha/test1/paltest_gettemppatha_test1 file_io/GetTempPathW/test1/paltest_gettemppathw_test1 file_io/ReadFile/test2/paltest_readfile_test2 diff --git a/src/coreclr/pal/tests/palsuite/threading/Sleep/test1/Sleep.cpp b/src/coreclr/pal/tests/palsuite/threading/Sleep/test1/Sleep.cpp index e48d73c3d59c07..d7fb16d8b963b8 100644 --- a/src/coreclr/pal/tests/palsuite/threading/Sleep/test1/Sleep.cpp +++ b/src/coreclr/pal/tests/palsuite/threading/Sleep/test1/Sleep.cpp @@ -8,8 +8,7 @@ ** Purpose: Test to establish whether the Sleep function stops the thread from ** executing for the specified times. ** -** Dependencies: GetSystemTime -** Fail +** Dependencies: Fail ** Trace ** diff --git a/src/coreclr/pal/tests/palsuite/wasm/index.html b/src/coreclr/pal/tests/palsuite/wasm/index.html index a50c1ff3473f29..9ad519ad45c728 100644 --- a/src/coreclr/pal/tests/palsuite/wasm/index.html +++ b/src/coreclr/pal/tests/palsuite/wasm/index.html @@ -10,7 +10,6 @@

PAL Tests WASM