Re: sem_open() returns ENOSPC
Re: sem_open() returns ENOSPC
- Subject: Re: sem_open() returns ENOSPC
- From: Norm Green <email@hidden>
- Date: Wed, 14 Jul 2010 16:50:05 -0700
Well that might account for the problem. Since I need (but do not have)
unnamed POSIX semaphores in Darwin, I generate a random name for each
semaphore but unlink. Sounds like I need to find some way to allocate
semaphores with a well known name and then unlink it before attempting
to use the name again.
Norm Green
On 7/14/2010 3:51 PM, Alastair Houghton wrote:
On 14 Jul 2010, at 23:42, Norm Green wrote:
As I said in my post, the process is in start-up when I get the error, so I'm confident I don't have a leak at this point. Do I need to call sem_close() even if the process terminates?
You won't need to call sem_close(), but if you're generating the names for your semaphores algorithmically and you might generate many different names, you *will* need to call sem_unlink(). Semaphores are shared between processes, and once created they continue to exist (with the same name) until they're explicitly deleted with sem_unlink().
Kind regards,
Alastair.
--
http://alastairs-place.net
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Darwin-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden