Skip to content

Tag: c++

Transform a Commande Line Linux to a makefile [closed]

Closed. This question needs details or clarity. It is not currently accepting answers. Want to improve this question? Add details and clarify the problem by editing this post. Closed 3 years ago. Improve this question Is there anyone who can help me to transform this command line to a makefile : gcc -o hello_…

pointer get wrong value in different thread

I am writing a piece of code to demonstrate the multi-threading share memory writing. However, my code gets a strange 0xffffffff pointer I can’t make out why. I haven’t been writing cpp code for a while. please let me know if I get something wrong. I compile with the command: g++ –std=c++11 …

Check if at least one Wayland session is running

I’m using Qt and want to check if any Wayland session is running. For now I have this just for test code, that works as expected: Is it possible to get rid of QProcess and use Linux C++ API? Answer You can try to connect to Wayland. If you can connect to a Wayland composer it is running otherwise is

C system v Semaphore not locking critical region

I have a code that reads an integer from shared memory and then incerements the number in child processes. I’m using semaphore to lock this critical region so that the integer gets only increased if no other process is not increasing it. So I get a stable integer value. I have used SYSTEM V Semaphore fo…

Change application core dump directory with c program

I have one scenario where I want to change directory for core dumps by current application using c program. I have one option to do chdir() to specified directory. But this changes the home directory of application. And I am looking for some APIs which can change directory for core dumps only. Answer You can …