I am working on a module for Apache 1.3 (upgrading to 2.x is not an option at the moment) where I want to, for each Apache child process that spawns, open a file, and keep that file open for reading for the life of the child process. The API document describes a pchild pool that sounds exactly like what I want: lives for the length of the child, calls the child_init and child_exit handlers where I can stick the ap_fopen and ap_fclose functions into...

Problem is, I have no idea how to use this. I suppose its more of a problem of not knowing how to use pools for storing my own information.

I could allocate sizeof(FILE) to the pchild pool, and I'll get a pointer back, and store the file descriptor in there. Great... now how do I tell the rest of the module what that pointer is? Just put in a "static FILE *myfile;" line in the code? Is that going to be multi-process safe? (I get the feeling I'm asking the wrong questions...)

Reply via email to