Skip to content
Advertisement

Tag: posix

Mitigating memory leaks by forking

This is a really ugly question. I have a C++ program which does the following in a loop: Waits for a JMS message Calculates some data Sends a JMS message in response My program (let’s call it “Bob”) has a rather severe memory leak. The memory leak is located in a shared library that someone else wrote, which I must

Checking if errno != EINTR: what does it mean?

I’ve found this piece of code used several times (also a similar one where it’s used open() instead of write()). Why it is checked if && errno != EINTR here ? Looking for errno on man I found the following text about EINTR, but even if I visited man 7 signal that doesn’t enlighten me. EINTR Interrupted function call (POSIX.1);

Is there a Linux equivalent for Windows “InterLockedCompareExchange” API? [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers. We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations. Closed 6 years ago. Improve this question Is there any posix/thread related API that could help to make

Running bash using posix instead of fork/execv

I have a CLI, one of the commands is entering into Linux bash shell. This is the code which does it using fork & execv: I want to replace the fork/execv and to use posix_spawn instead: But it doesn’t work. Any help? Answer Let’s look at what the code in the original fork/exec does: close all file descriptors open the

Compiler says uuid.h not found but apt-get says it is

When compiling my C++ project that includes uuid.h I get the compile error: fatal error: uuid.h: No such file or directory I’m not sure whats going wrong. It could be my compiler instructions are wrong or that I indeed dont have that file installed (but I don’t think thats the problem). sudo apt-get install uuid-dev The above command outputs: uuid-dev

POSIX timer hangs up after a few runs

I have created a POSIX timer in the main function of my program. Each thread of the main program is setting the timer so that on expiry of it, the signal handler update one variable which awakes the next thread of the same process. The timer is working fine most of the time but not always. It sometimes completes the

Advertisement