_FILE_OFFSET_BITS=64 considered harmful

From: Date: Fri, 22 Oct 2004 06:22:49 +0000
Subject: _FILE_OFFSET_BITS=64 considered harmful
Groups: php.internals 
Request: Send a blank email to internals+get-13440@lists.php.net to get a copy of this message
There are serious problems from enabling LFS support like this in a project like PHP. If I have some library which uses off_t in its API, e.g. zlib, and I happened to not compile it with LFS support, e.g. as in most Linux distributions, I now *cannot* call the zlib functions using off_t from PHP, because the size of off_t when you #include <zlib.h> will be different from the size when zlib is compiled. Similar cases for any SAPI module if the server interface exposes off_t. The safe way of doing this which we use in APR 1.0 is to define a wrapper type (e.g php_off_t) which is typedef'd to off64_t when -D_LARGEFILE64_SOURCE is supported, and off_t otherwise, to open files using O_LARGEFILE, and to use the "transitional LFS" functions like lseek64 etc in place of lseek etc when php_off_t is off64_t. ----- Forwarded message from Edin Kadribasic <edink@php.net> ----- From: "Edin Kadribasic" <edink@php.net> To: php-cvs@lists.php.net Date: Thu, 21 Oct 2004 23:57:39 -0000 Subject: [PHP-CVS] cvs: php-src(PHP_5_0) / configure.in edink Thu Oct 21 19:57:39 2004 EDT Modified files: (Branch: PHP_5_0) /php-src configure.in Log: MFB: Linux LFS support, fixes 27792 http://cvs.php.net/diff.php/php-src/configure.in?r1=1.514.2.11&r2=1.514.2.12&ty=u Index: php-src/configure.in diff -u php-src/configure.in:1.514.2.11 php-src/configure.in:1.514.2.12 --- php-src/configure.in:1.514.2.11 Tue Sep 28 05:13:32 2004 +++ php-src/configure.in Thu Oct 21 19:57:37 2004 @@ -1,4 +1,4 @@ -dnl ## $Id: configure.in,v 1.514.2.11 2004/09/28 09:13:32 wez Exp $ -*- sh -*- +dnl ## $Id: configure.in,v 1.514.2.12 2004/10/21 23:57:37 edink Exp $ -*- sh -*- dnl ## Process this file with autoconf to produce a configure script. divert(1) @@ -196,6 +196,13 @@ LIBS="$LIBS -lbe -lroot";; *mips*) CPPFLAGS="$CPPFLAGS -D_XPG_IV";; +*linux*) + AC_MSG_CHECKING([for Linux LFS_CFLAGS]) + LFS_LINUX_CFLAGS=getconf LFS_CFLAGS + if test "x$LFS_LINUX_CFLAGS" != "x"; then + CFLAGS="$CFLAGS $LFS_LINUX_CFLAGS" + fi + AC_MSG_RESULT([$LFS_LINUX_CFLAGS]) esac -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php ----- End forwarded message -----

« previous php.internals (#13440) next »