2000-07-24 01:40:02 +00:00
|
|
|
/*
|
|
|
|
+----------------------------------------------------------------------+
|
2001-12-11 15:32:16 +00:00
|
|
|
| PHP Version 4 |
|
2000-07-24 01:40:02 +00:00
|
|
|
+----------------------------------------------------------------------+
|
2002-12-31 16:08:15 +00:00
|
|
|
| Copyright (c) 1997-2003 The PHP Group |
|
2000-07-24 01:40:02 +00:00
|
|
|
+----------------------------------------------------------------------+
|
|
|
|
| This source file is subject to version 2.02 of the PHP license, |
|
|
|
|
| that is bundled with this package in the file LICENSE, and is |
|
|
|
|
| available at through the world-wide-web at |
|
|
|
|
| http://www.php.net/license/2_02.txt. |
|
|
|
|
| If you did not receive a copy of the PHP license and are unable to |
|
|
|
|
| obtain it through the world-wide-web, please send a note to |
|
|
|
|
| license@php.net so we can mail you a copy immediately. |
|
|
|
|
+----------------------------------------------------------------------+
|
2002-02-28 08:29:35 +00:00
|
|
|
| Author: Sascha Schumann <sascha@schumann.cx> |
|
2000-07-24 01:40:02 +00:00
|
|
|
+----------------------------------------------------------------------+
|
|
|
|
*/
|
|
|
|
|
|
|
|
/* $Id$ */
|
|
|
|
|
2000-07-02 23:46:51 +00:00
|
|
|
#ifndef FLOCK_COMPAT_H
|
|
|
|
#define FLOCK_COMPAT_H
|
1999-04-21 19:01:38 +00:00
|
|
|
|
2002-11-11 20:52:09 +00:00
|
|
|
/* 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);
|
|
|
|
|
* fixed some #if/#ifdef issues
* hand-patched in php3 changes from 3.0.6 to HEAD in these files:
fopen-wrappers.[ch] ext/standard/file.[ch] ext/standard/fsock.[ch]
ext/standard/php3_string.h ext/standard/string.c
* added some new file/socket macros for more readable code:
FP_FGETS(buf,len,sock,fp,issock)
FP_FREAD(buf,len,sock,fp,issock)
FP_FEOF(sock,fp,issock)
FP_FGETC(sock,fp,issock)
1999-06-16 17:06:53 +00:00
|
|
|
#ifndef HAVE_FLOCK
|
1999-04-21 19:01:38 +00:00
|
|
|
# define LOCK_SH 1
|
|
|
|
# define LOCK_EX 2
|
|
|
|
# define LOCK_NB 4
|
|
|
|
# define LOCK_UN 8
|
2002-11-11 23:40:33 +00:00
|
|
|
PHPAPI int flock(int fd, int operation);
|
1999-04-21 19:01:38 +00:00
|
|
|
#endif
|
|
|
|
|
2000-02-11 15:59:30 +00:00
|
|
|
#ifdef PHP_WIN32
|
2000-06-06 18:30:06 +00:00
|
|
|
#define EWOULDBLOCK WSAEWOULDBLOCK
|
1999-04-21 19:01:38 +00:00
|
|
|
# define fsync _commit
|
2001-08-11 17:03:37 +00:00
|
|
|
# define ftruncate(a, b) chsize(a, b)
|
2000-02-11 15:59:30 +00:00
|
|
|
#endif /* defined(PHP_WIN32) */
|
1999-04-21 19:01:38 +00:00
|
|
|
|
|
|
|
#if !HAVE_INET_ATON
|
1999-04-24 20:26:31 +00:00
|
|
|
#if HAVE_NETINET_IN_H
|
|
|
|
#include <netinet/in.h>
|
|
|
|
#endif
|
|
|
|
#if HAVE_ARPA_INET_H
|
|
|
|
#include <arpa/inet.h>
|
|
|
|
#endif
|
|
|
|
|
1999-04-21 19:01:38 +00:00
|
|
|
extern int inet_aton(const char *, struct in_addr *);
|
|
|
|
#endif
|
|
|
|
|
2000-07-02 23:46:51 +00:00
|
|
|
#endif /* FLOCK_COMPAT_H */
|