]> granicus.if.org Git - php/commitdiff
-make the flock() emulation a separate function named php_flock()
authorMarcus Boerger <helly@php.net>
Mon, 11 Nov 2002 20:52:09 +0000 (20:52 +0000)
committerMarcus Boerger <helly@php.net>
Mon, 11 Nov 2002 20:52:09 +0000 (20:52 +0000)
-use a define to make php_flock() available as flock() when necessary
# The emulated php_flock even works on NFS this will be used elsewhere.

ext/standard/flock_compat.c
ext/standard/flock_compat.h

index 44f0b5c6ac159900b60ea896b530d0f8b5361659..2f03bcc85629911f58a09782fc3fbb67a889a217 100644 (file)
 #endif
 
 #ifndef HAVE_FLOCK
-PHPAPI int flock(int fd, int operation)
+/* defines flock as php_flock */
+#endif /* !defined(HAVE_FLOCK) */
+
+PHPAPI int php_flock(int fd, int operation)
 #if HAVE_STRUCT_FLOCK
 {
        struct flock flck;
@@ -157,7 +160,6 @@ PHPAPI int flock(int fd, int operation)
        return 0;
 }
 #endif
-#endif /* !defined(HAVE_FLOCK) */
 
 #if !(HAVE_INET_ATON)
 /* {{{ inet_aton
index 4b67b5cb044f1b00d9c04c954342e1e38ee4dd13..457e469eaaf6f4b6d51e2f237c41557a72d11911 100644 (file)
 #ifndef FLOCK_COMPAT_H
 #define FLOCK_COMPAT_H
 
+/* php_flock internally uses fcntl whther or not flock is available
+ * This way our php_flock even works on NFS files.
+ * More info: /usr/src/linux/Documentation
+ */
+PHPAPI int php_flock(int fd, int operation);
+
 #ifndef HAVE_FLOCK
 #      define LOCK_SH 1
 #      define LOCK_EX 2
 #      define LOCK_NB 4
 #      define LOCK_UN 8
-PHPAPI int flock(int fd, int operation);
+#   define flock php_flock
 #endif
 
 #ifdef PHP_WIN32