the code is below ,but when I use sigaction function, the compile was failed, it said
"undefined reference to `sigaction", but I have already include the signal.h , so what's the problem? Thanks very much!
...
...
#include "esp_system.h"
#include <pthread.h>
#include "esp_spi_flash.h"
#include "signal.h"
void app_main(void)
{
int i;
pthread_t thrid_sx1302;
printf("Hello world!\n");
struct sigaction sigact;
sigaction(SIGQUIT, &sigact, NULL); /* Ctrl-\ */
sigaction(SIGINT, &sigact, NULL); /* Ctrl-C */
sigaction(SIGTERM, &sigact, NULL); /* default "kill" command */
/* Print chip information */
esp_chip_info_t chip_info;
esp_chip_info(&chip_info);
printf("This is %s chip with %d CPU core(s), WiFi%s%s, ",
CONFIG_IDF_TARGET,
chip_info.cores,
(chip_info.features & CHIP_FEATURE_BT) ? "/BT" : "",
(chip_info.features & CHIP_FEATURE_BLE) ? "/BLE" : "");
...
...
}
esp32 can not use sigaction function
-
- Posts: 9709
- Joined: Thu Nov 26, 2015 4:08 am
Re: esp32 can not use sigaction function
ESP-IDF does not support signals. Things like SIGQUIT (a request to quit the current program) don't really make sense on a microcontroller without a clear concept of applications.
Re: esp32 can not use sigaction function
Got it, thank you !
Who is online
Users browsing this forum: No registered users and 30 guests