Category : signals

I am testing the signal system under macos. This is my test code: #include <signal.h> #include <string.h> #include <stdio.h> #include <stdlib.h> #include <sys/time.h> struct itimerval timeout={0}; static void handle_prof_signal(int sig_no, siginfo_t* info, void *vcontext) { char output[100]; ucontext_t *context = (ucontext_t*)vcontext; size_t pc = context->uc_mcontext->__ss.__rip; snprintf(output,100,"Sample at %zxn",pc); // write(1,output,strlen(output)+1); printf("%s", output); setitimer(ITIMER_PROF, &timeout, 0); ..

Read more

So lets say I a QDialog class like this class DiagExample : public QDialog { Q_OBJECT public: DiagExample(QWidget *parent); private: int myIntValue = 0; QPushButton *AddToValue; QPushButton *MinusToValue; QLabel *counter; }; And the implementation looks like this DiagExample::DiagExample(QWidget *parent) : QDialog(parent) { setWindowTitle("Example Diag"); QVBoxLayout *layout = new QVBoxLayout(this); AddToValue = new QPushButton(tr("Add")); MinusToValue = ..

Read more

I have implemented code that intercepts signals using std::signal() installed signal handlers. On Linux I am using socketpair() and QSocketNotifier together with read()/write() to communicate with the (Qt) application in a signal handler safe manner and call non-signal-safe functions there. Now I want to use the same std::signal() based handlers on Windows. However I could ..

Read more

I am trying to get some signal handling to work but when I look up any sources, they just simply declare a: struct sigaction sa; However, when I do that, I get the error "Incomplete type not allowed". Code below: #include <iostream> #include <stdio.h> #include <signal.h> int main() { struct sigaction sa; return 0; } ..

Read more