Return-Path: Delivered-To: apmail-new-httpd-archive@apache.org Received: (qmail 88698 invoked by uid 500); 10 Nov 2000 22:56:04 -0000 Mailing-List: contact new-httpd-help@apache.org; run by ezmlm Precedence: bulk Reply-To: new-httpd@apache.org list-help: list-unsubscribe: list-post: Delivered-To: mailing list new-httpd@apache.org Received: (qmail 88632 invoked from network); 10 Nov 2000 22:56:03 -0000 X-Authentication-Warning: adsl-77-241-65.rdu.bellsouth.net: trawick set sender to trawickj@bellsouth.net using -f Sender: trawick@bellsouth.net To: new-httpd@apache.org Subject: Re: [?PATCH?] using getpwnam_r in mod_userdir References: From: Jeff Trawick Date: 10 Nov 2000 17:48:16 -0500 In-Reply-To: Sascha Schumann's message of "Fri, 10 Nov 2000 23:04:29 +0100 (CET)" Message-ID: Lines: 28 User-Agent: Gnus/5.0807 (Gnus v5.8.7) Emacs/20.3 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Spam-Rating: locus.apache.org 1.6.2 0/1000/N Sascha Schumann writes: > Our "user" code like mod_userdir.c should just assume that > getpwnam_r exists. If it does not exist, we can provide a > fallback which serializes access to the OS-function. > Otherwise, we start duplicating work-arounds and checks all > over the place. > > I'm attaching such a fallback for getpwnam_r. There are two > issues with this: > > - ACQUIRE_LOCK/RELEASE_LOCK should be defined to mutex-like > functions, if we are compiling thread-safe (otherwise, > they are nops). > - The getpwnam_r function should be prefixed properly to > avoid conflicts with system functions which have the same > name, but another interface. Another issue (perhaps not affecting more than one system): it assumes that getpwnam() isn't thread-safe. If getpwnam() is thread-safe, we don't need the lock and we don't need to copy. How many of these reentrant function issues have come up with PHP? -- Jeff Trawick | trawick@ibm.net | PGP public key at web site: http://www.geocities.com/SiliconValley/Park/9289/ Born in Roswell... married an alien...