Back to index

php5  5.3.10
flock_compat.h
Go to the documentation of this file.
00001 /*
00002    +----------------------------------------------------------------------+
00003    | PHP Version 5                                                        |
00004    +----------------------------------------------------------------------+
00005    | Copyright (c) 1997-2012 The PHP Group                                |
00006    +----------------------------------------------------------------------+
00007    | This source file is subject to version 3.01 of the PHP license,      |
00008    | that is bundled with this package in the file LICENSE, and is        |
00009    | available through the world-wide-web at the following url:           |
00010    | http://www.php.net/license/3_01.txt                                  |
00011    | If you did not receive a copy of the PHP license and are unable to   |
00012    | obtain it through the world-wide-web, please send a note to          |
00013    | license@php.net so we can mail you a copy immediately.               |
00014    +----------------------------------------------------------------------+
00015    | Author: Sascha Schumann <sascha@schumann.cx>                         |
00016    +----------------------------------------------------------------------+
00017 */
00018 
00019 /* $Id: flock_compat.h 321634 2012-01-01 13:15:04Z felipe $ */
00020 
00021 #ifndef FLOCK_COMPAT_H
00022 #define FLOCK_COMPAT_H
00023 
00024 /* php_flock internally uses fcntl whther or not flock is available
00025  * This way our php_flock even works on NFS files.
00026  * More info: /usr/src/linux/Documentation
00027  */
00028 PHPAPI int php_flock(int fd, int operation);
00029 
00030 #ifndef HAVE_FLOCK
00031 #      define LOCK_SH 1
00032 #      define LOCK_EX 2
00033 #      define LOCK_NB 4
00034 #      define LOCK_UN 8
00035 PHPAPI int flock(int fd, int operation);
00036 #endif
00037 
00038 /* Userland LOCK_* constants */
00039 #define PHP_LOCK_SH 1
00040 #define PHP_LOCK_EX 2
00041 #define PHP_LOCK_UN 3
00042 #define PHP_LOCK_NB 4
00043 
00044 #ifdef PHP_WIN32
00045 # ifdef EWOULDBLOCK
00046 #  undef EWOULDBLOCK
00047 # endif
00048 # define EWOULDBLOCK WSAEWOULDBLOCK
00049 # define fsync _commit
00050 # define ftruncate(a, b) chsize(a, b)
00051 #endif /* defined(PHP_WIN32) */
00052 
00053 #if !HAVE_INET_ATON
00054 #if HAVE_NETINET_IN_H
00055 #include <netinet/in.h>
00056 #endif
00057 #if HAVE_ARPA_INET_H
00058 #include <arpa/inet.h>
00059 #endif
00060 
00061 #ifndef PHP_WIN32
00062 extern int inet_aton(const char *, struct in_addr *); 
00063 #endif
00064 #endif
00065 
00066 #endif /* FLOCK_COMPAT_H */