Skip to contentSkip to conversation

large file support?

DISCUSSION Steven Scholz 2 participants 7 messages Jul 31, 2003

lore
Share & tools
lore
#0 lore raw

Hi there,

how could I find out if the kernel and the glibc I am using will correctly supprot large files (>2GB)?

Thanks,

Steven

** Sent via the linuxppc-embedded mail list. See http://lists.linuxppc.org/

#1 lore raw
Quoted 3 lines · In message <[email protected]> you wrote:

how could I find out if the kernel and the glibc I am using will correctly supprot large files (>2GB)?

	char buf[4096];
	for (;;)
		write (fd, buf, sizeof(buf));

:-)

Best regards,

Wolfgang Denk

--
Software Engineering: Embedded and Realtime Systems, Embedded Linux
Phone: (+49)-8142-4596-87 Fax: (+49)-8142-4596-88 Email: [email protected] Perl already has an IDE. It's called Unix.
-- Tom Christiansen in [email protected]

** Sent via the linuxppc-embedded mail list. See http://lists.linuxppc.org/

#2 lore raw
Quoted 10 lines · Wolfgang Denk
Quoted 2 lines · In message <[email protected]> you wrote:

how could I find out if the kernel and the glibc I am using will correctly supprot large files (>2GB)?

	char buf[4096];
	for (;;)
		write (fd, buf, sizeof(buf));

:o)

But what will happen if I (or my application) have no large file support, i.e. is the failure deterministic? And will it be obvious? Just by do "ls -l"????

:-)

Thanks anyway!

Steven

** Sent via the linuxppc-embedded mail list. See http://lists.linuxppc.org/

#3 lore raw
In reply to Steven Scholz
Quoted 2 lines · I wrote:

how could I find out if the kernel and the glibc I am using will correctly supprot large files (>2GB)?

I reckon my app does not support large files. Since after writing 2GB to a file

~ # ls -lh /mnt/intern/HDD_STRESS/2003-07-31\ 12-27-34\ \(1\)/

-rw-r--r--    1 root     root         1.0G Jul 31 13:57 K001_G0.raw
-rw-r--r--    1 root     root         1.0G Jul 31 13:57 K002_G0.raw
-rw-r--r--    1 root     root         2.0G Jul 31 13:57 V001_G0.raw

~

it claims "disk full" although

~ # df -h

Filesystem                Size      Used Available Use% Mounted on
/dev/mtdblock0            6.9M      5.1M      1.8M  74% /
/dev/shm                  7.1M     24.0k      7.1M   0% /var
/dev/hda1                 9.2G      4.0G      4.7G  46% /mnt/intern

Thanks,

Steven

** Sent via the linuxppc-embedded mail list. See http://lists.linuxppc.org/

#4 lore raw
Quoted 3 lines · In message <[email protected]> you wrote:

I reckon my app does not support large files. Since after writing 2GB to a file

Did you build it with the required options, like #defining
_FILE_OFFSET_BITS as 64 ?

Best regards,

Wolfgang Denk

--
Software Engineering: Embedded and Realtime Systems, Embedded Linux
Phone: (+49)-8142-4596-87 Fax: (+49)-8142-4596-88 Email: [email protected] You are only young once, but you can stay immature indefinitely.

** Sent via the linuxppc-embedded mail list. See http://lists.linuxppc.org/

#5 lore raw
Quoted 8 lines · Wolfgang Denk
Quoted 2 lines · In message <[email protected]> you wrote:

I reckon my app does not support large files. Since after writing 2GB to a file

Did you build it with the required options, like #defining
_FILE_OFFSET_BITS as 64 ?

Nope!
But good point! :o)
And I just got these lines:

Quoted 4 lines · Fillod Stephane

Recent kernel and glibc are fine.

Pass O_LARGEFILE to the second open() arg, and compile with "-D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64" should do it.

and rebuilt my application. But the test (with my app) will take a while...

Thanks!

Steven

** Sent via the linuxppc-embedded mail list. See http://lists.linuxppc.org/

#6 lore raw
Quoted 10 lines · I wrote:

And I just got these lines:

Quoted 4 lines · Fillod Stephane

Recent kernel and glibc are fine.

Pass O_LARGEFILE to the second open() arg, and compile with "-D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64" should do it.

and rebuilt my application. But the test (with my app) will take a while...

Now I the app is still running although the file is > 2GB. I get

~ # ls -l /mnt/intern/HDD_STRESS/2003-07-31\ 1* /mnt/intern/HDD_STRESS/2003-07-31 14-54-57 (1):
ls: /mnt/intern/HDD_STRESS/2003-07-31 14-54-57 (1)/V001_G0.raw: Value too large for defined data type

-rw-r--r--    1 root     root    1080356864 Jul 31 16:25 K001_G0.raw
-rw-r--r--    1 root     root    1080356864 Jul 31 16:25 K002_G0.raw

I guess I have to rebuild busybox with LFS as well...

Thanks to you all!

Steven

** Sent via the linuxppc-embedded mail list. See http://lists.linuxppc.org/