signal.h 2.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. /*
  2. * Amazon FreeRTOS POSIX V1.1.0
  3. * Copyright (C) 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved.
  4. *
  5. * Permission is hereby granted, free of charge, to any person obtaining a copy of
  6. * this software and associated documentation files (the "Software"), to deal in
  7. * the Software without restriction, including without limitation the rights to
  8. * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
  9. * the Software, and to permit persons to whom the Software is furnished to do so,
  10. * subject to the following conditions:
  11. *
  12. * The above copyright notice and this permission notice shall be included in all
  13. * copies or substantial portions of the Software.
  14. *
  15. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  16. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
  17. * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
  18. * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
  19. * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
  20. * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
  21. *
  22. * http://aws.amazon.com/freertos
  23. * http://www.FreeRTOS.org
  24. */
  25. /**
  26. * @file signal.h
  27. * @brief Signals.
  28. *
  29. * Signals are currently not implemented in FreeRTOS+POSIX. This header only
  30. * defines the signal data structures used elsewhere.
  31. *
  32. * http://pubs.opengroup.org/onlinepubs/9699919799/basedefs/signal.h.html
  33. */
  34. #ifndef _FREERTOS_POSIX_SIGNAL_H_
  35. #define _FREERTOS_POSIX_SIGNAL_H_
  36. /**
  37. * @name Values of sigev_notify.
  38. */
  39. /**@{ */
  40. #define SIGEV_NONE 0 /**< No asynchronous notification is delivered when the event of interest occurs. */
  41. #define SIGEV_SIGNAL 1 /**< A queued signal, with an application-defined value, is generated when the event of interest occurs. Not supported. */
  42. #define SIGEV_THREAD 2 /**< A notification function is called to perform notification. */
  43. /**@} */
  44. /**
  45. * @brief Signal value.
  46. */
  47. union sigval
  48. {
  49. int sival_int; /**< Integer signal value. */
  50. void * sival_ptr; /**< Pointer signal value. */
  51. };
  52. /**
  53. * @brief Signal event structure.
  54. */
  55. struct sigevent
  56. {
  57. int sigev_notify; /**< Notification type. A value of SIGEV_SIGNAL is not supported. */
  58. int sigev_signo; /**< Signal number. This member is ignored. */
  59. union sigval sigev_value; /**< Signal value. Only the sival_ptr member is used. */
  60. void ( * sigev_notify_function )( union sigval ); /**< Notification function. */
  61. pthread_attr_t * sigev_notify_attributes; /**< Notification attributes. */
  62. };
  63. #endif /* ifndef _FREERTOS_POSIX_SIGNAL_H_ */