函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:fs\signalfd.c Create Date:2022-07-29 10:51:32
Last Modify:2020-03-12 14:18:49 Copyright©Brick
首页 函数Tree
注解内核,赢得工具下载SCCTEnglish

函数名称:signalfd_dequeue

函数原型:static ssize_t signalfd_dequeue(struct signalfd_ctx *ctx, kernel_siginfo_t *info, int nonblock)

返回类型:ssize_t

参数:

类型参数名称
struct signalfd_ctx *ctx
kernel_siginfo_t *info
intnonblock
170  DECLARE_WAITQUEUE(wait, 当前进程)
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  :ret恒等于0
176  如果非nonblock退出
178  ret等于负EAGAIN
180  默认
181  spin_unlock_irq( & siglock)
182  返回:ret
185  add_wait_queue( & signalfd_wqh, & wait)
186  循环
187  set_current_state(睡眠态)
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  如果ret不等于0则退出
191  如果signal_pending(当前进程)则
193  退出
195  spin_unlock_irq( & siglock)
196  进程调度
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;* (就绪态)
204  返回:ret
调用者
名称描述
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".