MCPcopy Create free account
hub / github.com/RT-Thread/rt-thread / sys_sigpending

Function sys_sigpending

components/lwp/lwp_syscall.c:6625–6651  ·  view source on GitHub ↗

* @brief Retrieves the set of signals that are pending for delivery to the calling process. * * This system call allows a process to query the set of signals that are pending, i.e., signals that have * been sent to the process but have not yet been delivered because the process is blocking those signals * or has not yet handled them. The function returns the set of signals that are waiting to

Source from the content-addressed store, hash-verified

6623 * @see sys_sigaction(), sys_sigprocmask()
6624 */
6625sysret_t sys_sigpending(sigset_t *sigset, size_t sigsize)
6626{
6627 sysret_t ret = 0;
6628 lwp_sigset_t lwpset;
6629
6630 /* Verify and Get sigset, timeout */
6631 if (!sigset || !lwp_user_accessable((void *)sigset, sigsize))
6632 {
6633 ret = -EFAULT;
6634 }
6635 else
6636 {
6637 /* Fit sigset size to lwp set */
6638 if (sizeof(lwpset) < sigsize)
6639 {
6640 LOG_I("%s: sigsize (%lx) extends lwp sigset chunk\n", __func__, sigsize);
6641 sigsize = sizeof(lwpset);
6642 }
6643
6644 lwp_thread_signal_pending(rt_thread_self(), &lwpset);
6645
6646 if (!lwp_put_to_user(sigset, &lwpset, sigsize))
6647 RT_ASSERT(0); /* should never happened */
6648 }
6649
6650 return ret;
6651}
6652
6653/**
6654 * @brief Waits for a signal to be delivered, with a timeout.

Callers

nothing calls this directly

Calls 4

lwp_user_accessableFunction · 0.85
rt_thread_selfFunction · 0.85
lwp_put_to_userFunction · 0.85

Tested by

no test coverage detected