signalfd.h 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  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. struct signalfd_siginfo {
  10. __u32 ssi_signo;
  11. __s32 ssi_errno;
  12. __s32 ssi_code;
  13. __u32 ssi_pid;
  14. __u32 ssi_uid;
  15. __s32 ssi_fd;
  16. __u32 ssi_tid;
  17. __u32 ssi_band;
  18. __u32 ssi_overrun;
  19. __u32 ssi_trapno;
  20. __s32 ssi_status;
  21. __s32 ssi_int;
  22. __u64 ssi_ptr;
  23. __u64 ssi_utime;
  24. __u64 ssi_stime;
  25. __u64 ssi_addr;
  26. /*
  27. * Pad strcture to 128 bytes. Remember to update the
  28. * pad size when you add new members. We use a fixed
  29. * size structure to avoid compatibility problems with
  30. * future versions, and we leave extra space for additional
  31. * members. We use fixed size members because this strcture
  32. * comes out of a read(2) and we really don't want to have
  33. * a compat on read(2).
  34. */
  35. __u8 __pad[48];
  36. };
  37. #ifdef __KERNEL__
  38. #ifdef CONFIG_SIGNALFD
  39. /*
  40. * Deliver the signal to listening signalfd.
  41. */
  42. static inline void signalfd_notify(struct task_struct *tsk, int sig)
  43. {
  44. if (unlikely(waitqueue_active(&tsk->sighand->signalfd_wqh)))
  45. wake_up(&tsk->sighand->signalfd_wqh);
  46. }
  47. #else /* CONFIG_SIGNALFD */
  48. static inline void signalfd_notify(struct task_struct *tsk, int sig) { }
  49. #endif /* CONFIG_SIGNALFD */
  50. #endif /* __KERNEL__ */
  51. #endif /* _LINUX_SIGNALFD_H */