pthread.c 929 B

12345678910111213141516171819202122232425262728293031323334353637
  1. /*
  2. * SPDX-FileCopyrightText: 2022 Espressif Systems (Shanghai) CO LTD
  3. *
  4. * SPDX-License-Identifier: Apache-2.0
  5. */
  6. #include <pthread.h>
  7. #include "esp_log.h"
  8. const static char *TAG = "esp32_asio_pthread";
  9. int pthread_setcancelstate(int state, int *oldstate)
  10. {
  11. return 0;
  12. }
  13. // This functions (pthread_sigmask(), sigfillset) are called from ASIO::signal_blocker to temporarily silence signals
  14. // Since signals are not yet supported in ESP pthread these functions serve as no-ops
  15. //
  16. int pthread_sigmask(int how, const sigset_t *restrict set, sigset_t *restrict oset)
  17. {
  18. ESP_LOGD(TAG, "%s: Signals not supported in ESP pthread", __func__);
  19. return 0;
  20. }
  21. int sigfillset(sigset_t *what)
  22. {
  23. ESP_LOGD(TAG, "%s: Signals not supported in ESP pthread", __func__);
  24. if (what != NULL) {
  25. *what = ~0;
  26. }
  27. return 0;
  28. }
  29. void newlib_include_pthread_impl(void)
  30. {
  31. // Linker hook, exists for no other purpose
  32. }