Bug #2167: configure incorrectly identifies flock() as available
| From: | lyndon at messagingdirect dot com | Date: | Thu, 26 Aug 1999 17:41:46 +0000 |
| Subject: | Bug #2167: configure incorrectly identifies flock() as available | ||
| Groups: | php.dev | ||
| Request: | Send a blank email to php-dev+get-10236@lists.php.net to get a copy of this message | ||
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.)
XXX: BEWARE THE LINE BREAKS BELOW!
Index: configure.in
===================================================================
RCS file: /cvs/webserver/webserver/php/configure.in,v
retrieving revision 1.5
diff -u -r1.5 configure.in
--- configure.in 1999/08/26 03:55:46 1.5
+++ configure.in 1999/08/26 17:39:34
@@ -249,7 +249,14 @@
dnl Checks for library functions.
AC_FUNC_VPRINTF
-AC_CHECK_FUNCS(memcpy memmove strdup strerror strcasecmp strstr flock lockf putenv tempnam usleep
setlocale gettimeofday setvbuf srand48 lrand48 srandom random link symlink regcomp getlogin cuserid
vsnprintf gcvt utime crypt setitimer rint unsetenv strftime setsockopt tzset statvfs statfs
inet_aton shutdown truncate getpgid getsid getrlimit snprintf)
+AC_CHECK_FUNCS(memcpy memmove strdup strerror strcasecmp strstr lockf putenv tempnam usleep
setlocale gettimeofday setvbuf srand48 lrand48 srandom random link symlink regcomp getlogin cuserid
vsnprintf gcvt utime crypt setitimer rint unsetenv strftime setsockopt tzset statvfs statfs
inet_aton shutdown truncate getpgid getsid getrlimit snprintf)
+dnl
+dnl Solaris implements flock on top of fcntl, thus flock doesn't
+dnl work as advertised there, so we ignore it.
+dnl
+if test "
uname -s 2>/dev/null" != "SunOS"; then
+ AC_CHECK_FUNCS(flock)
+fi
AC_FUNC_UTIME_NULL
AC_FUNC_ALLOCA
AC_BROKEN_SPRINTF