Skip to content

Commit

Permalink
[temp] Implementation gettimeofday in smallc
Browse files Browse the repository at this point in the history
Now, The implement of gettimeofday is null,
would be implement later.

Signed-off-by: Sun, Ceping <cepingx.sun@intel.com>
  • Loading branch information
sunceping committed Jul 17, 2023
1 parent 1012ab7 commit b015f96
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions deps/rust-tpm-20-ref/smallc/src/time.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#include <time.h>
#include <errno.h>
#include <assert.h>

const char __utc[] = "UTC";

Expand Down Expand Up @@ -31,3 +32,18 @@ struct tm *gmtime(const time_t *t)
tm.__tm_zone = __utc;
return &tm;
}

// Add an empty implementation for gettimeofday
struct timeval {
long tv_sec; /* time value, in seconds */
long tv_usec; /* time value, in microseconds */
};
struct timezone {
int tz_minuteswest; /* minutes west of Greenwich */
int tz_dsttime; /* type of dst correction */
};

int gettimeofday ( struct timeval * tv , struct timezone * tz ){
assert(0);
return 1;
}

0 comments on commit b015f96

Please sign in to comment.