| 
									
										
										
										
											2022-06-17 16:59:56 +02:00
										 |  |  | /*
 | 
					
						
							|  |  |  |  * SPDX-FileCopyrightText: 2022 Espressif Systems (Shanghai) CO LTD | 
					
						
							|  |  |  |  * | 
					
						
							|  |  |  |  * SPDX-License-Identifier: Apache-2.0 | 
					
						
							|  |  |  |  */ | 
					
						
							| 
									
										
										
										
											2018-05-29 11:25:24 +02:00
										 |  |  | #include <pthread.h>
 | 
					
						
							|  |  |  | #include "esp_log.h"
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | const static char *TAG = "esp32_asio_pthread"; | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2019-03-08 15:07:00 +08:00
										 |  |  | int pthread_setcancelstate(int state, int *oldstate) | 
					
						
							|  |  |  | { | 
					
						
							|  |  |  |     return 0; | 
					
						
							|  |  |  | } | 
					
						
							| 
									
										
										
										
											2019-04-15 13:45:08 +10:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2019-11-07 12:07:44 +01:00
										 |  |  | //  This functions (pthread_sigmask(), sigfillset) are called from ASIO::signal_blocker to temporarily silence signals
 | 
					
						
							|  |  |  | //  Since signals are not yet supported in ESP pthread these functions serve as no-ops
 | 
					
						
							|  |  |  | //
 | 
					
						
							|  |  |  | int pthread_sigmask(int how, const sigset_t *restrict set, sigset_t *restrict oset) | 
					
						
							|  |  |  | { | 
					
						
							|  |  |  |     ESP_LOGD(TAG, "%s: Signals not supported in ESP pthread", __func__); | 
					
						
							|  |  |  |     return 0; | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | int sigfillset(sigset_t *what) | 
					
						
							|  |  |  | { | 
					
						
							|  |  |  |     ESP_LOGD(TAG, "%s: Signals not supported in ESP pthread", __func__); | 
					
						
							|  |  |  |     if (what != NULL) { | 
					
						
							|  |  |  |         *what = ~0; | 
					
						
							|  |  |  |     } | 
					
						
							|  |  |  |     return 0; | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2019-07-16 16:33:30 +07:00
										 |  |  | void newlib_include_pthread_impl(void) | 
					
						
							| 
									
										
										
										
											2019-04-15 13:45:08 +10:00
										 |  |  | { | 
					
						
							|  |  |  |     // Linker hook, exists for no other purpose
 | 
					
						
							|  |  |  | } |