signalfd.h 817 B

1234567891011121314151617181920212223242526272829303132333435
  1. /* SPDX-License-Identifier: GPL-2.0 */
  2. /*
  3. * include/linux/signalfd.h
  4. *
  5. * Copyright (C) 2007 Davide Libenzi <davidel@xmailserver.org>
  6. *
  7. */
  8. #ifndef _LINUX_SIGNALFD_H
  9. #define _LINUX_SIGNALFD_H
  10. #include <uapi/linux/signalfd.h>
  11. #include <linux/sched/signal.h>
  12. #ifdef CONFIG_SIGNALFD
  13. /*
  14. * Deliver the signal to listening signalfd.
  15. */
  16. static inline void signalfd_notify(struct task_struct *tsk, int sig)
  17. {
  18. if (unlikely(waitqueue_active(&tsk->sighand->signalfd_wqh)))
  19. wake_up(&tsk->sighand->signalfd_wqh);
  20. }
  21. extern void signalfd_cleanup(struct sighand_struct *sighand);
  22. #else /* CONFIG_SIGNALFD */
  23. static inline void signalfd_notify(struct task_struct *tsk, int sig) { }
  24. static inline void signalfd_cleanup(struct sighand_struct *sighand) { }
  25. #endif /* CONFIG_SIGNALFD */
  26. #endif /* _LINUX_SIGNALFD_H */