Unexpected behavior of sem_open?

Specifying O_CREAT doesn't force it to create, it only creates the semaphore if it does not already exist. Since you find that it doesn't take on your initialization value I would guess that sem_name already exists with value 0 at the time you call sem_open.

It does not exist, I give various names for the semaphore and the result is the same: it fails to initialize the semaphore with the value I want. If I put sem_open("constant_string", O_CREAT, 0644, 1) it retains the value 1, otherwise I give a string variable, it does not. – Madrugada May 10 at 16:59 @Madrugada: Sounds like your issue is with strings, not sem_open... – R.. May 10 at 17:06 1 I found the problem,thanks a lot all!

– Madrugada May 10 at 17:39 1 @Madrugada, mind telling us what it was. Somebody else might learn from your experience. – Jens Gustedt May 10 at 18:19 1 I was trying to reinitialize something that was initialized before-in another program which I didn't have the source of.. so it just took the value it was init there, not mine.... – Madrugada May 10 at 18:25.

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions