MCPcopy Create free account
hub / github.com/Pagghiu/SaneCppLibraries / posixTimespecToTimeMs

Function posixTimespecToTimeMs

Libraries/FileSystem/FileSystem.cpp:1465–1471  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1463};
1464
1465static SC::TimeMs posixTimespecToTimeMs(const struct timespec& ts)
1466{
1467 constexpr SC::int64_t nanosecondsToMilliseconds = 1000 * 1000;
1468 constexpr SC::int64_t roundingNanoseconds = nanosecondsToMilliseconds / 2;
1469 return SC::TimeMs{static_cast<SC::int64_t>(ts.tv_sec) * 1000 +
1470 (static_cast<SC::int64_t>(ts.tv_nsec) + roundingNanoseconds) / nanosecondsToMilliseconds};
1471}
1472
1473static SC::FileSystemEntryType posixEntryTypeFromMode(mode_t mode)
1474{

Callers 1

FileSystem.cppFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected