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 …
Tag: posix
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…
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 ques…
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 f…
Why does posh fail to perform pathname expansion when a part of the path is specified within double-quotes?
Consider the following simple shell script: I get the expected output with bash, ksh, zsh and dash, but I don’t get it with posh: I am trying to understand if the behaviour of posh is correct as per the POSIX standard or if it is a bug. The relevant section in the POSIX documents seem to be “2.6 W…
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-g…
Why does ksh fail to capture standard error during nested command substitutions?
I have the following shell script. It produces the following output in bash, zsh, dash and posh. It makes sense because there is no such command called bogus on the system. But in ksh on Debian, it does not print the error message due to invoking the bogus command. What went wrong? In case, you want to know a…
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 comple…
Correct “nice” POSIX scheduling priority for batch processing program
I am working on a bulk image processing program which does not require user attention and need to choose a priority level for this process. The superuser is able to set values from PRI_MIN (-20) to PRI_MAX (+20) and normal users can set from 0 to PRI_MAX. The default level is zero. On Mac OS X 10.11, the man …