apr-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Graham Leggett <minf...@sharp.fm>
Subject Re: apr_shm_attach() and APR_EEXIST
Date Wed, 26 May 2004 12:34:46 GMT
Amit Athavale wrote:

> Normally EEXIST is returned when CREATE and EXCL flags are combined.
> So I guess you are trying to create segment which is already there. 
> check with ipcs
> whether you have orphan segments ('cause of some reasons)

When I run ipcs, I get a long list of segments under the username used 
for testing Apache, so I guess this would be true.

What is the "correct" way to initialise shared memory in such a way that 
if there was a previous unclean shutdown, it recovers from this condition?

> What are values for these constants in your apr.h (method to use for SHM)
> 
> APR_USE_SHMEM_MMAP_TMP    APR_USE_SHMEM_MMAP_SHM    
> APR_USE_SHMEM_MMAP_ZERO   APR_USE_SHMEM_SHMGET_ANON 
> APR_USE_SHMEM_SHMGET      APR_USE_SHMEM_MMAP_ANON  

It looks like this:

#define APR_USE_SHMEM_MMAP_TMP     0
#define APR_USE_SHMEM_MMAP_SHM     0
#define APR_USE_SHMEM_MMAP_ZERO    0
#define APR_USE_SHMEM_SHMGET_ANON  0
#define APR_USE_SHMEM_SHMGET       1
#define APR_USE_SHMEM_MMAP_ANON    1
#define APR_USE_SHMEM_BEOS         0

Regards,
Graham
--

Mime
View raw message