Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:fs\timerfd.c Create Date:2022-07-28 20:19:56
Last Modify:2020-03-12 14:18:49 Copyright©Brick
home page Tree
Annotation kernel can get tool activityDownload SCCTChinese

Name:timerfd_read

Proto:static ssize_t timerfd_read(struct file *file, char __user *buf, size_t count, loff_t *ppos)

Type:ssize_t

Parameter:

TypeParameterName
struct file *file
char __user *buf
size_tcount
loff_t *ppos
249  ctx = needed for tty driver, and maybe others
251  ticks = 0
253  If count < size of ticks Then Return -EINVAL
255  spin_lock_irq( & lock)
256  If f_flags & O_NONBLOCK Then res = -EAGAIN
258  Else res = wait_event_interruptible_locked_irq - sleep until a condition gets true*@wq: the waitqueue to wait on*@condition: a C expression for the event to wait for* The process is put to sleep (TASK_INTERRUPTIBLE) until the(wqh, ticks)
266  If timerfd_canceled(ctx) Then
267  ticks = 0
268  expired = 0
269  res = -ECANCELED
272  If ticks Then
273  ticks = ticks
275  If expired && tintv Then
282  If isalarm(ctx) Then
283  ticks += alarm_forward_now( & alarm, tintv) - 1
285  alarm_restart( & alarm)
286  Else
292  expired = 0
293  ticks = 0
295  spin_unlock_irq( & lock)
296  If ticks Then res = If Write a simple value into user space(ticks, (u64__user * )buf) Then -EFAULT Else size of ticks
298  Return res