ktime_t本质为s64类型,ktime_set用于将秒数和纳秒数转换为ktime_t时间值。ktime_add_ns和ktime_sub_ns用于对ktime_t时间变量进行加减操作。timespec64_to_ktime和ktime_to_timespec64用于结构体转换。ktime_compare用于比较ktime_t大小。ktime_after和ktime_before用于比较时间点。ktime_divns...
newary wary - Create a new semaphore set*@ns: namespace*@params: ptr to the structure that contains key, semflg and nsems* Called with sem_ids.rwsem held (as a writer) set_semotime set_semotime - set sem_otime*@sma: semaphore array*@sops: operations that modified the array, may ...
Name:ktime_get_real_ts64 - Returns the time of day in a timespec64.*@ts: pointer to the timespec to be set* Returns the time of day in a timespec64 (WARN if suspended). Proto:void ktime_get_real_ts64(struct timespec64 *ts) Type:void Parameter: TypeParameterName struct timespec64...
在linux v5.0中,也就是do_gettimeofday正式退役时,我们看看ktime_get_real_ts64的样子。其在kernel/time/timekeeping.c中的定义如下: /*** ktime_get_real_ts64 - Returns the time of day in a timespec64.* @ts: pointer to the timespec to be set** Returns the time of day in a timespec64 (...
ktime_t moffs = ktime_mono_to_real((ktime_t){ .tv64 = 0 }); ktime_t moffs = ktime_mono_to_real(0); struct timerfd_ctx *ctx; unsigned long flags; @@ -102,8 +102,8 @@ void timerfd_clock_was_set(void) if (!ctx->might_cancel) continue; spin_lock_irqsave(&ctx->wqh....
ktime_add_ns宏和ktime_sub_ns宏分别用于将纳秒值加到ktime_t类型的时间变量上和从ktime_t类型的时间变量中减去纳秒值。本质上这两个函数和上面的add、sub是相同的。 //71~74行staticinlinektime_ttimespec64_to_ktime(structtimespec64ts){returnktime_set(ts.tv_sec,ts.tv_nsec);} ...