Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:kernel\time\posix-timers.c Create Date:2022-07-28 10:46:28
Last Modify:2020-03-12 14:18:49 Copyright©Brick
home page Tree
Annotation kernel can get tool activityDownload SCCTChinese

Name:Create a POSIX.1b interval timer.

Proto:static int do_timer_create(clockid_t which_clock, struct sigevent *event, timer_t __user *created_timer_id)

Type:int

Parameter:

TypeParameterName
clockid_twhich_clock
struct sigevent *event
timer_t __user *created_timer_id
475  kc = clockid_to_kclock(which_clock)
478  it_id_set = IT_ID_NOT_SET
480  If Not kc Then Return -EINVAL
482  If Not timer_create Then Return -EOPNOTSUPP
485  new_timer = alloc_posix_timer()
486  If Value for the false possibility is greater at compile time(!new_timer) Then Return -EAGAIN
489  Process spin lock initialization( & it_lock)
490  new_timer_id = posix_timer_add(new_timer)
491  If new_timer_id < 0 Then
492  error = new_timer_id
493  Go to out
496  it_id_set = IT_ID_SET
497  it_id = new_timer_id
498  it_clock = which_clock
499  kclock = kc
500  it_overrun = -1LL
502  If event Then
503  _read_lock() - mark the beginning of an RCU read-side critical section* When synchronize_rcu() is invoked on one CPU while other CPUs* are within RCU read-side critical sections, then the* synchronize_rcu() is guaranteed to block until after all the other
504  it_pid = get_pid(good_sigevent(event))
505  _read_unlock() - marks the end of an RCU read-side critical section.* In most situations, rcu_read_unlock() is immune from deadlock.* However, in kernels built with CONFIG_RCU_BOOST, rcu_read_unlock()
506  If Not it_pid Then
507  error = -EINVAL
508  Go to out
510  it_sigev_notify = sigev_notify
511  si_signo = sigev_signo
512  si_value = sigev_value
513  Else
514  it_sigev_notify = ify via signal
515  si_signo = SIGALRM
516  memset( & si_value, 0, sizeof(sigval_t))
517  sival_int = it_id
518  it_pid = get_pid(task_tgid(current process))
521  si_tid = it_id
522  si_code = sent by timer expiration
524  If copy_to_user(created_timer_id, & new_timer_id, size of new_timer_id ) Then
526  error = -EFAULT
527  Go to out
530  error = timer_create(new_timer)
531  If error Then Go to out
534  spin_lock_irq( & siglock)
535  it_signal = signal
536  list_add - add a new entry*@new: new entry to be added*@head: list head to add it after* Insert a new entry after the specified head.* This is good for implementing stacks.
537  spin_unlock_irq( & siglock)
539  Return 0
546  out :
547  release_posix_timer(new_timer, it_id_set)
548  Return error
Caller
NameDescribe
SYSCALL_DEFINE3
COMPAT_SYSCALL_DEFINE3