Отправка сигнала SIGINT для обработки при выполнении системного вызова или сценария с помощью killall -SIGINT [closed]

Las carpetas que comienzan con un '.' son carpetas ocultas en Linux, lo que significa que debe agregar la marca -a (all )a ls para verlas. Prueba esto:

ls -la ~/

Y debería encontrar las carpetas que comienzan con un punto creado por IntelliJ en su carpeta de inicio.

Además, si lo instaló con un.deb o desde un repositorio, use la opción "purgar" o apt para eliminar automáticamente los archivos de configuración, que es lo que se almacena en esa carpeta:

sudo apt purge intelliJ 

Sin embargo, tendrás que verificar el nombre del paquete, no sé si se llama así.

1
27.12.2016, 08:43
2 ответа

из Справочная страница системы (3) -

system()  executes a command specified in command by calling /bin/sh -c command, and returns after the command has been completed.  During execution of the
       command, SIGCHLD will be blocked, and SIGINT and SIGQUIT will be ignored.

Даже если сигнал отправляется всем процессам (указанным по имени), родительский элемент здесь игнорирует SIGINT во время вызова system (). Однако он должен ответить после завершения вызова (в вашем случае во время sleep ()) - пробовали ли вы увеличить окно сна?

3
29.04.2021, 00:06
#include<stdio.h>
#include <signal.h>
 void signalHandler(int);
int main()
{
    struct sigaction sa;
    sa.sa_flags = 0;
    // Setup the signal handler
    sa.sa_handler = signalHandler;
    // Block every signal during the handler
    sigfillset(&sa.sa_mask);  
    if (sigaction(SIGINT, &sa, NULL) == -1) {
    printf("Error: cannot handle SIGINT\n"); 
}

    while(1)
    {
        printf("Start to ping google.com");
        system("ping www.google.com -c 1");
        printf("Stop to ping google.com\n");
        sleep(1);
    }

}

void signalHandler(int signal)
{
    printf("signalHandler: signal = %d\n", signal); 
}
0
29.04.2021, 00:06

Теги

Похожие вопросы