mirror of
https://github.com/apache/nuttx.git
synced 2026-09-01 22:53:01 +00: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:
parent
725f98bb06
commit
6bcd83eb04
2 changed files with 3 additions and 2 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue