cvs: php4 / acinclude.m4 /ext/session config.m4 /main php.h

From: Date: Sun, 20 May 2001 23:39:10 +0000
Subject: cvs: php4 / acinclude.m4 /ext/session config.m4 /main php.h
Groups: php.cvs 
Request: Send a blank email to php-cvs+get-5883@lists.php.net to get a copy of this message
sas Sun May 20 16:39:10 2001 EDT Modified files: /php4 acinclude.m4 /php4/ext/session config.m4 /php4/main php.h Log: Add support for systems where p{read|write} take a off64_t without being properly prototyped. Index: php4/acinclude.m4 diff -u php4/acinclude.m4:1.131 php4/acinclude.m4:1.132 --- php4/acinclude.m4:1.131 Sun May 20 14:55:57 2001 +++ php4/acinclude.m4 Sun May 20 16:39:09 2001 @@ -1,4 +1,4 @@ -dnl $Id: acinclude.m4,v 1.131 2001/05/20 21:55:57 sas Exp $ +dnl $Id: acinclude.m4,v 1.132 2001/05/20 23:39:09 sas Exp $ dnl dnl This file contains local autoconf functions. @@ -188,7 +188,77 @@ (eval echo \"$ac_link\"; eval $ac_link && ./conftest) >>$1 2>&1 rm -fr conftest* ]) - + +AC_DEFUN(PHP_MISSING_PREAD_DECL,[ + AC_CACHE_CHECK(whether pread works without custom declaration,ac_cv_pread,[ + AC_TRY_COMPILE([#include <unistd.h>],[size_t (*func)() = pread],[ + ac_cv_pread=yes + ],[ + echo test > conftest_in + AC_TRY_RUN([ +#include <sys/types.h> +#include <sys/stat.h> +#include <fcntl.h> + main() { char buf[3]; return !(pread(open("conftest_in", O_RDONLY), buf, 2, 0) == 2); } + ],[ + ac_cv_pread=yes + ],[ + echo test > conftest_in + AC_TRY_RUN([ +#include <sys/types.h> +#include <sys/stat.h> +#include <fcntl.h> +#include <unistd.h> + ssize_t pread(int, void *, size_t, off64_t); + main() { char buf[3]; return !(pread(open("conftest_in", O_RDONLY), buf, 2, 0) == 2); } + ],[ + ac_cv_pread=64 + ],[ + ac_cv_pread=no + ]) + ]) + ]) + ]) + case $ac_cv_pread in + no) ac_cv_func_pread=no;; + 64) AC_DEFINE(PHP_PREAD_64, 1, [whether pread64 is default]);; + esac +]) + +AC_DEFUN(PHP_MISSING_PWRITE_DECL,[ + AC_CACHE_CHECK(whether pwrite works without custom declaration,ac_cv_pwrite,[ + AC_TRY_COMPILE([#include <unistd.h>],[size_t (*func)() = pwrite],[ + ac_cv_pwrite=yes + ],[ + AC_TRY_RUN([ +#include <sys/types.h> +#include <sys/stat.h> +#include <fcntl.h> + main() { return !(pwrite(open("conftest_out", O_WRONLY|O_CREAT, 0600), "Ok", 2, 0) == 2); } + ],[ + ac_cv_pwrite=yes + ],[ + AC_TRY_RUN([ +#include <sys/types.h> +#include <sys/stat.h> +#include <fcntl.h> +#include <unistd.h> + ssize_t pwrite(int, void *, size_t, off64_t); + main() { return !(pwrite(open("conftest_out", O_WRONLY|O_CREAT, 0600), "Ok", 2, 0) == 2); } + ],[ + ac_cv_pwrite=64 + ],[ + ac_cv_pwrite=no + ]) + ]) + ]) + ]) + case $ac_cv_pwrite in + no) ac_cv_func_pwrite=no;; + 64) AC_DEFINE(PHP_PWRITE_64, 1, [whether pwrite64 is default]);; + esac +]) + AC_DEFUN(PHP_MISSING_TIME_R_DECL,[ AC_MSG_CHECKING(for missing declarations of reentrant functions) AC_TRY_COMPILE([#include <time.h>],[struct tm *(*func)() = localtime_r],[ Index: php4/ext/session/config.m4 diff -u php4/ext/session/config.m4:1.12 php4/ext/session/config.m4:1.13 --- php4/ext/session/config.m4:1.12 Sat May 12 04:08:56 2001 +++ php4/ext/session/config.m4 Sun May 20 16:39:09 2001 @@ -1,4 +1,4 @@ -dnl $Id: config.m4,v 1.12 2001/05/12 11:08:56 sas Exp $ +dnl $Id: config.m4,v 1.13 2001/05/20 23:39:09 sas Exp $ PHP_ARG_WITH(mm,for mm support, [ --with-mm[=DIR] Include mm support for session storage]) @@ -32,6 +32,8 @@ if test "$PHP_SESSION" != "no"; then AC_CHECK_FUNCS(pread pwrite) + PHP_MISSING_PWRITE_DECL + PHP_MISSING_PREAD_DECL PHP_EXTENSION(session,$ext_shared) PHP_SUBST(SESSION_SHARED_LIBADD) fi Index: php4/main/php.h diff -u php4/main/php.h:1.137 php4/main/php.h:1.138 --- php4/main/php.h:1.137 Mon Apr 30 07:23:41 2001 +++ php4/main/php.h Sun May 20 16:39:09 2001 @@ -17,7 +17,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: php.h,v 1.137 2001/04/30 14:23:41 dbeu Exp $ */ +/* $Id: php.h,v 1.138 2001/05/20 23:39:09 sas Exp $ */ #ifndef PHP_H #define PHP_H @@ -236,6 +236,14 @@ #if !defined(PHP_WIN32) extern char **environ; #define php_sleep sleep +#endif + +#ifdef PHP_PWRITE_64 +ssize_t pwrite(int, void *, size_t, off64_t); +#endif + +#ifdef PHP_PREAD_64 +ssize_t pread(int, void *, size_t, off64_t); #endif void phperror(char *error);

« previous php.cvs (#5883) next »