diff options
author | Denis Vlasenko <vda.linux@googlemail.com> | 2006-11-25 14:46:21 +0000 |
---|---|---|
committer | Denis Vlasenko <vda.linux@googlemail.com> | 2006-11-25 14:46:21 +0000 |
commit | 5dd27b1ee0518f4f886e6140adc5d1f20fb770e2 (patch) | |
tree | 546e4315d96ed4dc0610ef8c7c75ed4397b20f64 | |
parent | ed836cdc30642ddbecc286b279d461ca44135cbb (diff) |
dd: support >2gb values for seek, skip, count
-rw-r--r-- | coreutils/dd.c | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/coreutils/dd.c b/coreutils/dd.c index 96ea32f06..01702a580 100644 --- a/coreutils/dd.c +++ b/coreutils/dd.c @@ -44,6 +44,12 @@ static ssize_t full_write_or_warn(int fd, const void *buf, size_t len, return n; } +#if ENABLE_LFS +#define XATOU_SFX xatoull_sfx +#else +#define XATOU_SFX xatoul_sfx +#endif + int dd_main(int argc, char **argv) { enum { @@ -79,13 +85,13 @@ int dd_main(int argc, char **argv) obs = xatoul_range_sfx(arg+4, 0, ((size_t)-1L)/2, dd_suffixes); else if (!strncmp("bs=", arg, 3)) ibs = obs = xatoul_range_sfx(arg+3, 0, ((size_t)-1L)/2, dd_suffixes); - // FIXME: make them capable of eating LARGE numbers + /* These can be large: */ else if (!strncmp("count=", arg, 6)) - count = xatoul_sfx(arg+6, dd_suffixes); + count = XATOU_SFX(arg+6, dd_suffixes); else if (!strncmp("seek=", arg, 5)) - seek = xatoul_sfx(arg+5, dd_suffixes); + seek = XATOU_SFX(arg+5, dd_suffixes); else if (!strncmp("skip=", arg, 5)) - skip = xatoul_sfx(arg+5, dd_suffixes); + skip = XATOU_SFX(arg+5, dd_suffixes); else if (!strncmp("if=", arg, 3)) infile = arg+3; |