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 @@ -881,24 +881,6 @@ int mingw_chmod(const char *filename, int mode)
881
881
return _wchmod (wfilename , mode );
882
882
}
883
883
884
- /*
885
- * The unit of FILETIME is 100-nanoseconds since January 1, 1601, UTC.
886
- * Returns the 100-nanoseconds ("hekto nanoseconds") since the epoch.
887
- */
888
- static inline long long filetime_to_hnsec (const FILETIME * ft )
889
- {
890
- long long winTime = ((long long )ft -> dwHighDateTime << 32 ) + ft -> dwLowDateTime ;
891
- /* Windows to Unix Epoch conversion */
892
- return winTime - 116444736000000000LL ;
893
- }
894
-
895
- static inline void filetime_to_timespec (const FILETIME * ft , struct timespec * ts )
896
- {
897
- long long hnsec = filetime_to_hnsec (ft );
898
- ts -> tv_sec = (time_t )(hnsec / 10000000 );
899
- ts -> tv_nsec = (hnsec % 10000000 ) * 100 ;
900
- }
901
-
902
884
/**
903
885
* Verifies that safe_create_leading_directories() would succeed.
904
886
*/
You can’t perform that action at this time.
0 commit comments