File tree Expand file tree Collapse file tree 2 files changed +18
-18
lines changed Expand file tree Collapse file tree 2 files changed +18
-18
lines changed Original file line number Diff line number Diff line change @@ -342,6 +342,17 @@ static inline int getrlimit(int resource, struct rlimit *rlp)
342
342
return 0 ;
343
343
}
344
344
345
+ /*
346
+ * The unit of FILETIME is 100-nanoseconds since January 1, 1601, UTC.
347
+ * Returns the 100-nanoseconds ("hekto nanoseconds") since the epoch.
348
+ */
349
+ static inline long long filetime_to_hnsec (const FILETIME * ft )
350
+ {
351
+ long long winTime = ((long long )ft -> dwHighDateTime << 32 ) + ft -> dwLowDateTime ;
352
+ /* Windows to Unix Epoch conversion */
353
+ return winTime - 116444736000000000LL ;
354
+ }
355
+
345
356
/*
346
357
* Use mingw specific stat()/lstat()/fstat() implementations on Windows,
347
358
* including our own struct stat with 64 bit st_size and nanosecond-precision
@@ -358,6 +369,13 @@ struct timespec {
358
369
#endif
359
370
#endif
360
371
372
+ static inline void filetime_to_timespec (const FILETIME * ft , struct timespec * ts )
373
+ {
374
+ long long hnsec = filetime_to_hnsec (ft );
375
+ ts -> tv_sec = (time_t )(hnsec / 10000000 );
376
+ ts -> tv_nsec = (hnsec % 10000000 ) * 100 ;
377
+ }
378
+
361
379
struct mingw_stat {
362
380
_dev_t st_dev ;
363
381
_ino_t st_ino ;
Original file line number Diff line number Diff line change @@ -883,24 +883,6 @@ int mingw_chmod(const char *filename, int mode)
883
883
return _wchmod (wfilename , mode );
884
884
}
885
885
886
- /*
887
- * The unit of FILETIME is 100-nanoseconds since January 1, 1601, UTC.
888
- * Returns the 100-nanoseconds ("hekto nanoseconds") since the epoch.
889
- */
890
- static inline long long filetime_to_hnsec (const FILETIME * ft )
891
- {
892
- long long winTime = ((long long )ft -> dwHighDateTime << 32 ) + ft -> dwLowDateTime ;
893
- /* Windows to Unix Epoch conversion */
894
- return winTime - 116444736000000000LL ;
895
- }
896
-
897
- static inline void filetime_to_timespec (const FILETIME * ft , struct timespec * ts )
898
- {
899
- long long hnsec = filetime_to_hnsec (ft );
900
- ts -> tv_sec = (time_t )(hnsec / 10000000 );
901
- ts -> tv_nsec = (hnsec % 10000000 ) * 100 ;
902
- }
903
-
904
886
/**
905
887
* Verifies that safe_create_leading_directories() would succeed.
906
888
*/
You can’t perform that action at this time.
0 commit comments