httpd-modules-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ben Noordhuis <>
Subject Re: Module External Configuration
Date Tue, 21 Jun 2011 21:44:24 GMT
On Tue, Jun 21, 2011 at 23:26, Jason Funk <> wrote:
> One last question about shared memory...
> I have my configuration now being loaded successfully into a shared memory
> segment.. now my problem is that someone could change the config so that the
> resulting structure wouldn't fit in the shared memory segment. Is it
> possible to in the child replace my current shared memory segment with a
> bigger one? I tried destroy()ing and then create()ing but that resulted in a
> segfault. Should it have worked? Is there a different way?

As I've said before, no, you cannot portably resize a shared memory
segment. APR doesn't even expose that functionality.

If you're targeting Unices only, you can use Sys V or POSIX IPC: you
open() or shm_open() a memory segment, then ftruncate() it to the
desired size. Make sure to wrap the call to ftruncate() in an
exclusive lock or bad things will happen.

View raw message