ID: 15260
Comment by: zakd at max-t dot com
Reported By: wweng at kencast dot com
Status: No Feedback
Bug Type: *Directory/Filesystem functions
Operating System: Linux
PHP Version: 4.0.5
New Comment:
This problem still exists in PHP4.3.2.
RedHat8.0, I'm using, does support 64 bits. If I have a 4G file
-rw-r--r-- 1 root root 4.0G Oct 15 11:00 file4gb
and run stat in the shell, it does the right thing and returns
%stat -t file4gb
<output>
file4gb 4299161600 8396800 81a4 0 0 c 72126888 1 0 0 1066229977
1066230022 1066237543 4096
</output>
but PHP file I/Os don't seem to be able to handle 64 bits
Previous Comments:
------------------------------------------------------------------------
[2002-03-20 00:00:03] php-bugs at lists dot php dot net
No feedback was provided for this bug for over a month, so it is
being suspended automatically. If you are able to provide the
information that was originally requested, please do so and change
the status of the bug back to "Open".
------------------------------------------------------------------------
[2002-01-28 20:53:13] wweng at kencast dot com
>From what I had been researching on google, compiling a package with
uniformed 64 bits I/O functions requires -D_FILE_OFFSET_BITS=64 (and
kernel 2.4.x and glibc 2.2.2+). I greped through the php 4.1.1 source
code downloaded from php.net, couldn't find any trace of such option in
any of the files. (At least I would think it should exist in the
Makefile.ams) Maybe it had been forgotten?
------------------------------------------------------------------------
[2002-01-28 20:43:45] [EMAIL PROTECTED]
If the OS is compiled and installed on a 64 bit system,
or with large file support (read: kernel, libc, others)
then calls to stat() and friends return 64-bit structures. You don't
need to call stat64 expressly. A stock RedHat-7.2
box isn't 64bit compliant unless it's compiled that way.
The VCWD_STAT macro uses stat(path, buff), not
stat(path, mode). I've had a look at stat.h and see
the references to stat64(path, buff) if large file
support is defined, but I'm in a little over my head
here, so I bow to [EMAIL PROTECTED]'s mastery of php
internals. :)
I don't have access to a 64bit box or fs to confirm, so I guess I
jumped the gun on this one, but IMHO, this isn't a
PHP *bug*.
Sorry for the confusion.
------------------------------------------------------------------------
[2002-01-28 15:44:49] wweng at kencast dot com
I believe I had found the reason of this bug.
file_exists function ultimately calls VCWD_STAT function defined in
TSRM/tsrm_virtual_cwd.h. However, the VCWD_STAT function is only a
macro for stat(path, mode), and under Linux, you need stat64 for 64 bit
file stats operations.
hmm, and all the file I/Os under PHP right now do not support 64 bits.
This is bad...
------------------------------------------------------------------------
[2002-01-28 15:26:54] wweng at kencast dot com
Can not seem to find the RPM(php-4.1.1) for Redhat 7.2. :(
There is no build environment on testing machines.
------------------------------------------------------------------------
The remainder of the comments for this report are too long. To view
the rest of the comments, please view the bug report online at
http://bugs.php.net/15260
--
Edit this bug report at http://bugs.php.net/?id=15260&edit=1