apr-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Joe Orton <...@manyfish.co.uk>
Subject Re: apr_shm_attach() and APR_EEXIST
Date Wed, 26 May 2004 14:10:41 GMT
On Wed, May 26, 2004 at 07:24:15PM +0530, Amit Athavale wrote:
> >
> >
> >This stuff is a complete mess in APR.  The name-based shmget method
> >*does* use and create a real file, but it's redundant AFAICT; 
> >
> 
> It's not completely redundunt AFAIU.
> 
> The shmkey param passed to shmget is calculated using ftok(). On some
> platforms ftok() fails if file does not exists.

Oh, right, and uses the inode number, so it must continue to exist...

> >all it
> >does is store the size of the segment, which shmctl will tell you anyway
> >on.
> >
> Interesting . Why APR stores/read this value from file ? Isn't shmctl is 
> better (fast?)
> than file - (open/read/close) sequence ?

And less fragile, yeah, nobody had a reason for doing it last time I
asked.

joe

Mime
View raw message