函数源码

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source File:kernel\time\posix-cpu-timers.c Create Date:2022-07-27 11:47:32
首页 Copyright©Brick

381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
/*
 * Validate the clockid_t for a new CPU-clock timer, and initialize the timer.
 * This is called from sys_timer_create() and do_cpu_nanosleep() with the
 * new timer already all-zeros initialized.
 */
static int posix_cpu_timer_create(struct k_itimer *new_timer)
{
    struct task_struct *p = get_task_for_clock(new_timer->it_clock);
 
    if (!p)
        return -EINVAL;
 
    new_timer->kclock = &clock_posix_cpu;
    timerqueue_init(&new_timer->it.cpu.node);
    new_timer->it.cpu.task = p;
    return 0;
}