-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.
#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;
return 0;
}
#endif
-#endif /* !defined(HAVE_FLOCK) */
#if !(HAVE_INET_ATON)
/* {{{ inet_aton
#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