Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

Name:signalfd_dequeue

Proto:static ssize_t signalfd_dequeue(struct signalfd_ctx *ctx, kernel_siginfo_t *info, int nonblock)

Type:ssize_t

Parameter:

TypeParameterName
struct signalfd_ctx *ctx
kernel_siginfo_t *info
intnonblock
170  DECLARE_WAITQUEUE(wait, current process)
172  spin_lock_irq( & siglock)
173  ret = Dequeue a signal and return the element to the caller, which is* expected to free it.* All callers have to hold the siglock.
175  Case ret == 0
176  If Not nonblock Then Break
178  ret = -EAGAIN
180  Default
181  spin_unlock_irq( & siglock)
182  Return ret
185  add_wait_queue( & signalfd_wqh, & wait)
186  cycle
187  set_current_state(TASK_INTERRUPTIBLE)
188  ret = Dequeue a signal and return the element to the caller, which is* expected to free it.* All callers have to hold the siglock.
189  If ret != 0 Then Break
193  Break
195  spin_unlock_irq( & siglock)
196  schedule()
197  spin_lock_irq( & siglock)
199  spin_unlock_irq( & siglock)
201  remove_wait_queue( & signalfd_wqh, & wait)
202  set_current_state() includes a barrier so that the write of current->state* is correctly serialised wrt the caller's subsequent test of whether to* actually sleep:* for (;;) {* set_current_state(TASK_UNINTERRUPTIBLE);* if (!need_sleep)* break;* (Used in tsk->state: )
204  Return ret
Caller
NameDescribe
signalfd_readReturns a multiple of the size of a "struct signalfd_siginfo", or a negative* error code. The "count" parameter must be at least the size of a* "struct signalfd_siginfo".