Skip to content

Tag: c++

How to stop the repetition of inotify result?

In this code, I am trying to monitor two paths at the same time. I used while(1) for this purpose. But the problem that I am facing is that whenever I run the code, it gives me the same result two times like this. Giving result Expected result I debugged the code. After breaking the main function and stepping…

How to capture and modify mouse events in linux?

I want to write a program that changes the behavior of mouse when certain key is pressed. But I am not quite familiar with event mechanisms in linux. My guess is that I need to filter through the “event queue” looking for “key press” and “mouse press” events, and somehow mo…

Signals – SIGUSR1 class exercise

I got this as a class exercise. I had to analyze the output without running it and I figured that the output should be num=4. But actually the output of this code after running it is: I’ll be glad to know what am I missing? Answer This is an interesting question. So what’s happening is that a sign…