Latest libsodium-1.0.18-stable.tar.gz.

git-svn-id: https://www.unprompted.com/svn/projects/tildefriends/trunk@4193 ed5197a5-7fde-0310-b194-c3ffbd925b24
This commit is contained in:
2023-02-19 23:23:53 +00:00
parent 86bc46a11e
commit 961109635b
44 changed files with 2426 additions and 1477 deletions

View File

@ -118,16 +118,23 @@ static int mempool_free_all(void)
static unsigned long long now(void)
{
struct timeval tp;
unsigned long long now;
#if defined(HAVE_CLOCK_GETTIME) && defined(CLOCK_MONOTONIC)
struct timespec tp;
if (clock_gettime(CLOCK_MONOTONIC, &tp) != 0) {
abort();
}
return (unsigned long long) tp.tv_sec * 1000000ULL +
(unsigned long long) tp.tv_nsec / 1000ULL;
#else
struct timeval tp;
if (gettimeofday(&tp, NULL) != 0) {
abort();
}
now = ((unsigned long long) tp.tv_sec * 1000000ULL) +
return (unsigned long long) tp.tv_sec * 1000000ULL +
(unsigned long long) tp.tv_usec;
return now;
#endif
}
int main(void)