mirror of
https://github.com/apache/nuttx.git
synced 2026-06-06 08:36:24 +08:00
time:follow POSIX use long to define time_t
MIRTOS-883 https: //man7.org/linux/man-pages/man3/clock_settime.3.html Signed-off-by: anjiahao <anjiahao@xiaomi.com> Change-Id: If573ad33b1ff61d5549e476b191309d4d4024801
This commit is contained in:
+1
-1
@@ -102,7 +102,7 @@
|
||||
|
||||
/* Scalar types */
|
||||
|
||||
typedef uint32_t time_t; /* Holds time in seconds */
|
||||
typedef long time_t; /* Holds time in seconds */
|
||||
typedef uint8_t clockid_t; /* Identifies one time base source */
|
||||
typedef FAR void *timer_t; /* Represents one POSIX timer */
|
||||
|
||||
|
||||
@@ -65,7 +65,8 @@ int clock_settime(clockid_t clock_id, FAR const struct timespec *tp)
|
||||
*/
|
||||
|
||||
if (clock_id == CLOCK_REALTIME &&
|
||||
tp->tv_nsec >= 0 && tp->tv_nsec < 1000000000)
|
||||
tp->tv_nsec >= 0 && tp->tv_nsec < 1000000000 &&
|
||||
tp->tv_sec >= 0)
|
||||
{
|
||||
#ifndef CONFIG_CLOCK_TIMEKEEPING
|
||||
/* Interrupts are disabled here so that the in-memory time
|
||||
|
||||
Reference in New Issue
Block a user