Add support function get_real_time()
This commit is contained in:
parent
a2fc40be04
commit
05d7d4818e
@ -10,6 +10,7 @@
|
||||
|
||||
#include "EmptyAttributeDirectoryCookie.h"
|
||||
#include "DebugSupport.h"
|
||||
#include "Utils.h"
|
||||
|
||||
|
||||
PackageLinksDirectory::PackageLinksDirectory()
|
||||
@ -17,10 +18,7 @@ PackageLinksDirectory::PackageLinksDirectory()
|
||||
Directory(0)
|
||||
// the ID needs to be assigned later, when added to a volume
|
||||
{
|
||||
bigtime_t timeMicros = real_time_clock_usecs();
|
||||
|
||||
fModifiedTime.tv_sec = timeMicros / 1000000;
|
||||
fModifiedTime.tv_nsec = (timeMicros % 1000000) * 1000;
|
||||
get_real_time(fModifiedTime);
|
||||
}
|
||||
|
||||
|
||||
|
@ -8,6 +8,9 @@
|
||||
|
||||
#include <dirent.h>
|
||||
#include <string.h>
|
||||
#include <time.h>
|
||||
|
||||
#include <OS.h>
|
||||
|
||||
|
||||
inline bool operator<(const timespec& a, const timespec& b)
|
||||
@ -38,4 +41,14 @@ set_dirent_name(struct dirent* buffer, size_t bufferSize, const char* name,
|
||||
}
|
||||
|
||||
|
||||
static inline void
|
||||
get_real_time(timespec& time)
|
||||
{
|
||||
bigtime_t timeMicros = real_time_clock_usecs();
|
||||
|
||||
time.tv_sec = timeMicros / 1000000;
|
||||
time.tv_nsec = (timeMicros % 1000000) * 1000;
|
||||
}
|
||||
|
||||
|
||||
#endif // UTILS_H
|
||||
|
Loading…
Reference in New Issue
Block a user