LeTak@feddit.org to linuxmemes@lemmy.world · 3 days agoMen can't read our signalsfeddit.orgimagemessage-square42fedilinkarrow-up1363arrow-down118
arrow-up1345arrow-down1imageMen can't read our signalsfeddit.orgLeTak@feddit.org to linuxmemes@lemmy.world · 3 days agomessage-square42fedilink
minus-squarer00ty@kbin.lifelinkfedilinkarrow-up6·3 days agoHere you go #include <iostream> #include <csignal> #include <unistd.h> void sigusr1_handler(int signal) { std::cout << "Signal USR1" << std::endl; } int main() { std::cout << "Installed handler for USR1" << std::endl; std::signal(SIGUSR1, sigusr1_handler); while (1 == 1) { usleep(5000000); // 5 seconds std::cout << "Waiting for signal" << std::endl; } } That will help you read at least one of them.
Here you go
#include <iostream> #include <csignal> #include <unistd.h> void sigusr1_handler(int signal) { std::cout << "Signal USR1" << std::endl; } int main() { std::cout << "Installed handler for USR1" << std::endl; std::signal(SIGUSR1, sigusr1_handler); while (1 == 1) { usleep(5000000); // 5 seconds std::cout << "Waiting for signal" << std::endl; } }
That will help you read at least one of them.