CrtLibSupport: fix gettimeofday()

Turn gettimeofday() into a proper function with return value.

Will be needed by openssl-3.2.x

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
This commit is contained in:
Gerd Hoffmann 2024-05-22 12:14:31 +02:00 committed by mergify[bot]
parent 609c7e8679
commit ebf7daa583
4 changed files with 41 additions and 1 deletions

View File

@ -50,3 +50,14 @@ sleep (
{
return 0;
}
int
gettimeofday (
struct timeval *tv,
struct timezone *tz
)
{
tv->tv_sec = 0;
tv->tv_usec = 0;
return 0;
}

View File

@ -205,3 +205,14 @@ sleep (
gBS->Stall (seconds * 1000 * 1000);
return 0;
}
int
gettimeofday (
struct timeval *tv,
struct timezone *tz
)
{
tv->tv_sec = (long)time (NULL);
tv->tv_usec = 0;
return 0;
}

View File

@ -112,4 +112,15 @@ sleep (
return 0;
}
int
gettimeofday (
struct timeval *tv,
struct timezone *tz
)
{
tv->tv_sec = 0;
tv->tv_usec = 0;
return 0;
}
int errno = 0;

View File

@ -147,6 +147,8 @@ struct timeval {
long tv_usec; /* time value, in microseconds */
};
struct timezone;
struct sockaddr {
__uint8_t sa_len; /* total length */
sa_family_t sa_family; /* address family */
@ -340,6 +342,12 @@ sleep (
unsigned int seconds
);
int
gettimeofday (
struct timeval *tv,
struct timezone *tz
);
uid_t
getuid (
void
@ -439,6 +447,5 @@ strcat (
#define assert(expression)
#define offsetof(type, member) OFFSET_OF(type,member)
#define atoi(nptr) AsciiStrDecimalToUintn(nptr)
#define gettimeofday(tvp, tz) do { (tvp)->tv_sec = time(NULL); (tvp)->tv_usec = 0; } while (0)
#endif