Return-Path: Delivered-To: apmail-httpd-modules-dev-archive@locus.apache.org Received: (qmail 28583 invoked from network); 29 Jan 2008 22:13:19 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 29 Jan 2008 22:13:19 -0000 Received: (qmail 21743 invoked by uid 500); 29 Jan 2008 22:13:09 -0000 Delivered-To: apmail-httpd-modules-dev-archive@httpd.apache.org Received: (qmail 21708 invoked by uid 500); 29 Jan 2008 22:13:09 -0000 Mailing-List: contact modules-dev-help@httpd.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: modules-dev@httpd.apache.org Delivered-To: mailing list modules-dev@httpd.apache.org Received: (qmail 21699 invoked by uid 99); 29 Jan 2008 22:13:09 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 29 Jan 2008 14:13:09 -0800 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of epowell@visi.com designates 208.42.156.2 as permitted sender) Received: from [208.42.156.2] (HELO conn-smtp.mc.mpls.visi.com) (208.42.156.2) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 29 Jan 2008 22:12:55 +0000 Received: from [192.168.0.174] (dc1wnat01.digitalriver.com [209.87.177.252]) (using TLSv1 with cipher RC4-SHA (128/128 bits)) (No client certificate requested) by conn-smtp.mc.mpls.visi.com (Postfix) with ESMTP id 69E64784A for ; Tue, 29 Jan 2008 16:12:47 -0600 (CST) Message-Id: <57A5FDE6-5295-4A81-9738-791A4486009F@visi.com> From: Ed Powell To: modules-dev@httpd.apache.org Content-Type: text/plain; charset=US-ASCII; format=flowed; delsp=yes Content-Transfer-Encoding: 7bit Mime-Version: 1.0 (Apple Message framework v915) Subject: pchild pool (Apache 1.3) Date: Tue, 29 Jan 2008 16:12:46 -0600 X-Mailer: Apple Mail (2.915) X-Virus-Checked: Checked by ClamAV on apache.org 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...)