signalfd.h 747 B

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