From 703b0a14350437967820e946ce4f9eaa2be391f3 Mon Sep 17 00:00:00 2001 From: apio Date: Thu, 27 Oct 2022 17:20:46 +0200 Subject: [PATCH] libc: Make tv_usec in timeval signed, as it should be --- libs/libc/include/sys/types.h | 3 +++ libs/libc/include/time.h | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/libs/libc/include/sys/types.h b/libs/libc/include/sys/types.h index 720a79cf..843a8974 100644 --- a/libs/libc/include/sys/types.h +++ b/libs/libc/include/sys/types.h @@ -25,4 +25,7 @@ typedef long int clock_t; /* Value representing time in seconds. */ typedef long int time_t; +/* Type representing signed time in microseconds. */ +typedef long int suseconds_t; + #endif \ No newline at end of file diff --git a/libs/libc/include/time.h b/libs/libc/include/time.h index 4771862e..bd544ad1 100644 --- a/libs/libc/include/time.h +++ b/libs/libc/include/time.h @@ -25,7 +25,7 @@ struct tm struct timeval { time_t tv_sec; - unsigned long tv_usec; + suseconds_t tv_usec; }; #define CLOCKS_PER_SEC 1000 // Number of clock_t per second.