Re: Bug #2167: configure incorrectly identifies flock() as available

From: Date: Thu, 26 Aug 1999 18:16:48 +0000
Subject: Re: Bug #2167: configure incorrectly identifies flock() as available
References: 1  Groups: php.dev 
Request: Send a blank email to php-dev+get-10239@lists.php.net to get a copy of this message
On Thu, Aug 26, 1999 at 05:41:46PM -0000, lyndon@messagingdirect.com wrote: > From: lyndon@messagingdirect.com > Operating system: SunOS 5.7 > PHP version: 3.0.12 > PHP Bug Type: Compile Failure > Bug description: configure incorrectly identifies flock() as available > > configure finds the flock() compatibility function on SunOS > 5.7 and incorrectly assumes it's the real flock. > > The flock() in SunOS 5.x is a compatibility wrapper around > fcntl(). It does not support the true semantics of flock(). > In fact, it suffers from all the locking braindamage > inherent in fcntl(). In addition, PHP fails to compile > since SunOS 5.x puts the LOCK_* constants in sys/file.h > which isn't included in the C source files. > > The fix is to not use flock() on SunOS 5.x. The following > patch disables the test for flock() when building on > SunOS. (Note: flock() does work on SunOS 4.x, but this > "fix" doesn't differentiate between 4.x and 5.x. Someone > with access to 4.x will need to modify the patched > configure to re-enable flock() there.) I don't see any advantage in using our flock() emulation over Solaris' fcntl() wrapper. Our wrapper depends as well on fcntl(). Sun is in the better position, since they can optimize their wrapper while our implementation is aimed at maximum portability. We probably just need to add #include <sys/file.h> at the appropiate place. -- Regards, Sascha Schumann Consultant

« previous php.dev (#10239) next »