From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from qnap.com.tw (unknown [211.75.85.27]) by ozlabs.org (Postfix) with SMTP id 8F4D568275 for ; Wed, 14 Sep 2005 19:12:15 +1000 (EST) From: "JohnsonCheng" To: "linux-ppc-embedded" Date: Wed, 14 Sep 2005 17:12:09 +0800 MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_NextPart_000_019B_01C5B94F.70EDBA30" Message-Id: <20050914091215.8F4D568275@ozlabs.org> Subject: How to support LFS on ppc List-Id: Linux on Embedded PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , This is a multi-part message in MIME format. ------=_NextPart_000_019B_01C5B94F.70EDBA30 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit Dear All, I have a problem about Large File System on ppc. The following is my example code: #define _FILE_OFFSET_BITS 64 #include #include Int main() { struct stat buf; stat64("/3G",&buf); printf("size of test = %ld \n",buf.st_size); lstat64("/3G",&buf); printf("size of test 2= %ld\n",buf.st_size); return 0; } The conclusion is as following: size of test = 2141735952 size of test 2= 805910402 But the real size of 3G file is 3145728000. I think it maybe the offset is wrong, but I don't know how to correct it. Can someone give me some advise. Thanks, Johnson Cheng ------=_NextPart_000_019B_01C5B94F.70EDBA30 Content-Type: text/html; charset="US-ASCII" Content-Transfer-Encoding: quoted-printable

Dear All,

 

I have a problem about Large File System on = ppc. The following is my example code:

 

#define _FILE_OFFSET_BITS 64

#include = <sys/stat.h>

#include = <unistd.h>

Int main()

{

        =    struct stat buf;

        =    stat64(“/3G”,&buf);<= /p>

        =    printf(“size of test =3D %ld \n”,buf.st_size);

        =    lstat64(“/3G”,&buf);<= /p>

     printf(“size of = test 2=3D %ld\n”,buf.st_size);

        =    return 0;

}

 

The conclusion is as = following:

size of test =3D = 2141735952

size of test 2=3D = 805910402

 

But the real size of 3G file is 3145728000. I think it maybe the = offset is wrong, but I don’t know how to correct it. Can someone give me = some advise.

 

Thanks,

Johnson Cheng

------=_NextPart_000_019B_01C5B94F.70EDBA30--