forked from KolibriOS/kolibrios
ddk: 4.4
git-svn-id: svn://kolibrios.org@6082 a494cfbc-eb01-0410-851d-a64ba20cac60
This commit is contained in:
@@ -40,8 +40,8 @@ static inline int timeval_compare(const struct timeval *lhs, const struct timeva
|
||||
}
|
||||
|
||||
extern time64_t mktime64(const unsigned int year, const unsigned int mon,
|
||||
const unsigned int day, const unsigned int hour,
|
||||
const unsigned int min, const unsigned int sec);
|
||||
const unsigned int day, const unsigned int hour,
|
||||
const unsigned int min, const unsigned int sec);
|
||||
|
||||
/**
|
||||
* Deprecated. Use mktime64().
|
||||
@@ -110,6 +110,19 @@ static inline bool timespec_valid_strict(const struct timespec *ts)
|
||||
return true;
|
||||
}
|
||||
|
||||
static inline bool timeval_valid(const struct timeval *tv)
|
||||
{
|
||||
/* Dates before 1970 are bogus */
|
||||
if (tv->tv_sec < 0)
|
||||
return false;
|
||||
|
||||
/* Can't have more microseconds then a second */
|
||||
if (tv->tv_usec < 0 || tv->tv_usec >= USEC_PER_SEC)
|
||||
return false;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
extern struct timespec timespec_trunc(struct timespec t, unsigned gran);
|
||||
|
||||
#define CURRENT_TIME (current_kernel_time())
|
||||
|
Reference in New Issue
Block a user