mirror of
https://github.com/apache/nuttx.git
synced 2026-06-07 17:33:08 +08:00
sched/clock: Remove CLOCK_MONOTONIC option from Kconfig
here is the reason: 1.clock_systime_timespec(core function) always exist regardless the setting 2.CLOCK_MONOTONIC is a foundamental clock type required by many places Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
This commit is contained in:
@@ -387,12 +387,7 @@ int epoll_pwait(int epfd, FAR struct epoll_event *evs,
|
||||
expire.tv_sec = timeout / 1000;
|
||||
expire.tv_nsec = timeout % 1000 * 1000;
|
||||
|
||||
#ifdef CONFIG_CLOCK_MONOTONIC
|
||||
clock_gettime(CLOCK_MONOTONIC, &curr);
|
||||
#else
|
||||
clock_gettime(CLOCK_REALTIME, &curr);
|
||||
#endif
|
||||
|
||||
clock_timespec_add(&curr, &expire, &expire);
|
||||
}
|
||||
|
||||
@@ -403,11 +398,7 @@ again:
|
||||
}
|
||||
else
|
||||
{
|
||||
#ifdef CONFIG_CLOCK_MONOTONIC
|
||||
clock_gettime(CLOCK_MONOTONIC, &curr);
|
||||
#else
|
||||
clock_gettime(CLOCK_REALTIME, &curr);
|
||||
#endif
|
||||
clock_timespec_subtract(&expire, &curr, &diff);
|
||||
|
||||
rc = ppoll(eph->poll, eph->occupied + 1, &diff, sigmask);
|
||||
|
||||
+3
-6
@@ -540,12 +540,9 @@ int timerfd_create(int clockid, int flags)
|
||||
|
||||
/* Sanity checks. */
|
||||
|
||||
if (clockid != CLOCK_REALTIME
|
||||
#ifdef CONFIG_CLOCK_MONOTONIC
|
||||
&& clockid != CLOCK_MONOTONIC
|
||||
&& clockid != CLOCK_BOOTTIME
|
||||
#endif /* CONFIG_CLOCK_MONOTONIC */
|
||||
)
|
||||
if (clockid != CLOCK_REALTIME &&
|
||||
clockid != CLOCK_MONOTONIC &&
|
||||
clockid != CLOCK_BOOTTIME)
|
||||
{
|
||||
ret = -EINVAL;
|
||||
goto errout;
|
||||
|
||||
Reference in New Issue
Block a user