LeTak@feddit.org to linuxmemes@lemmy.world · 11 hours agoMen can't read our signalsfeddit.orgimagemessage-square18fedilinkarrow-up1235arrow-down113
arrow-up1222arrow-down1imageMen can't read our signalsfeddit.orgLeTak@feddit.org to linuxmemes@lemmy.world · 11 hours agomessage-square18fedilink
minus-squarer00ty@kbin.lifelinkfedilinkarrow-up3·6 hours 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.