git-svn-id: svn://kolibrios.org@6082 a494cfbc-eb01-0410-851d-a64ba20cac60
This commit is contained in:
Sergey Semyonov (Serge)
2016-01-20 04:19:53 +00:00
parent fc6f59584d
commit 9e5dea1997
153 changed files with 11372 additions and 3456 deletions

View File

@@ -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())