diff options
author | Eric Andersen <andersen@codepoet.org> | 2000-09-21 02:23:30 +0000 |
---|---|---|
committer | Eric Andersen <andersen@codepoet.org> | 2000-09-21 02:23:30 +0000 |
commit | 8a2e56c5dfc41f6946e36234eef4df559286db05 (patch) | |
tree | 23a5f54bcbf8aea8f08ae85f8397b7add91bf79f | |
parent | 350b3f9236b29514f3755af2b4b2957475abf829 (diff) | |
download | busybox-w32-8a2e56c5dfc41f6946e36234eef4df559286db05.tar.gz busybox-w32-8a2e56c5dfc41f6946e36234eef4df559286db05.tar.bz2 busybox-w32-8a2e56c5dfc41f6946e36234eef4df559286db05.zip |
Large file >2Gib support.
-rw-r--r-- | Makefile | 14 | ||||
-rw-r--r-- | coreutils/ls.c | 8 | ||||
-rw-r--r-- | ls.c | 8 | ||||
-rw-r--r-- | more.c | 4 | ||||
-rw-r--r-- | util-linux/more.c | 4 |
5 files changed, 38 insertions, 0 deletions
@@ -40,6 +40,16 @@ DODEBUG = false | |||
40 | # Do not enable this for production builds... | 40 | # Do not enable this for production builds... |
41 | DODMALLOC = false | 41 | DODMALLOC = false |
42 | 42 | ||
43 | # If you want large file summit support, turn this on. | ||
44 | # This has no effect if you don't have a kernel with lfs | ||
45 | # support, and a system with libc-2.1.3 or later. | ||
46 | # Some of the programs that can benefit from lfs support | ||
47 | # are dd, gzip, mount, tar, and mkfs_minix. | ||
48 | # LFS allows you to use the above programs for files | ||
49 | # larger than 2GB! | ||
50 | DOLFS = false | ||
51 | |||
52 | |||
43 | # If you are running a cross compiler, you may want to set this | 53 | # If you are running a cross compiler, you may want to set this |
44 | # to something more interesting... | 54 | # to something more interesting... |
45 | CROSS = #powerpc-linux- | 55 | CROSS = #powerpc-linux- |
@@ -63,6 +73,10 @@ OPTIMIZATION = $(shell if $(CC) -Os -S -o /dev/null -xc /dev/null >/dev/null 2>& | |||
63 | 73 | ||
64 | WARNINGS = -Wall | 74 | WARNINGS = -Wall |
65 | 75 | ||
76 | ifeq ($(DOLFS),true) | ||
77 | # For large file summit support | ||
78 | CFLAGS+=-D_FILE_OFFSET_BITS=64 | ||
79 | endif | ||
66 | ifeq ($(DODMALLOC),true) | 80 | ifeq ($(DODMALLOC),true) |
67 | # For testing mem leaks with dmalloc | 81 | # For testing mem leaks with dmalloc |
68 | CFLAGS+=-DDMALLOC | 82 | CFLAGS+=-DDMALLOC |
diff --git a/coreutils/ls.c b/coreutils/ls.c index 03fed5478..b818003a8 100644 --- a/coreutils/ls.c +++ b/coreutils/ls.c | |||
@@ -532,7 +532,11 @@ int list_single(struct dnode *dn) | |||
532 | column += 8; | 532 | column += 8; |
533 | break; | 533 | break; |
534 | case LIST_BLOCKS: | 534 | case LIST_BLOCKS: |
535 | #if _FILE_OFFSET_BITS == 64 | ||
536 | fprintf(stdout, "%4lld ", dn->dstat.st_blocks>>1); | ||
537 | #else | ||
535 | fprintf(stdout, "%4ld ", dn->dstat.st_blocks>>1); | 538 | fprintf(stdout, "%4ld ", dn->dstat.st_blocks>>1); |
539 | #endif | ||
536 | column += 5; | 540 | column += 5; |
537 | break; | 541 | break; |
538 | case LIST_MODEBITS: | 542 | case LIST_MODEBITS: |
@@ -578,7 +582,11 @@ int list_single(struct dnode *dn) | |||
578 | if (S_ISBLK(dn->dstat.st_mode) || S_ISCHR(dn->dstat.st_mode)) { | 582 | if (S_ISBLK(dn->dstat.st_mode) || S_ISCHR(dn->dstat.st_mode)) { |
579 | fprintf(stdout, "%4d, %3d ", (int)MAJOR(dn->dstat.st_rdev), (int)MINOR(dn->dstat.st_rdev)); | 583 | fprintf(stdout, "%4d, %3d ", (int)MAJOR(dn->dstat.st_rdev), (int)MINOR(dn->dstat.st_rdev)); |
580 | } else { | 584 | } else { |
585 | #if _FILE_OFFSET_BITS == 64 | ||
586 | fprintf(stdout, "%9lld ", dn->dstat.st_size); | ||
587 | #else | ||
581 | fprintf(stdout, "%9ld ", dn->dstat.st_size); | 588 | fprintf(stdout, "%9ld ", dn->dstat.st_size); |
589 | #endif | ||
582 | } | 590 | } |
583 | column += 10; | 591 | column += 10; |
584 | break; | 592 | break; |
@@ -532,7 +532,11 @@ int list_single(struct dnode *dn) | |||
532 | column += 8; | 532 | column += 8; |
533 | break; | 533 | break; |
534 | case LIST_BLOCKS: | 534 | case LIST_BLOCKS: |
535 | #if _FILE_OFFSET_BITS == 64 | ||
536 | fprintf(stdout, "%4lld ", dn->dstat.st_blocks>>1); | ||
537 | #else | ||
535 | fprintf(stdout, "%4ld ", dn->dstat.st_blocks>>1); | 538 | fprintf(stdout, "%4ld ", dn->dstat.st_blocks>>1); |
539 | #endif | ||
536 | column += 5; | 540 | column += 5; |
537 | break; | 541 | break; |
538 | case LIST_MODEBITS: | 542 | case LIST_MODEBITS: |
@@ -578,7 +582,11 @@ int list_single(struct dnode *dn) | |||
578 | if (S_ISBLK(dn->dstat.st_mode) || S_ISCHR(dn->dstat.st_mode)) { | 582 | if (S_ISBLK(dn->dstat.st_mode) || S_ISCHR(dn->dstat.st_mode)) { |
579 | fprintf(stdout, "%4d, %3d ", (int)MAJOR(dn->dstat.st_rdev), (int)MINOR(dn->dstat.st_rdev)); | 583 | fprintf(stdout, "%4d, %3d ", (int)MAJOR(dn->dstat.st_rdev), (int)MINOR(dn->dstat.st_rdev)); |
580 | } else { | 584 | } else { |
585 | #if _FILE_OFFSET_BITS == 64 | ||
586 | fprintf(stdout, "%9lld ", dn->dstat.st_size); | ||
587 | #else | ||
581 | fprintf(stdout, "%9ld ", dn->dstat.st_size); | 588 | fprintf(stdout, "%9ld ", dn->dstat.st_size); |
589 | #endif | ||
582 | } | 590 | } |
583 | column += 10; | 591 | column += 10; |
584 | break; | 592 | break; |
@@ -123,7 +123,11 @@ extern int more_main(int argc, char **argv) | |||
123 | lines = 0; | 123 | lines = 0; |
124 | len = fprintf(stdout, "--More-- "); | 124 | len = fprintf(stdout, "--More-- "); |
125 | if (file != stdin) { | 125 | if (file != stdin) { |
126 | #if _FILE_OFFSET_BITS == 64 | ||
127 | len += fprintf(stdout, "(%d%% of %lld bytes)", | ||
128 | #else | ||
126 | len += fprintf(stdout, "(%d%% of %ld bytes)", | 129 | len += fprintf(stdout, "(%d%% of %ld bytes)", |
130 | #endif | ||
127 | (int) (100 * | 131 | (int) (100 * |
128 | ((double) ftell(file) / | 132 | ((double) ftell(file) / |
129 | (double) st.st_size)), | 133 | (double) st.st_size)), |
diff --git a/util-linux/more.c b/util-linux/more.c index 12168b519..45b7c1274 100644 --- a/util-linux/more.c +++ b/util-linux/more.c | |||
@@ -123,7 +123,11 @@ extern int more_main(int argc, char **argv) | |||
123 | lines = 0; | 123 | lines = 0; |
124 | len = fprintf(stdout, "--More-- "); | 124 | len = fprintf(stdout, "--More-- "); |
125 | if (file != stdin) { | 125 | if (file != stdin) { |
126 | #if _FILE_OFFSET_BITS == 64 | ||
127 | len += fprintf(stdout, "(%d%% of %lld bytes)", | ||
128 | #else | ||
126 | len += fprintf(stdout, "(%d%% of %ld bytes)", | 129 | len += fprintf(stdout, "(%d%% of %ld bytes)", |
130 | #endif | ||
127 | (int) (100 * | 131 | (int) (100 * |
128 | ((double) ftell(file) / | 132 | ((double) ftell(file) / |
129 | (double) st.st_size)), | 133 | (double) st.st_size)), |