#include <io.h>
#endif
+#ifdef __BEOS__
+#define realpath(x,y) strcpy(y,x)
+#endif
+
#define VIRTUAL_CWD_DEBUG 0
#ifdef ZTS
CPPFLAGS="$CPPFLAGS -traditional-cpp";;
*bsdi*)
BSD_MAKEFILE=yes;;
+*beos*)
+ LIBS="$LIBS -lbe -lroot"
esac
AM_PROG_CC_STDC
stdlib.h \
string.h \
syslog.h \
+sysexits.h \
sys/file.h \
sys/mman.h \
sys/resource.h \
sys/socket.h \
sys/statfs.h \
sys/statvfs.h \
+sys/sysexits.h \
sys/time.h \
sys/types.h \
sys/varargs.h \
gcvt \
getlogin \
gethostbyaddr \
+getprotobyname \
+getprotobynumber \
getrusage \
gettimeofday \
gmtime_r \
#if !defined(MSDOS) && !defined(__WIN__)
#include <sys/socket.h>
#include <netinet/in.h>
+#ifdef HAVE_ARPA_INET_H
#include <arpa/inet.h>
+#endif
#include <netdb.h>
#ifdef HAVE_SELECT_H
# include <select.h>
#include <time.h>
#include <stdio.h>
#include <netdb.h>
+#if HAVE_ARPA_INET_H
#include <arpa/inet.h>
+#endif
#if HAVE_UNISTD_H
#include <unistd.h>
#endif
PHP_FE(mt_srand, NULL)
PHP_FE(mt_getrandmax, NULL)
PHP_FE(getservbyname, NULL)
+#if HAVE_GETSERVBYPORT
PHP_FE(getservbyport, NULL)
+#endif
+#if HAVE_GETPROTOBYNAME
PHP_FE(getprotobyname, NULL)
+#endif
+#if HAVE_GETPROTOBYNUMBER
PHP_FE(getprotobynumber, NULL)
+#endif
PHP_FE(gethostbyaddr, NULL)
PHP_FE(gethostbyname, NULL)
PHP_FE(gethostbynamel, NULL)
-#if !defined(PHP_WIN32)||HAVE_BINDLIB
+#if HAVE_BINDLIB && !(defined(__BEOS__)||defined(PHP_WIN32))
PHP_FE(checkdnsrr, NULL)
PHP_FE(getmxrr, second_and_third_args_force_ref)
#else
PHP_FALIAS(socket_set_timeout, warn_not_available, NULL)
#endif
PHP_FE(socket_get_status, NULL)
-#if !defined(PHP_WIN32) || defined(ZTS)
+#if (!defined(PHP_WIN32) && !defined(__BEOS__)) || defined(ZTS)
PHP_FE(realpath, NULL)
#else
PHP_FALIAS(realpath, warn_not_available, NULL)
/* {{{ proto string getservbyport(int port, string protocol)
Returns service name associated with port. Protocol must be "tcp" or "udp". */
+#if HAVE_GETSERVBYPORT
PHP_FUNCTION(getservbyport)
{
pval **port,**proto;
RETURN_STRING(serv->s_name,1);
}
+#endif
/* }}} */
/* {{{ proto int getprotobyname(string name)
Returns protocol number associated with name as per /etc/protocols */
+#if HAVE_GETPROTOBYNAME
PHP_FUNCTION(getprotobyname)
{
pval **name;
RETURN_LONG(ent->p_proto);
}
+#endif
/* }}} */
/* {{{ proto string getprotobynumber(int proto)
Returns protocol name associated with protocol number proto */
+#if HAVE_GETPROTOBYNUMBER
PHP_FUNCTION(getprotobynumber)
{
pval **proto;
RETURN_STRING(ent->p_name,1);
}
+#endif
/* }}} */
#define WINNT 1
#endif
/* located in www.php.net/extra/bindlib.zip */
+#if HAVE_ARPA_INET_H
#include "arpa/inet.h"
+#endif
#include "netdb.h"
+#if HAVE_ARPA_NAMESERV_H
#include "arpa/nameser.h"
+#endif
+#if HAVE_RESOLV_H
#include "resolv.h"
#endif
+#endif
#include <winsock.h>
#else
#include <netinet/in.h>
return estrdup(inet_ntoa(in));
}
-#if !defined(PHP_WIN32)||HAVE_BINDLIB
+#if HAVE_BINDLIB && !(defined(__BEOS__)||defined(PHP_WIN32))
/* {{{ proto int checkdnsrr(string host [, string type])
Check DNS records corresponding to a given Internet host name or IP address */
#include <sys/socket.h>
#include <netinet/in.h>
#include <netdb.h>
+#if HAVE_ARPA_INET_H
#include <arpa/inet.h>
#endif
+#endif
#include "ext/standard/head.h"
#include "safe_mode.h"
#include "php_string.h"
/* }}} */
-#if !defined(PHP_WIN32) || defined(ZTS)
+#if (!defined(PHP_WIN32) && !defined(__BEOS__)) || defined(ZTS)
/* {{{ proto string realpath(string path)
Return the resolved path */
PHP_FUNCTION(realpath)
case S_IFDIR: RETURN_STRING("dir",1);
case S_IFBLK: RETURN_STRING("block",1);
case S_IFREG: RETURN_STRING("file",1);
-#ifndef ZEND_WIN32
+#if !defined(ZEND_WIN32)&&!defined(__BEOS__)
case S_IFSOCK: RETURN_STRING("socket",1);
#endif
}
#else
#include <netinet/in.h>
#include <netdb.h>
+#if HAVE_ARPA_INET_H
#include <arpa/inet.h>
#endif
+#endif
#ifdef PHP_WIN32
#undef AF_UNIX
#endif
struct timeval *timeout)
{
/* probably won't work on Win32, someone else might try it (read: fix it ;) */
-#if !defined(PHP_WIN32) && (defined(O_NONBLOCK) || defined(O_NDELAY))
+
+#if (!defined(__BEOS__) && !defined(PHP_WIN32)) && (defined(O_NONBLOCK) || defined(O_NDELAY))
#ifndef O_NONBLOCK
#define O_NONBLOCK O_NDELAY
#else
#include <netinet/in.h>
#include <netdb.h>
+#if HAVE_ARPA_INET_H
#include <arpa/inet.h>
#endif
+#endif
#ifdef PHP_WIN32
#undef AF_UNIX
#else
#include <netinet/in.h>
#include <netdb.h>
+#if HAVE_ARPA_INET_H
#include <arpa/inet.h>
#endif
+#endif
#ifdef PHP_WIN32
#undef AF_UNIX
#include "ext/standard/info.h"
#if !defined(PHP_WIN32)
#include "build-defs.h"
+#if HAVE_SYSEXITS_H
#include <sysexits.h>
#endif
+#if HAVE_SYS_SYSEXITS_H
+#include <sys/sysexits.h>
+#endif
+#endif
#include "php_mail.h"
#include "php_ini.h"
REGISTER_LONG_CONSTANT("LOG_CONS", LOG_CONS, CONST_CS | CONST_PERSISTENT);
REGISTER_LONG_CONSTANT("LOG_ODELAY", LOG_ODELAY, CONST_CS | CONST_PERSISTENT);
REGISTER_LONG_CONSTANT("LOG_NDELAY", LOG_NDELAY, CONST_CS | CONST_PERSISTENT);
+#ifdef LOG_NOWAIT
REGISTER_LONG_CONSTANT("LOG_NOWAIT", LOG_NOWAIT, CONST_CS | CONST_PERSISTENT);
+#endif
#ifdef LOG_PERROR
/* AIX doesn't have LOG_PERROR */
REGISTER_LONG_CONSTANT("LOG_PERROR", LOG_PERROR, CONST_CS | CONST_PERSISTENT); /*log to stderr*/
SET_VAR_LONG("LOG_CONS", LOG_CONS);
SET_VAR_LONG("LOG_ODELAY", LOG_ODELAY);
SET_VAR_LONG("LOG_NDELAY", LOG_NDELAY);
+#ifdef LOG_NOWAIT
+ /* BeOS doesn't have LOG_NOWAIT */
SET_VAR_LONG("LOG_NOWAIT", LOG_NOWAIT);
+#endif
#ifdef LOG_PERROR
/* AIX doesn't have LOG_PERROR */
SET_VAR_LONG("LOG_PERROR", LOG_PERROR); /*log to stderr*/
#else
#include <netinet/in.h>
#include <netdb.h>
+#if HAVE_ARPA_INET_H
#include <arpa/inet.h>
#endif
+#endif
#ifdef PHP_WIN32
#undef AF_UNIX
#ifndef PHP_WIN32
#include <netinet/in.h>
#include <netdb.h>
+#if HAVE_ARPA_INET_H
#include <arpa/inet.h>
+#endif
#else
int inet_aton(const char *, struct in_addr *);
#endif
#include <sys/socket.h>
#include <netinet/in.h>
#include <netdb.h>
+#if HAVE_ARPA_INET_H
#include <arpa/inet.h>
#endif
+#endif
#ifdef HAVE_SYS_TIME_H
#include <sys/time.h>
#endif
#include <sys/file.h>
#endif
+#if !defined(P_tmpdir)
+#define P_tmpdir ""
+#endif
+
/* {{{ php_open_temporary_file */
/* Loosely based on a tempnam() implementation by UCLA */