signalfd.h 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  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. enum
  42. {
  43. SFD_CLOEXEC = 02000000,
  44. #define SFD_CLOEXEC SFD_CLOEXEC
  45. SFD_NONBLOCK = 04000
  46. #define SFD_NONBLOCK SFD_NONBLOCK
  47. };
  48. __BEGIN_DECLS
  49. /* Request notification for delivery of signals in MASK to be
  50. performed using descriptor FD.*/
  51. extern int signalfd (int __fd, const sigset_t *__mask, int __flags)
  52. __THROW __nonnull ((2));
  53. __END_DECLS
  54. #endif /* sys/signalfd.h */