* How to support LFS on ppc
@ 2005-09-14 9:12 JohnsonCheng
0 siblings, 0 replies; 3+ messages in thread
From: JohnsonCheng @ 2005-09-14 9:12 UTC (permalink / raw)
To: linux-ppc-embedded
[-- Attachment #1: Type: text/plain, Size: 689 bytes --]
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);
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
[-- Attachment #2: Type: text/html, Size: 6370 bytes --]
^ permalink raw reply [flat|nested] 3+ messages in thread
* RE: How to support LFS on ppc
@ 2005-09-14 9:47 Fillod Stephane
2005-09-14 11:45 ` JohnsonCheng
0 siblings, 1 reply; 3+ messages in thread
From: Fillod Stephane @ 2005-09-14 9:47 UTC (permalink / raw)
To: linux-ppc-embedded
>I have a problem about Large File System on ppc. The following is my =
example code:
Actually not problem with LFS, but with int types.
>#define _FILE_OFFSET_BITS 64
>#include <sys/stat.h>
>#include <unistd.h>
>Int main()
>{
>=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 struct stat buf;
>=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 stat64("/3G",&buf);
>=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 printf("size of test =3D %ld =
\n",buf.st_size);
^^^
Try %lld instead. Or to be portable, #include <inttypes.h>
and printf("size of test =3D %" PRId64 "\n", buf.st_size);
--=20
Stephane
^ permalink raw reply [flat|nested] 3+ messages in thread
* RE: How to support LFS on ppc
2005-09-14 9:47 Fillod Stephane
@ 2005-09-14 11:45 ` JohnsonCheng
0 siblings, 0 replies; 3+ messages in thread
From: JohnsonCheng @ 2005-09-14 11:45 UTC (permalink / raw)
To: 'Fillod Stephane', 'linux-ppc-embedded'
Dear Stephane,
Great. It's work when I use %lld instead of %ld.
Thanks,
Johnson Cheng
-----Original Message-----
From: Fillod Stephane [mailto:stephane.fillod@thomson.net]=20
Sent: Wednesday, September 14, 2005 5:48 PM
To: linux-ppc-embedded
Cc: JohnsonCheng
Subject: RE: How to support LFS on ppc=20
>I have a problem about Large File System on ppc. The following is my
example code:
Actually not problem with LFS, but with int types.
>#define _FILE_OFFSET_BITS 64
>#include <sys/stat.h>
>#include <unistd.h>
>Int main()
>{
>=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 struct stat buf;
>=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 stat64("/3G",&buf);
>=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 printf("size of test =3D %ld =
\n",buf.st_size);
^^^
Try %lld instead. Or to be portable, #include <inttypes.h>
and printf("size of test =3D %" PRId64 "\n", buf.st_size);
--=20
Stephane
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2005-09-14 11:46 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-09-14 9:12 How to support LFS on ppc JohnsonCheng
-- strict thread matches above, loose matches on Subject: below --
2005-09-14 9:47 Fillod Stephane
2005-09-14 11:45 ` JohnsonCheng
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).