On Sun, 03 Aug 2003 12:21:05 -0400, Marc Rochkind wrote:
>> I have written a simple POSIX-like abstraction for System V semaphores:
>>
>> [url]http://users.erols.com/mballen/c/svsem.c[/url]
>>
> Can you be more precise about what you mean by "the semaphores are left
> in the state they were initialized to?"
>
> I notice that you remove the semaphore set on a close.
The troubling scenario is when the program increments or decrements the
semaphore so that it has a value that is not the value it was initialized
to and then exits without calling close().

Another process that opens the semaphore will see it already exists
and therefore not initialize it. It will have the value the last errant
process left it with.

I want multiple callers to be able to access the semaphore without
reinitializing it each time it's opened. It should only be initialized
when it is created.

Mike