signalfd.h 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586
  1. /* Copyright (C) 2007, 2008 Free Software Foundation, Inc.
  2. This file is part of the GNU C Library.
  3. The GNU C Library is free software; you can redistribute it and/or
  4. modify it under the terms of the GNU Lesser General Public
  5. License as published by the Free Software Foundation; either
  6. version 2.1 of the License, or (at your option) any later version.
  7. The GNU C Library is distributed in the hope that it will be useful,
  8. but WITHOUT ANY WARRANTY; without even the implied warranty of
  9. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  10. Lesser General Public License for more details.
  11. You should have received a copy of the GNU Lesser General Public
  12. License along with the GNU C Library; if not, write to the Free
  13. Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
  14. 02111-1307 USA. */
  15. #ifndef _SYS_SIGNALFD_H
  16. #define _SYS_SIGNALFD_H 1
  17. #define __need_sigset_t
  18. #include <signal.h>
  19. #include <stdint.h>
  20. struct signalfd_siginfo
  21. {
  22. uint32_t ssi_signo;
  23. int32_t ssi_errno;
  24. int32_t ssi_code;
  25. uint32_t ssi_pid;
  26. uint32_t ssi_uid;
  27. int32_t ssi_fd;
  28. uint32_t ssi_tid;
  29. uint32_t ssi_band;
  30. uint32_t ssi_overrun;
  31. uint32_t ssi_trapno;
  32. int32_t ssi_status;
  33. int32_t ssi_int;
  34. uint64_t ssi_ptr;
  35. uint64_t ssi_utime;
  36. uint64_t ssi_stime;
  37. uint64_t ssi_addr;
  38. uint8_t __pad[48];
  39. };
  40. /* Flags for signalfd. */
  41. #if defined __sparc__ || defined __sparc64__
  42. enum
  43. {
  44. SFD_CLOEXEC = 0x400000,
  45. # define SFD_CLOEXEC SFD_CLOEXEC
  46. SFD_NONBLOCK = 0x4000
  47. # define SFD_NONBLOCK SFD_NONBLOCK
  48. };
  49. #elif defined __alpha__
  50. enum
  51. {
  52. SFD_CLOEXEC = 010000000,
  53. # define SFD_CLOEXEC SFD_CLOEXEC
  54. SFD_NONBLOCK = 04
  55. # define SFD_NONBLOCK SFD_NONBLOCK
  56. };
  57. #else
  58. enum
  59. {
  60. SFD_CLOEXEC = 02000000,
  61. # define SFD_CLOEXEC SFD_CLOEXEC
  62. SFD_NONBLOCK = 04000
  63. # define SFD_NONBLOCK SFD_NONBLOCK
  64. };
  65. #endif
  66. __BEGIN_DECLS
  67. /* Request notification for delivery of signals in MASK to be
  68. performed using descriptor FD.*/
  69. extern int signalfd (int __fd, const sigset_t *__mask, int __flags)
  70. __nonnull ((2)) __THROW;
  71. __END_DECLS
  72. #endif /* sys/signalfd.h */